[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make lang.po override translations?
From: |
Ineiev |
Subject: |
Re: Make lang.po override translations? |
Date: |
Sat, 16 Apr 2022 12:58:19 +0000 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
Hello, Dora;
On Fri, Apr 15, 2022 at 09:05:55PM +0200, Dora Scilipoti wrote:
>
> if I understood correctly, the per-directory template
> /proprietary/po/lang.po does not override the existing translations.
Yes, this is correct. the up-to-date translations from articles
are used to update $lang.po, and $lang.po is used to fill missing
translations from articles.
> Overriding would be useful in cases where the translator wants to
> introduce improvements or fix translation mistakes in items that belong
> to several files.
>
> Would it be possible?
If $lang.po overrode up-to-date translations from articles, it would
mean one of the following:
* When an article needs a specific translation for the same string
(different from translations for other articles), that string
can't have a translation in $lang.po, moreover, translations
from articles can't be used to automatically fill $lang.po
(because $lang.po in its turn is used to update other articles).
I think these possibilities are essential for the feature to be
practically useful.
* All strings have to be translated in the same way; I believe
this would be an unacceptable limitation.
* Some way to introduce "strong" translations is needed, e.g. via
magic comments in PO or additional PO files, as you suggested.
If such a way were added, it would mean increased requirements
on the hardware running GNUN, and the sysadmins recently had to
substantially reduce per-user resource limits on fencepost,
probably due to high load. More important, the increased
complexity would negatively impact GNUN usability.
When translators want to fix a translation in many articles,
they can fix it in $lang.po and use gettext tools to remove the
wrong translations from other files.
For instance, let's imagine that we'd like to fix translations
for the (English) strings starting with 'Honeywell/Resideo';
the regular expression looks like '^Honeywell/Resideo'.
after fixing $lang.po, we'll use msggrep to filter the messages
in *.$lang.po.
First, let us check if the expression only matches the strings
we want:
lang=es
touch sum.$lang.po
for po in *.$lang.po; do
msggrep --msgid -E -e '^Honeywell/Resideo' $po \
| msgcat -o sum.$lang.po --use-first --unique sum.$lang.po -;
done
cat sum.$lang.po; rm sum.$lang.po
If the expression selects the correct set of messages, we
could use it to remove them:
for po in *.$lang.po; do
msggrep -v --msgid -E -e '^Honeywell/Resideo' $po > tmp.po;
mv tmp.po $po;
done
signature.asc
Description: PGP signature