Merge branch 'master' into jgrpp
# Conflicts: # CMakeLists.txt # COMPILING.md # src/console.cpp # src/console_cmds.cpp # src/console_internal.h # src/rev.cpp.in
This commit is contained in:
@@ -2058,6 +2058,15 @@ bool LanguagePackHeader::IsValid() const
|
||||
StrValid(this->digit_decimal_separator, lastof(this->digit_decimal_separator));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -2312,6 +2321,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user