readest/apps/readest-calibre-plugin/__init__.py
gswang 1f6dfcff30
feat(calibre): add multi-language support (#6768)
* feat(calibre): add multi-language support

* fix(calibre): harden the translation build and pluralize the run summary

- i18n.py compile: validate placeholders in every plural form, skip fuzzy
  and empty translations (gettext would show them blank), and write no .mo
  for a catalog with errors so make fails again instead of shipping it.
  Missing messages only warn; calibre shows them in English.
- Makefile: derive the .mo list from the .po files so a new language is
  built and zipped, and compile only the stale language.
- worker: give each status its own ngettext summary message, restoring the
  lowercase English summary and letting translators handle agreement.
- api: translate the fallback error messages; oauth: escape translated
  text in the login pages.
- pl: use the Polish plural rule; ru: genitive after "Отправка"/"Сверка";
  status labels capitalized where they now only fill the table column.
- README: list the languages that actually ship.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Huang Xin <chrox.huang@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 18:46:06 +02:00

36 lines
953 B
Python

__license__ = 'AGPL v3'
__copyright__ = '2026, Bilingify LLC'
from calibre.customize import InterfaceActionBase
try:
load_translations()
except NameError:
pass
PLUGIN_VERSION = (0, 12, 12)
class ReadestPlugin(InterfaceActionBase):
name = 'Readest Sync'
description = _(
'Push selected books and their metadata into your Readest cloud library. '
'Re-pushing a book updates its existing entry instead of creating a duplicate.'
)
supported_platforms = ['windows', 'osx', 'linux']
author = 'Bilingify LLC'
version = PLUGIN_VERSION
minimum_calibre_version = (6, 0, 0)
actual_plugin = 'calibre_plugins.readest.ui:ReadestInterfacePlugin'
def is_customizable(self):
return True
def config_widget(self):
from calibre_plugins.readest.config import ConfigWidget
return ConfigWidget()
def save_settings(self, config_widget):
config_widget.save_settings()