Libzypp/Refactoring/Implementation/Translations

From openSUSE

Translations in metadata

  • repomd puts all translations into the xml
    • might be acceptable for rpm summary, huge waste for rpm description
  • summary and description are often shared
    • among sub-packages
    • among multiple architectures
  • sharing cannot be represented in repomd but in susetags
  • we have a list of languages to be supported by the system
    • see /etc/sysconfig/language:INSTALLED_LANGUAGES

Proposal:

  • Only parse (resp. download and store in cache) translations for actually used languages.
    • This doesn't save download for repomd but for susetags.
    • It certainly saves computing time if unused languages aren't copied to the cache.
  • At metadata/cache refresh, look at INSTALLED_LANGUAGES to determine which languages to handle.
    • Remove those from cache which are not needed anymore
      • needs a copy of INSTALLED_LANGUAGES to determine dropped ones
    • Offer UI to add/remove supported languages + button to 'refresh immediately'
  • Take language fallbacks into account.
  • Might be handled with a 'translations' table with columns id,locale,text
    • 1 en foofoofoo
    • 1 de barbarbar
    • 1 ru bazbazbaz
      • id + locale gives unique key
      • resovable tables holds summary_id and description_id, pointing to id column of translations
      • current locale environment gives locale part of select statement into translations