Fix changelog translations for a language not being used unless more than 50% of the changelog is translated into that language. Fixes #2024278 [[Enhancement] Untranslated text on the homepage](https://bugs.launchpad.net/calibre/+bug/2024278)

This commit is contained in:
Kovid Goyal 2023-06-18 12:22:52 +05:30
parent 505980a60a
commit 9ae6fdac9d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -597,7 +597,7 @@ class Translations(POT): # {{{
self.compile_group(files, handle_stats=handle_stats)
for locale, translated in iteritems(stats):
if translated >= 50:
if translated >= threshold:
with open(os.path.join(tdir, locale + '.mo'), 'rb') as f:
raw = f.read()
zi = ZipInfo(os.path.basename(f.name))
@ -627,7 +627,7 @@ class Translations(POT): # {{{
f.write(data)
def compile_changelog_translations(self):
self._compile_website_translations('changelog', 0)
self._compile_website_translations('changelog', threshold=0)
def compile_user_manual_translations(self):
self.info('Compiling user manual translations...')