Commit Graph

30 Commits

Author SHA1 Message Date
Blake-Madden
49c508c7a9 Fix typo in "By default" in the documentation
It was misspelt as "Bu default" in a couple of places.

Closes #22072.
2022-01-30 22:59:26 +01:00
Blake Madden
28d705424b Fix double words and article mismatches in docs. 2021-03-10 14:28:20 -05:00
Tobias Taschner
1666f58bc6
Change documentation references from OS X to macOS (#1927)
Since OS X 10.12 it has been named macOS so it makes sense
to reference it in documentation as such, even when it
sometimes refers to older versions which were called (Mac) OS X.
2020-07-04 22:08:24 +02:00
Scott Talbert
c68e5d0617 Fix some spelling/grammar errors in documentation
Mostly replace ungrammatical "allows to do" with correct "allows doing".

Closes https://github.com/wxWidgets/wxWidgets/pull/1183
2019-01-26 03:50:47 +01:00
Vadim Zeitlin
270ad54abe 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.
2018-12-23 17:33:49 +01:00
Vadim Zeitlin
20b02d6169 Rename new wxTranslations method to GetAcceptableTranslations()
This name seems to be more precise than a very generic "all good" one
used previously.
2018-11-18 01:47:12 +01:00
Lauri Nurmi
2d784da2ee Load catalogs for all preferred languages, if they exist
This way the first and only fallback language isn't necessarily the
msgid language (which is English most often). This is how GNU gettext
works -- it uses multiple fallback languages when multiple preferred
languages are set.

As a side effect, fixes #18227 in one possible way.
2018-11-18 01:47:12 +01:00
Lauri Nurmi
5d08e404c7 Allow getting all usable translations languages
Add a method to return the full list of translations that can be used,
generalizing the existing GetBestTranslation().
2018-11-18 01:47:12 +01:00
Vadim Zeitlin
91385acd5d Rename context-specific translation macros and document them
Try to use more clear names for the macros and also try to make the
sample more self-explanatory.
2017-08-09 14:21:47 +02:00
Lauri Nurmi
9a90816f0b Remove false information about static arrays and wxTRANSLATE
It is not forbidden to have function calls in static initializers, and
such code compiles fine, contrary to claims made by the text. Explain the
real reason why wxTRANSLATE is necessary.
2016-10-31 09:34:41 +01:00
Lauri Nurmi
49137ba1e1 Use a better example for wxTRANSLATE
Since even the text itself acknowledged the example is bad, use another
example that is not bad.
2016-10-31 09:34:41 +01:00
Vadim Zeitlin
423ad59b00 Replace AddCatalog() overload with defaulted argument
There is no need to have 2 overloads of this function when we could have just
a single one with a default parameter value.
2016-06-26 18:30:32 +02:00
Vadim Zeitlin
2fe72022e3 Update wxGetTranslation() documentation.
Document "i18n" trace mask.

Correct warning about [not] using wxT().

See #16714.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-09 12:51:56 +00:00
Paul Cornett
2014950b1c spelling fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-26 18:51:16 +00:00
Vadim Zeitlin
6c5086b3bf Document domain parameter of wxTranslations::GetTranslatedString().
This parameter needs to be documented, if only to avoid a Doxygen warning.

See #15346.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-01 13:03:15 +00:00
Václav Slavík
f2959820a5 Add wxTranslations::GetTranslatedString().
Replace GetString(), which always returns something (possibly the
original string) with GetTranslatedString() that returns either a
pointer to translated string or NULL.

This simplifies the code a bit, all handling of missing translations is
now done in wxGetTranslation().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-18 16:03:31 +00:00
Václav Slavík
d2740de55e Make _() and friends safe to call from any thread.
The GetUntranslatedString() hack keeps a global copy of all strings, so
that it can return a const reference as wxGetTranslation() return value.
A global wxHashSet instance shared by all threads won't do, even guarded
with a critical section, because it may internally copy values on any
insert and thus invalidate pointers that may still be used on another
thread.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-18 16:03:20 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Václav Slavík
ea160f01c6 Don't look for catalogs in AddCatalogLookupPathPrefix() path directly.
Previously, the prefix directory itself for searched for catalogs, in
addition to prefix/lang/LC_MESSAGES and prefix/lang.  This never made
much sense, because only one catalog could be in such place, instead of
multiple catalogs for more languages.  It also prevented successful
identification of catalog's language and didn't work with
GetAvailableLanguages().

Remove this misfeature and update the documentation accordingly.  Update
OS X-specific code so that it continues to work (it previously depended
on this behavior).  As a side effect, *.lproj directories are now
recognized in all search prefixes, not just in Resources.

See #12498, #15253.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-07 13:42:50 +00:00
Václav Slavík
3f84459166 Correct wxTranslations docs: CWD is not searched.
The documentation incorrectly stated that the current working directory
is searched for translations.  This isn't the case (and wouldn't be a
good thing to do).

