-
Notifications
You must be signed in to change notification settings - Fork 307
Localization
Zufu Liu edited this page Oct 17, 2019
·
59 revisions
- Read how to Build Notepad2 and metapath.
- Read the document for Resource Files.
- Change language
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_USto target language. - DON'T change the code page (
#pragma code_page(65001)) to target code page like#pragma code_page(1252). The file MUST be saved in UTF-8 (without BOM). Some notes:- Visual C++'s rc.exe supports ANSI, UTF-8 (without BOM), UTF-16LE (with BOM), while GCC's windres.exe supports ANSI, UTF-8 (with or without BOM). For portable reason, it's not suggested to save file in ANSI encoding.
- When building with MSYS2's Clang with LTO, resource files MUST been compiled (by
windres.exe) with--output-format=resflag.
-
[Optional] enable
NP2_GET_LEXER_STYLE_NAME_FROM_RES(in EditLexer.h), add string table for lexers and styles with correspondingridlikeNP2LEX_CPP(in EditLexer.h) orNP2STYLE_Keyword(in EditStyle.h and number.txt). -
[Optional] add string table for hard-coded lexers name in
Style_GetCurrentLexerName()function (in Styles.c). -
[Optional] you can enable
NP2_ENABLE_CUSTOMIZE_TOOLBAR_LABELS(in Notepad2.c and metapath.c), but I think it's not useful for localized program. - After translated all strings, build and test each program, ensure translated strings not been truncated. You may need to re-translate those long string or adjust UI control's width.
- Fix bugs you found. It's better to make a issue when you find a bug.
String like %d or %s are format specifiers, don't translate them. Exchange order of format specifiers will need to change corresponding code that use the string, otherwise program may crash or produce undesired result.
- Localization for Arabic and Hebrew may need re-layout all dialogs.
- Enable some locale-dependent settings by default. e.g.:
- Localization Korean may change default caret style to line width 2 instead of line width 1.
- Localization for Arabic and Hebrew need add code to automatically enable bidirectional or RTL layout.
After you localized Notepad2 and/or metapath, you can make a new issue to add link for you localization to here and in readme.md.
- 한국어 (Korean) localization at https://teus.me/category/IT/Notepad2
- 简体中文 (Simplified Chinese) localization at https://github.com/yfdyh000/notepad2