gTox icon indicating copy to clipboard operation
gTox copied to clipboard

Update po-files when changing `_(value)` in code

Open KoKuToru opened this issue 10 years ago • 2 comments

Right now I update the PO-files for all translations keywords by hand. This can't be right..

There must be a way to automatically update these.. or not ?

KoKuToru avatar Oct 25 '15 16:10 KoKuToru

I think elementary does this via xgettext: Here is a CMake example: http://bazaar.launchpad.net/~elementary-pantheon/pantheon-greeter/trunk/view/head:/cmake/Translations.cmake

Teemperor avatar Oct 25 '15 16:10 Teemperor

Yeah, I do generate a template.pot already, which includes all translation-keys. That cmake looks a lot cleaner than mine..

But when I change lets say _("1h later") to _("1 hour later")... all old translations for "1h later" must be updated to use "1 hour later" ...

But yeah probably not possible to update by itself...

Or should I just update the en.po ? The problem with just updating en.po would be:

  • correct text in en
  • wrong text in other translations which aren't translated
  • wrong text without translation files

gettext doesn't fallback to en ... if no translation is present it will display untranslated _(value)

KoKuToru avatar Oct 25 '15 19:10 KoKuToru