mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
505980a60a
commit
9ae6fdac9d
@ -597,7 +597,7 @@ class Translations(POT): # {{{
|
|||||||
self.compile_group(files, handle_stats=handle_stats)
|
self.compile_group(files, handle_stats=handle_stats)
|
||||||
|
|
||||||
for locale, translated in iteritems(stats):
|
for locale, translated in iteritems(stats):
|
||||||
if translated >= 50:
|
if translated >= threshold:
|
||||||
with open(os.path.join(tdir, locale + '.mo'), 'rb') as f:
|
with open(os.path.join(tdir, locale + '.mo'), 'rb') as f:
|
||||||
raw = f.read()
|
raw = f.read()
|
||||||
zi = ZipInfo(os.path.basename(f.name))
|
zi = ZipInfo(os.path.basename(f.name))
|
||||||
@ -627,7 +627,7 @@ class Translations(POT): # {{{
|
|||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
||||||
def compile_changelog_translations(self):
|
def compile_changelog_translations(self):
|
||||||
self._compile_website_translations('changelog', 0)
|
self._compile_website_translations('changelog', threshold=0)
|
||||||
|
|
||||||
def compile_user_manual_translations(self):
|
def compile_user_manual_translations(self):
|
||||||
self.info('Compiling user manual translations...')
|
self.info('Compiling user manual translations...')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user