diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-05 14:58:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-01-15 10:11:43 +0100 |
commit | d5d905b480c2a9b1db982f2867e87b5c230d1ab9 (patch) | |
tree | 7cdda2d3435ebe6367f2e7becafa48c7f369b501 /solenv/bin/uiex | |
parent | f89b94c280e8d986cdf08271f5cdc6b1dfe09575 (diff) |
prep to replace stock button labels
a) as per https://developer.gnome.org/gtk3/stable/gtk3-Stock-Items.html
use-stock=gtk-ok is deprecated and plain "OK", "Cancel" are indicated
instead.
b) to avoid adding thousands of extra labels to translate we'll convert
use-stock buttons to use the translatable strings, but give them all the
same "stock" translation context. Our translation rules don't like
duplicates in the output .po's so strip "stock" contents from the
translation collection rules in uiex and add a single set per .po in
l10ntools/source/localize.cxx
c) a script to rewrite the .uis to the new rules
the previously use-stock labels won't appear translated until there has
been a round trip of extraction, translations and import of translations
Change-Id: Ibe4d0d27f2abbf5aa3df9c63af1561cd01d9fddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108812
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'solenv/bin/uiex')
-rwxr-xr-x | solenv/bin/uiex | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/solenv/bin/uiex b/solenv/bin/uiex index c9b00b2e062c..ba47d8e2f9a8 100755 --- a/solenv/bin/uiex +++ b/solenv/bin/uiex @@ -27,6 +27,10 @@ with open(ofile, "a") as output: if len(po) != 0: print >> output, "" for entry in po: + # skip 'stock' entries like "cancel", "help", "ok", etc + # l10ntools/source/localize.cxx will insert one entry for each stock per .po + if entry.msgctxt == "stock": + continue keyid = entry.msgctxt + '|' + entry.msgid print >> output, '#. ' + polib.genKeyId(keyid) for i, occurrence in enumerate(entry.occurrences): |