Refreshed the dictionaries.
Introduced a new localization macro L_CONTEXT(string, context) to define context dependent translations. The only strings - "Top" and "Bottom" were already using context, but until now the context had to be added to the PrusaSlicer.pot file manually, while the context is being generated automatically now.
This commit is contained in:
parent
b8bd362553
commit
cd35fd9b34
5 changed files with 1398 additions and 1295 deletions
|
@ -368,7 +368,7 @@ target_include_directories(cereal INTERFACE include)
|
|||
# l10n
|
||||
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization")
|
||||
add_custom_target(pot
|
||||
COMMAND xgettext --keyword=L --add-comments=TRN --from-code=UTF-8 --debug
|
||||
COMMAND xgettext --keyword=L --keyword=L_CONTEXT:1,2c --add-comments=TRN --from-code=UTF-8 --debug
|
||||
-f "${L10N_DIR}/list.txt"
|
||||
-o "${L10N_DIR}/PrusaSlicer.pot"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -24,6 +24,7 @@ src/slic3r/GUI/GUI_Preview.cpp
|
|||
src/slic3r/GUI/KBShortcutsDialog.cpp
|
||||
src/slic3r/GUI/MainFrame.cpp
|
||||
src/slic3r/GUI/MsgDialog.cpp
|
||||
src/slic3r/GUI/OptionsGroup.cpp
|
||||
src/slic3r/GUI/Plater.cpp
|
||||
src/slic3r/GUI/Preferences.cpp
|
||||
src/slic3r/GUI/Preset.cpp
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
#define L(s) s
|
||||
#endif /* L */
|
||||
|
||||
#ifndef L_CONTEXT
|
||||
#define L_CONTEXT(s, context) s
|
||||
#endif /* L */
|
||||
|
||||
#ifndef _CHB
|
||||
//! macro used to localization, return wxScopedCharBuffer
|
||||
//! With wxConvUTF8 explicitly specify that the source string is already in UTF-8 encoding
|
||||
|
|
|
@ -246,7 +246,7 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** full_Label/* = n
|
|||
// add label if any
|
||||
if (option.label != "") {
|
||||
//! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1
|
||||
wxString str_label = (option.label == "Top" || option.label == "Bottom") ?
|
||||
wxString str_label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ?
|
||||
_CTX(option.label, "Layers") :
|
||||
_(option.label);
|
||||
label = new wxStaticText(this->ctrl_parent(), wxID_ANY, str_label + ": ", wxDefaultPosition, wxDefaultSize);
|
||||
|
|
Loading…
Reference in a new issue