diff options
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index aeea7c071..d533db1fc 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1717,6 +1717,15 @@ bool LanguagePackHeader::IsValid() const } /** + * Check whether a translation is sufficiently finished to offer it to the public. + */ +bool LanguagePackHeader::IsReasonablyFinished() const +{ + /* "Less than 25% missing" is "sufficiently finished". */ + return 4 * this->missing < LANGUAGE_TOTAL_STRINGS; +} + +/** * Read a particular language. * @param lang The metadata about the language. * @return Whether the loading went okay or not. @@ -1969,6 +1978,10 @@ void InitializeLanguagePacks() } if (strcmp (lng.isocode, "en_GB") == 0) en_GB_fallback = &lng; + + /* Only auto-pick finished translations */ + if (!lng.IsReasonablyFinished()) continue; + if (strncmp(lng.isocode, lang, 5) == 0) chosen_language = &lng; if (strncmp(lng.isocode, lang, 2) == 0) language_fallback = &lng; } |