summaryrefslogtreecommitdiff
path: root/lib/localization.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:39 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:39 +0200
commitd2854834e18443876c8f75e0a7f3b88d1d549fc4 (patch)
treee967b628081e50abc7c34cd264e6586271c7e728 /lib/localization.cpp
parent4.1 (diff)
downloadFreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.gz
FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.bz2
FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.zip
4.2
Diffstat (limited to 'lib/localization.cpp')
-rw-r--r--lib/localization.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/localization.cpp b/lib/localization.cpp
index 774ee9ec..e8ff6040 100644
--- a/lib/localization.cpp
+++ b/lib/localization.cpp
@@ -132,7 +132,7 @@ public:
}
virtual void onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) {}
- virtual ReturnValDir onDir(const Zchar* shortName, const Zstring& fullName) { return Int2Type<ReturnValDir::TRAVERSING_DIR_IGNORE>(); }
+ virtual std::shared_ptr<TraverseCallback> onDir(const Zchar* shortName, const Zstring& fullName) { return nullptr; }
virtual HandleError onError(const std::wstring& errorText) { return TRAV_ERROR_IGNORE; } //errors are not really critical in this context
private:
@@ -180,7 +180,7 @@ ExistingTranslations::ExistingTranslations()
std::vector<Zstring> lngFiles;
FindLngfiles traverseCallback(lngFiles);
- traverseFolder(toZ(zen::getResourceDir() + wxT("Languages")), //throw();
+ traverseFolder(zen::getResourceDir() + Zstr("Languages"), //throw();
false, //don't follow symlinks
traverseCallback);
@@ -193,6 +193,10 @@ ExistingTranslations::ExistingTranslations()
lngfile::TransHeader lngHeader;
lngfile::parseHeader(stream, lngHeader); //throw ParsingError
+ /*
+ There is some buggy behavior in wxWidgets which maps "zh_TW" to simplified chinese.
+ Fortunately locales can be also entered as description. I changed to "Chinese (Traditional)" which works fine.
+ */
const wxLanguageInfo* locInfo = wxLocale::FindLanguageInfo(utf8CvrtTo<wxString>(lngHeader.localeName));
if (locInfo)
{
@@ -374,10 +378,11 @@ void zen::setLanguage(int language)
{
//(try to) retrieve language file
wxString languageFile;
- for (std::vector<ExistingTranslations::Entry>::const_iterator i = ExistingTranslations::get().begin(); i != ExistingTranslations::get().end(); ++i)
- if (i->languageID == language)
+
+ for (auto iter = ExistingTranslations::get().begin(); iter != ExistingTranslations::get().end(); ++iter)
+ if (iter->languageID == language)
{
- languageFile = i->languageFile;
+ languageFile = iter->languageFile;
break;
}
bgstack15