mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-02 23:20:20 +00:00
Add en_US translation for plurals
This way in the en_US locale we no longer get shown the odd "dive(s)" and instead get correct singular and plural forms. Most of the patch is just a reindentation as it removes the if clause that used to do the special case of NOT loading a translation for the en_US case. Right now we start with a trivial en_US translation file. My guess is that this will be overwritten once we do the next round of "new strings, new translations". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6e785a7bfc
commit
ba2b5d8505
4 changed files with 38 additions and 23 deletions
|
@ -40,10 +40,6 @@ void init_qt_late()
|
||||||
QString uiLang = uiLanguage(&loc);
|
QString uiLang = uiLanguage(&loc);
|
||||||
QLocale::setDefault(loc);
|
QLocale::setDefault(loc);
|
||||||
|
|
||||||
// we don't have translations for English - if we don't check for this
|
|
||||||
// Qt will proceed to load the second language in preference order - not what we want
|
|
||||||
// on Linux this tends to be en-US, but on the Mac it's just en
|
|
||||||
if (!uiLang.startsWith("en") || uiLang.startsWith("en-GB")) {
|
|
||||||
qtTranslator = new QTranslator;
|
qtTranslator = new QTranslator;
|
||||||
QString translationLocation;
|
QString translationLocation;
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
|
@ -68,4 +64,3 @@ void init_qt_late()
|
||||||
qDebug() << "can't find Subsurface localization for locale" << uiLang;
|
qDebug() << "can't find Subsurface localization for locale" << uiLang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<file>translations/subsurface_de_CH.qm</file>
|
<file>translations/subsurface_de_CH.qm</file>
|
||||||
<file>translations/subsurface_de_DE.qm</file>
|
<file>translations/subsurface_de_DE.qm</file>
|
||||||
<file>translations/subsurface_en_GB.qm</file>
|
<file>translations/subsurface_en_GB.qm</file>
|
||||||
|
<file>translations/subsurface_en_US.qm</file>
|
||||||
<file>translations/subsurface_es_ES.qm</file>
|
<file>translations/subsurface_es_ES.qm</file>
|
||||||
<file>translations/subsurface_et_EE.qm</file>
|
<file>translations/subsurface_et_EE.qm</file>
|
||||||
<file>translations/subsurface_fi_FI.qm</file>
|
<file>translations/subsurface_fi_FI.qm</file>
|
||||||
|
|
|
@ -13,6 +13,7 @@ set(TRANSLATION_FILES
|
||||||
subsurface_de_DE.ts
|
subsurface_de_DE.ts
|
||||||
subsurface_el_GR.ts
|
subsurface_el_GR.ts
|
||||||
subsurface_en_GB.ts
|
subsurface_en_GB.ts
|
||||||
|
subsurface_en_US.ts
|
||||||
subsurface_es_ES.ts
|
subsurface_es_ES.ts
|
||||||
subsurface_et_EE.ts
|
subsurface_et_EE.ts
|
||||||
subsurface_fi_FI.ts
|
subsurface_fi_FI.ts
|
||||||
|
|
18
translations/subsurface_en_US.ts
Normal file
18
translations/subsurface_en_US.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" ?><!DOCTYPE TS><TS language="en_US" version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>LocationFilterDelegate</name>
|
||||||
|
<message numerus="yes">
|
||||||
|
<location filename="../desktop-widgets/modeldelegates.cpp" line="504"/>
|
||||||
|
<source>, %n dive(s) here)</source>
|
||||||
|
<translation><numerusform>, %n dive here)</numerusform><numerusform>, %n dives here)</numerusform></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>QObject</name>
|
||||||
|
<message numerus="yes">
|
||||||
|
<location filename="../core/qthelper.cpp" line="997"/>
|
||||||
|
<source>(%n dive(s))</source>
|
||||||
|
<translation><numerusform>(%n dive)</numerusform><numerusform>(%n dives)</numerusform></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
Loading…
Reference in a new issue