-
Notifications
You must be signed in to change notification settings - Fork 307
Localization
Zufu Liu edited this page Jul 14, 2019
·
59 revisions
- Read how to Build Notepad2 and metapath.
- Read the document for Resource Files and Pragma Directives.
- Change code page (
#pragma code_page(1252)) of Notepad2.rc and metapath.rc to target locale code page. The file it self need to be saved in different encodings:- Visual C++, Intel C++ or Clang target Visual C++, save resource file in target code page.
- GCC or Clang target GCC, save save resource file in UTF-8. Clang LTO requires resource file been compiled with
--output-format=resflag.
- Enable
NP2_GET_LEXER_STYLE_NAME_FROM_RES(in EditLexer.h), add string table for lexers and strings. - Add string table for lexers name in
Style_GetCurrentLexerName()function (in Styles.c). - Optionally, 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