See #12498.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-07 13:42:02 +00:00
Václav Slavík
01f953efb2 Add wxTranslations::GetBestTranslation().
Implement preferred language selection on modern systems (OS X, Windows
Vista+). User settings for locale (aka "regional settings") and UI
language are independent there and the UI language shouldn't be
determined from the locale.

Moreover, the OS provides a list of preferred languages, not a single
value (as with locale), so we should use the best language given user's
preferences and available translations. A Czech user may prefer Slovak
UI over English, for example, and we should use Slovak translation in
absence of Czech one in that case instead of falling back to English.

On Unix, locale is language and so things remain as before.

Notice that calling wxLocale::Init(wxLANGUAGE_DEFAULT) does the right
thing now: it sets the locale to whatever the user has configured in
regional settings and loads translations corresponding to default
wxTranslations language, which is determined as described above.
Previously, UI would be translated using a language corresponding to the
regional settings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-09-08 08:58:38 +00:00
Vadim Zeitlin
29a3f6548e No changes, just remove functions bodies from interface docs.
Omit the implementations, even trivial ones, from the documentation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-25 15:03:20 +00:00
Vadim Zeitlin
05fbf0e75e Don't use _T() in the documentation.
This is mainly necessary in order to be able to commit the subsequent changes
to this file as otherwise the commit is refused by the svn post-commit hook
that checks for _T() presence.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-02-25 15:03:17 +00:00
Vadim Zeitlin
526954c596 Globally use "wxWindows licence" consistently.
Use "wxWindows licence" and not "wxWidgets licence" (the latter doesn't
exist) and consistently spell "licence" using British spelling.

See #12165.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-13 13:29:13 +00:00
Václav Slavík
5e30622919 Add wxTranslations::GetAvailableTranslations().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-16 14:09:32 +00:00
Václav Slavík
611bed3511 Refactor wxTranslationsLoader API.
Instead of calling back into wxTranslations to actually load the data,
return wxMsgCatalog instance from
wxTranslationsLoader::LoadCatalog(). This requires making wxMsgCatalog
public.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:12:53 +00:00
Václav Slavík
dfbb5eff44 Don't use size_t for plural forms parameter.
size_t should be used for size of objects, which wxGetTranslation() and
wxTranslations::GetString() 'n' argument isn't -- it's just a regular
integer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:27:07 +00:00
Václav Slavík
bc71c3cdd5 Add support for storing translations in win32 resources.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-26 20:51:22 +00:00
Václav Slavík
7ed63042c6 Added missing @since tags to wxTranslationsLoader classes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 16:10:30 +00:00
Václav Slavík
ea14492351 Split intl.h into intl.h, language.h and translation.h.
To make the code more manageable, intl.h now contains wxLocale and
translation.h all translations-related stuff (wxTranslations, _() etc.).
Code generated by genlang.py was moved into its own files (language.h,
languageinfo.cpp).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 07:06:32 +00:00