mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Use actual full en_US translation for English and drop en_plurals file
This commit is contained in:
parent
3c98ce43c6
commit
bbc5ff5103
@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>DatabaseWidget</name>
|
||||
<message numerus="yes">
|
||||
<source>Do you really want to move %n entry(s) to the recycle bin?</source>
|
||||
<translation>
|
||||
<numerusform>Do you really want to move %n entry to the recycle bin?</numerusform>
|
||||
<numerusform>Do you really want to move %n entries to the recycle bin?</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditEntryWidget</name>
|
||||
<message numerus="yes">
|
||||
<source>%n week(s)</source>
|
||||
<translation>
|
||||
<numerusform>%n week</numerusform>
|
||||
<numerusform>%n weeks</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>%n month(s)</source>
|
||||
<translation>
|
||||
<numerusform>%n month</numerusform>
|
||||
<numerusform>%n months</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditWidgetIcons</name>
|
||||
<message numerus="yes">
|
||||
<source>Can't delete icon. Still used by %n item(s).</source>
|
||||
<translation type="vanished">
|
||||
<numerusform>Can't delete icon. Still used by %n item.</numerusform>
|
||||
<numerusform>Can't delete icon. Still used by %n items.</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -49,7 +49,6 @@ if $UPDATE; then
|
||||
LUPDATE=lupdate
|
||||
fi
|
||||
$LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -no-obsolete src -ts share/translations/keepassx_en.ts
|
||||
$LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -pluralonly src -ts share/translations/keepassx_en_plurals.ts
|
||||
echo
|
||||
fi
|
||||
|
||||
|
@ -38,6 +38,10 @@ void Translator::installTranslators()
|
||||
if (language == "system" || language.isEmpty()) {
|
||||
language = QLocale::system().name();
|
||||
}
|
||||
if (language == "en") {
|
||||
// use actual English translation instead of the English locale source language
|
||||
language = "en_US";
|
||||
}
|
||||
|
||||
const QStringList paths = {
|
||||
#ifdef QT_DEBUG
|
||||
@ -48,8 +52,7 @@ void Translator::installTranslators()
|
||||
|
||||
bool translationsLoaded = false;
|
||||
for (const QString& path : paths) {
|
||||
translationsLoaded |= installTranslator(language, path) || installTranslator("en_plurals", path);
|
||||
installQtTranslator(language, path);
|
||||
translationsLoaded |= installTranslator(language, path) || installTranslator("en_US", path);
|
||||
}
|
||||
if (!translationsLoaded) {
|
||||
// couldn't load configured language or fallback
|
||||
@ -79,12 +82,16 @@ QList<QPair<QString, QString>> Translator::availableLanguages()
|
||||
QRegularExpressionMatch match = regExp.match(filename);
|
||||
if (match.hasMatch()) {
|
||||
QString langcode = match.captured(1);
|
||||
if (langcode == "en_plurals") {
|
||||
langcode = "en";
|
||||
if (langcode == "en") {
|
||||
continue;
|
||||
}
|
||||
|
||||
QLocale locale(langcode);
|
||||
QString languageStr = QLocale::languageToString(locale.language());
|
||||
if (langcode == "la") {
|
||||
// langcode "la" (Latin) is translated into "C" by QLocale::languageToString()
|
||||
languageStr = "Latin";
|
||||
}
|
||||
QString countryStr;
|
||||
if (langcode.contains("_")) {
|
||||
countryStr = QString(" (%1)").arg(QLocale::countryToString(locale.country()));
|
||||
|
Loading…
Reference in New Issue
Block a user