bugGNU gettext - Bugs: bug #66427, msgmerge: Feature Request: Keep...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66427: msgmerge: Feature Request: Keep user defined tags/flags

Submitter:  Christian Buhtz <buhtz>
Submitted:  Fri 08 Nov 2024 09:08:28 AM UTC
   
 
Category:  Translator tools Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  haible
Open/Closed:  Open

Mon 30 Jun 2025 04:50:09 PM UTC, comment #1: 

Thanks for the report.

The PO file format is now being extended:
https://lists.gnu.org/archive/html/bug-gettext/2025-06/msg00018.html

Bruno Haible <haible>
Group administrator
Fri 08 Nov 2024 09:08:28 AM UTC, original submission:  

Hello,

I first submitted this bug via email but "Bruno" asked me to open the ticket.

Please allow me to suggest an improvement for gettext which would make my life easier.

I do have a po file like this

#, python-brace-format, my-foobar-tag
msgid "my id"
msgstr "meine ID"

My problem is that msgmerge --update create this out of it and remove the "my-foobar-tag" because it doesn't know it.

#, python-brace-format
msgid "my id"
msgstr "meine ID"

The same behavior goes for flags/tags using the "." like this.

#. my-foobar-tag

They are removed.

But I need to keep tags, even if msgmerge doesn't know them. There are good reason in my workflow to keep them.
For example I do run additional (semantic) tests on my po files. To influence the behavior of that tests, e.g. formulate exceptional cases, I use this tags.

So Bruno added some question to my email.

> In order to understand the requirement better,
> I would also need to know more about the workflow:
>  - Which processing step sets this tag, and who sets it?
>  - Which processing step uses this tag (for testing)?


I do add this text manually in the language specific po file via my text editor (emacs).
The tag is used by my helper script to decide which additional tests/checks to run or not to run on a specific entry.

For this specific text I do count and compare the appearance of "{" and "}" between the msgid and msgstr. The curly brackets are used in Python strings as placeholders.
My translators do use Weblate for translations to allow non-technical persons contributing translations. Some of them do not know about the concept of placeholders in strings. And IMHO they don't need to know. As a maintainer I try to keep the obstacle as low as possible for them to keep them working and attract new translators. So I have to deal with some mistakes they can make. Some do erase that placeholders.
But for some specific strings there are also good reasons for translators to remove that placeholder and put the real word into it. For this strings I do use the user defined flag/tag to skip that kind of test.
If you are interested in more details see the helper script and don't hesitate to ask.
<https://github.com/bit-team/backintime/blob/dev/update_language_files.py>

My current solution is to use just a comment, instead of a flag.

    "# my-tag"

Thanks in advance,
Christian Buhtz

Christian Buhtz <buhtz>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by buhtz (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-06-30 haible CategoryNone Translator tools
        StatusNone In Progress
        Assigned toNone haible

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code