Revert all recent changes to wxTranslations

The latest changes to wxTranslations::AddCatalog() behaviour were not
backwards-compatible and also had other problem, so revert them for now,
even if this means that #18227 has to be reopened.

This is a combination of the following commits:

----

Revert "Fix regression in wxTranslations::AddCatalog()"

This reverts commit 14e905858d.

See #18297.

----

Revert "Fix crash in translations code when no translations are found"

This reverts commit 80904d1bc7.

See #18299.

----

Revert "Rename new wxTranslations method to GetAcceptableTranslations()"

This reverts commit 20b02d6169.

----

Revert "Load catalogs for all preferred languages, if they exist"

This reverts commit 2d784da2ee.

----

Revert "Allow getting all usable translations languages"

This reverts commit 5d08e404c7.

----

See #18227, #18300.

Closes #18302.
This commit is contained in:
Vadim Zeitlin
2018-12-23 17:24:13 +01:00
parent 2c737bfbc0
commit 270ad54abe
4 changed files with 36 additions and 111 deletions

View File

@@ -137,34 +137,6 @@ public:
const wxString& msgIdLanguage = "en");
/**
Returns the languages of all translations that can be used for the @a
domain.
This is a more general version of GetBestTranslation(), which returns
the whole list of preferred UI languages for which a translation for
the @a domain was found instead of just the first, i.e. the most
preferred, element of this list.
@param domain
The catalog domain to look for.
@param msgIdLanguage
Specifies the language of "msgid" strings in source code (i.e.
arguments to GetString(), wxGetTranslation() and the _() macro).
@return An array of language codes if any suitable matches were found,
empty array otherwise.
@since 3.1.2
*/
wxArrayString GetAcceptableTranslations(const wxString& domain,
wxLanguage msgIdLanguage);
/// @overload
wxArrayString GetAcceptableTranslations(const wxString& domain,
const wxString& msgIdLanguage = "en");
/**
Add standard wxWidgets catalogs ("wxstd" and possible port-specific
catalogs).
@@ -175,10 +147,9 @@ public:
bool AddStdCatalog();
/**
Add a catalog for the preferred UI language. In case of multiple
preferences, add catalog for each language, if available.
Add a catalog for use with the current locale.
By default, the catalog is searched for in standard places (see
By default, it is searched for in standard places (see
wxFileTranslationsLoader), but you may also prepend additional
directories to the search path with
wxFileTranslationsLoader::AddCatalogLookupPathPrefix().
@@ -202,9 +173,8 @@ public:
code are used instead.
@return
@true if catalog in the most preferred language was successfully loaded,
@false otherwise (which might mean that the catalog is not found or that
it isn't in the correct format).
@true if catalog was successfully loaded, @false otherwise (which might
mean that the catalog is not found or that it isn't in the correct format).
*/
bool AddCatalog(const wxString& domain,
wxLanguage msgIdLanguage = wxLANGUAGE_ENGLISH_US);
@@ -230,9 +200,8 @@ public:
in case they use 8-bit characters (e.g. German or French strings).
@return
@true if catalog in the most preferred language was successfully loaded,
@false otherwise (which might mean that the catalog is not found or that
it isn't in the correct format).
@true if catalog was successfully loaded, @false otherwise (which might
mean that the catalog is not found or that it isn't in the correct format).
*/
bool AddCatalog(const wxString& domain,
wxLanguage msgIdLanguage,