... the former uses Prefs, wxApp, and AudacityMessageBox, the latter has no
dependency on them.
Also move some other functions from GUIPrefs into namespace Languages.
... supplying some missing pieces of commit
a76b7ec295
See commit a37162ffca for the complete example of
Corsican.
Still missing are appropriate strings in Marathi for src/audacity.desktop.in and
win/Inno_Setup_Wizard/audacity.iss
Blank line change of locale/CMakeLists.txt to force reconfigure
... in cases of "TranslatableString" that are not really translated.
This makes it easier to scan the code for such unusual constructions of
TranslatableString, distinct from mere mentions of the TranslatableString type.
... except Audacity.h
This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types
(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes
for wxString,
IsEmpty => empty
Clear => clear
Alloc => reserve
for wxArrayString,
Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
See original attempt at commit 7ec5fd79df
This eliminates the need for a resource file at run-time.
locale/LanguageNames.txt is intended as a "source file" that is infrequently
changed as the set of supported languages changes.
The intermediate step, of appropriately copying that file into the C++ source
code in src/Languages.cpp, was done by hand.
In XCode, I set locale/LanguagesNames.txt and src/Languages.cpp to be
interpreted as Western encoding, and then the copy-paste was easy in the
editor.
The resulting C++ source code file now has string literals that are not 7-bit
ASCII.
This allows us to directly include language name strings in unicode in the file.
The L in the strings ensures wchar_t use.
I've confirmed that this gives the same results visually on Windows,
and that we do get unicode on Linux.
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.
Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
Previously we looked at wxLocale language names for matches to our names. The change to use the language set in the installer reversed this. However looking up zh (which is Chinese) in wxLocale yields zh_TW. So instead we now look up zh_CN.
This changes the way "unofficial" Inno Setup translations
are handled.
The first time a user compiles the .iss, the "unofficial" translations
will be downloaded to:
C:\Program Files (x86)\Inno Setup 5/Languages/unofficial
Any translations supported by Audacity that do not have an Inno
translation will be automatically created from the Default.isl in:
C:\Program Files (x86)\Inno Setup 5/Languages/dummy
This is all handled by the Inno Preprocessor. Powershell is used
to do the actual download.
Once downloaded, they will not be downloaded again, so if updates
are made, they will need to be deleted from the above directories
and allowed to download again.
In addition, I extracted the "Reset Preferences" translations from
the Audacity .po files and added them to the .iss file.
Audacity private Inno translation files are still supported in
win/InnoSetupLanguages, but I've removed the samples I'd previously
committed.
While not exactly related to this change, there were 2 languages
that weren't being set properly after being selected during
installation:
ca@valencia (Valencian)
bs (Bosnian)
The reason Valencian wasn't be displayed in preferences was twofold.
It was incorrectly named and the search loop in Languages:GetLanguages()
didn't include a range sufficient enough to pull the Valencian info.
The Bosnian language is supported by wxWidgets 2.8.12 (it is in wx3)
so, even though we have a translation, it was unavailable for
selection.
The changes required to fix those issues were:
1) Renamed ca@valencia to ca_ES@valencia
2) Instead of iterating over all wxWidgets languages and trying to
match them with our translations, I reversed it. It now iterates
over our translations and asks wxWidgets for the associated
language info. This provides support for both of the above
languages.
3) By doing #2, we are now able to add additional user languages that
may not yet be supported by wxWidgets. So, I added the Bosnian
language info.
Relocates the translation tables to the bundle
This will change the location of the translation tables from:
<root>
Audacity.app/
Languanges/<langcode>/
to:
<root>
Audacity.app/Contents/Resources/<langcode>.lproj/
This will allow the menu items to be translated as expected.