Skip to content

Commit

Permalink
feat: add i18n zh_cn
Browse files Browse the repository at this point in the history
  • Loading branch information
EnochGao committed May 9, 2024
1 parent b35d783 commit 79b4d06
Showing 1 changed file with 138 additions and 0 deletions.
138 changes: 138 additions & 0 deletions packages/viewer/src/bindings/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,143 @@ const translations = {
TIP_Print: "Print (P)",
},
},
"zh-CN": {
translation: {
UI_LNG: "zh-CN",
TIP_UI_Language: "语言",
CONFIRM_DELETE: "你确定要删除它吗?",
CONFIRM_REMOVE: "你确定要移除它吗?",
CONFIRM_REMOVE_ALL: "你确定要全部移除吗?",
Input_: "请输入文档URL或HTML代码",
Book_Mode: "图书模式",
Render_All_Pages: "渲染所有页面",
Apply: "应用",
Supported_document_types_: "Supported document types:",
HTML_documents_: "HTML documents, with CSS for paged media",
Book_like_publications_: "Book-like publications, with Table of Contents",
Web_publications_:
"Web publications (a collection of HTML documents): specify URL of the first HTML or the manifest file.",
Unzipped_EPUB_:
"Unzipped EPUB: specify URL of OPF file or top directory of the unzipped EPUB files.",
Notes_: "Notes:",
GitHub_:
"GitHub and Gist URLs can be directly specified. Vivliostyle loads raw github/gist content when such URL is specified.",
WARN_Mixed_Content_:
"⚠️Mixed Content (“http:” URL is specified to “https:” Vivliostyle Viewer) is usually blocked by browser.",
WARN_Cross_Origin_:
"⚠️Cross-Origin (request to different domain) is usually blocked by browser unless the server is configured to allow Cross-Origin Resource Sharing (CORS).",
URL_parameter_options_: "URL parameter options:",
document_URL: "document URL",
default_: "(default)",
for_Book_like_: "for Book-like publications",
DESC_Book_Mode_:
"When an HTML document URL is specified, a series of HTML documents linked from the publication manifest or Table of Contents (e.g., marked up with '<nav role=\"doc-toc\">') are automatically loaded.",
for_single_HTML_: "for single HTML documents",
for_Print_:
"for Print (all pages printable, page count works as expected)",
for_Read_: "for Read (quick loading with rough page count)",
Page_Spread_View: "Page Spread View",
Spread_view: "Spread view",
Single_page_view: "Single page view",
Auto_spread_view: "Auto spread view",
additional_stylesheet_URL: "additional (custom) stylesheet URL",
user_stylesheet_URL: "user stylesheet URL",
Settings: "设置",
DESC_Options_also_1: "Options can also be set in the ",
DESC_Options_also_2: " panel.",
See_documentation_: "更所信息,请查看文档:",
HREF_User_Guide: "../docs/#/user-guide",
Vivliostyle_User_Guide: "Vivliostyle User Guide",
HREF_Vivlistyle_Home: "https://vivliostyle.org/",
navigate_to_left: "navigate to left",
navigate_to_right: "navigate to right",
Highlight_: "高亮…",
Marker_Yellow: "Marker: Yellow",
Marker_Red: "Marker: Red",
Marker_Green: "Marker: Green",
OK: "确认",
Cancel: "取消",
Delete: "删除",
TIP_Settings: "Settings (S), Double click/type to pin",
Page_View_Mode: "界面视图模式",
Auto: "自动",
Single_page: "单页",
Spread: "Spread",
TIP_Book_Mode:
"On: for Book-like publications, with Table of Contents\nOff: for single HTML documents",
TIP_Render_All_Pages:
"On: for Print (all pages printable, page count works)\nOff: for Read (quick loading with rough page count)",
Restore_View: "恢复视图",
TIP_Restore_View: "Restore view settings when reopening documents",
Custom_Style_Settings: "自定义样式设置",
Page_Size: "页面大小",
Default: "默认",
DESC_page_size_default: "(=Auto unless specified elsewhere)",
DESC_page_size_auto: "(use entire window area)",
Preset: "预设",
Landscape: "横向",
Custom_size: "自定义大小",
Width: "宽度",
Height: "高度",
More_: "详细...",
Crop_Marks: "Crop Marks",
Crop_marks: "Crop marks",
Bleed: "Bleed",
Crop_offset: "Crop offset",
Page_Margins: "Page Margins",
DESC_page_margin_default: "(=10% unless specified elsewhere)",
Set_page_margin_to_0: "Set page margin to 0",
Custom_margin: "Custom margin",
Top_Right_Bottom_Left: "Top/Right/Bottom/Left",
Set_first_page_margin_to_0: "Set first page margin to 0",
Force_html_body_margin_to_0: "Force html/body margin to 0",
Page_Breaks: "Page Breaks",
Default_widows_orphans_control: "Default widows/orphans control",
Allow_widows_and_orphans: "Allow widows and orphans",
Avoid_page_break_inside_paragraph: "Avoid page break inside paragraph",
Images: "Images",
Set_image_max_size_to_fit_page: "Set image max-size to fit page",
Keep_aspect_ratio: "Keep aspect ratio",
Text: "Text",
Font_size: "字体大小",
Base_font_size: "Base font-size",
Base_line_height: "Base line-height",
Base_font_family: "Base font-family",
Custom_Style_Priority: "Custom Style Priority",
Set_as_user_stylesheet: "Set as user stylesheet",
DESC_user_stylesheet: "(lower priority unless !important)",
Force_override_document_style: "Force override document style",
important_: "(!important)",
Edit_CSS: "编辑 CSS",
Dont_edit_: "不要在 /*<viewer>*/ 和 /*</viewer>*/之间编辑",
Reset_Custom_Style: "重置自定义样式",
Reset_all_to_default: "重置所有",
TIP_ToC: "Table of Contents (T), Double click/type to pin",
TIP_Marker: "Marker (M), Double click/type to pin",
Marks_and_Memos: "Marks and Memos",
Remove_All: "Remove All",
Remove: "移除",
Memo: "Memo",
TIP_Find: "查找 (Ctrl/Cmd+F)",
TIP_Find_Previous: "Find Previous (Shift+Enter)",
TIP_Find_Next: "Find Next (Enter)",
Find: "查找",
TIP_First_Page: "首页 (Home)",
TIP_Previous_Page: "上一页 (↑)",
TIP_Next_Page: "下一页 (↓)",
TIP_Last_Page: "最后一页(End)",
TIP_Go_to_Page: "Go to Page… (G)",
Total_pages: "总页数",
TIP_Text_Smaller: "Text: Smaller (-)",
TIP_Text_Larger: "Text: Larger (+)",
TIP_Text_Default_Size: "Text: Default Size (0)",
TIP_Zoom_Out: "缩小 (O)",
TIP_Zoom_In: "放大 (I)",
TIP_Zoom_Actual_Size: "Zoom: Actual Size (1)",
TIP_Zoom_Fit_to_Screen: "Zoom: Fit to Screen (F)",
TIP_Print: "打印 (P)",
},
},
ja: {
translation: {
UI_LNG: "ja",
Expand Down Expand Up @@ -311,6 +448,7 @@ function detectLanguage(): string {
lng = navigator.language;
}
}

if (lng) {
// "en-US" -> "en"
// FIXME: need fix for "zh-CN", "zh-TW", or "zh-Hant-HK" etc. when we support them
Expand Down

0 comments on commit 79b4d06

Please sign in to comment.