Partially revert "Add AddAvailableCatalog() and use it in AddStdCatalog()"
This commit partially reverts 94b1a17aeb.
The above commit changed translation lookup logic to differentiate
between msgid and "available" translations (the latter being loaded from
a file or resource). It first attempted to use available translations
and only felt back to msgid language as the last resort.
Unfortunately, doing that broke lookup in cases when the user had msgid
language as not-last preference in their UI languages list, or even when
a similar translation was available. For example:
- msgid=en, user preference [cs,en,fr], only fr.po available: fr would
be used instead of en
- msgid=en_US or en, user preference [en], but en_GB.po available:
British English would be used even for US users
This commit fixes this by restoring the previous behavior where msgid
language was treated as a first-class citizen in lookup, while
preserving the API that allows distinguishing between the two cases.
It also reimplements AddStdCatalog() in a more straightforward way that
doesn't rely on AddAvailableCatalog().
This commit is contained in:
parent
34a90ba3af
commit
2af36e9560
2 changed files with 50 additions and 49 deletions
|
|
@ -203,6 +203,8 @@ private:
|
|||
static void SetNonOwned(wxTranslations *t);
|
||||
friend class wxLocale;
|
||||
|
||||
wxString DoGetBestAvailableTranslation(const wxString& domain, const wxString& additionalAvailableLanguage);
|
||||
|
||||
private:
|
||||
wxString m_lang;
|
||||
wxTranslationsLoader *m_loader;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue