mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 14:32:36 +00:00
CAD: the offer menu speaks one language, not two
On a non-English desktop the offer menu came out mixed: "Create / Add material /
Rimuovi / Fillet / chamfer / draft / Repeat / Transform / Reference / Modify",
and under Modify, "Elimina" beside "Constrain sketch".
Nothing was mistranslated. The row names went through a bare wxGetTranslation(),
which searches EVERY loaded catalogue — including wxWidgets' own wxstd. That
catalogue is loaded in the desktop's language whether or not the application has
one, and it happens to contain exactly two of our eight row names:
wxstd it: 'Remove' -> 'Rimuovi', 'Delete' -> 'Elimina'
Create, Add material, Repeat, Transform, Reference and Modify are not wx
vocabulary, so they stayed English. Two words in one language, six in another,
in the same menu — and the same trap is set for every other locale wx ships:
Supprimer, Löschen, Eliminar.
Name the domain: wxGetTranslation(s, SLIC3R_APP_KEY). These strings are now
translated by our own catalogue or not at all, which is consistent either way.
Left deliberately alone: the accelerator still renders as "Canc" rather than
"Del" on an Italian system. That is wx naming the physical key, and on an
Italian keyboard the key really is marked Canc — telling that user to press
"Del" would name a key they do not have.
Verified on the rig with LANG=it_IT: the menu now reads Remove and Delete, and
the submenu shows "Delete Canc" beside "Constrain sketch".
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
3eb6e5d608
commit
eb52972a8e
@@ -5667,7 +5667,18 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos)
|
||||
};
|
||||
// Names and reasons live in the generated table as plain literals; they are the same strings
|
||||
// the toolbar already ships, so the catalogue already carries their translations.
|
||||
auto tr = [](const char* s) { return wxGetTranslation(wxString::FromUTF8(s)); };
|
||||
// Scope the lookup to the APPLICATION catalog. A bare wxGetTranslation() searches every
|
||||
// loaded catalog, wxWidgets' own wxstd included — so on a non-English system the two row
|
||||
// names that happen to be wx standard strings came back translated while the other six,
|
||||
// which wx does not know, stayed English. On an Italian desktop the offer read
|
||||
// "Create / Add material / Rimuovi / Fillet / chamfer / draft / Repeat / Transform /
|
||||
// Reference / Modify": one menu, two languages, and not because anything was mistranslated.
|
||||
// The same trap is waiting for any locale — Supprimer, Löschen, Eliminar. Naming the domain
|
||||
// means these strings are translated by OUR catalogue or not at all, which is consistent
|
||||
// either way.
|
||||
auto tr = [](const char* s) {
|
||||
return wxGetTranslation(wxString::FromUTF8(s), SLIC3R_APP_KEY);
|
||||
};
|
||||
auto label = [&](const OfferVerb& v) {
|
||||
wxString s = tr(v.name);
|
||||
if (v.key && *v.key) s += "\t" + wxString::FromUTF8(v.key);
|
||||
|
||||
Reference in New Issue
Block a user