summaryrefslogtreecommitdiffstats
path: root/src/kvilib/system
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-12-29 18:39:37 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-12-31 17:50:51 +0900
commitcaab44d2c486b491b7be3be795bb711ebc46625f (patch)
tree4d4f706875ba7e07c4034c5b8f412da6cecbe90f /src/kvilib/system
parentbc34bb6c3424a2d57dbaafc22a883e8bc48471f7 (diff)
downloadkvirc-caab44d2c486b491b7be3be795bb711ebc46625f.tar.gz
kvirc-caab44d2c486b491b7be3be795bb711ebc46625f.zip
Look for translation .mo files in the new location
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/kvilib/system')
-rw-r--r--src/kvilib/system/kvi_locale.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/kvilib/system/kvi_locale.cpp b/src/kvilib/system/kvi_locale.cpp
index 33c21c3..29794ac 100644
--- a/src/kvilib/system/kvi_locale.cpp
+++ b/src/kvilib/system/kvi_locale.cpp
@@ -859,7 +859,8 @@ namespace KviLocale
TQString szBuffer;
- if(findCatalogue(szBuffer,name,szLocaleDir))
+ TQString catalog_name = TQString("kvirc-" + name);
+ if(findCatalogue(szBuffer,catalog_name,szLocaleDir))
{
KviMessageCatalogue * c = new KviMessageCatalogue();
if(c->load(szBuffer))
@@ -885,7 +886,7 @@ namespace KviLocale
TQString szLocDir = szLocaleDir;
KviTQString::ensureLastCharIs(szLocDir,KVI_PATH_SEPARATOR_CHAR);
- KviTQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%s/LC_MESSAGES/%Q.mo",&szLocDir,szLocale.ptr(),&name);
if(KviFileUtils::fileExists(szBuffer))return true;
@@ -895,7 +896,7 @@ namespace KviLocale
// kill them
szLocale.cutFromFirst('.');
- KviTQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%s/LC_MESSAGES/%Q.mo",&szLocDir,szLocale.ptr(),&name);
if(KviFileUtils::fileExists(szBuffer))return true;
}
@@ -904,7 +905,7 @@ namespace KviLocale
// things like @euro ?
// kill them
szLocale.cutFromFirst('@');
- KviTQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%s/LC_MESSAGES/%Q.mo",&szLocDir,szLocale.ptr(),&name);
if(KviFileUtils::fileExists(szBuffer))return true;
}
@@ -913,13 +914,13 @@ namespace KviLocale
// things like en_GB
// kill them
szLocale.cutFromFirst('_');
- KviTQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%s/LC_MESSAGES/%Q.mo",&szLocDir,szLocale.ptr(),&name);
if(KviFileUtils::fileExists(szBuffer))return true;
}
// try the lower case version too
szLocale.toLower();
- KviTQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr());
+ KviTQString::sprintf(szBuffer,"%Q%s/LC_MESSAGES/%Q.mo",&szLocDir,szLocale.ptr(),&name);
if(KviFileUtils::fileExists(szBuffer))return true;
return false;
@@ -928,11 +929,11 @@ namespace KviLocale
//
// This function attempts to determine the current locale
// and then load the corresponding translation file
- // from the KVIrc locale directory
+ // from the system locale directory
// Returns true if the locale was correctly set
// i.e. the locale is C or POSIX (no translation needed)
// or the locale is correctly defined and the
- // translation map was sucesfully loaded
+ // translation map was successfully loaded
//
void init(TQApplication * app,const TQString &localeDir)
@@ -953,7 +954,6 @@ namespace KviLocale
if(g_szLang.isEmpty())g_szLang = "en";
g_szLang.stripWhiteSpace();
- // the main catalogue is supposed to be kvirc_<language>.mo
g_pMainCatalogue = new KviMessageCatalogue();
// the catalogue dict
g_pCatalogueDict = new KviPointerHashTable<const char *,KviMessageCatalogue>;