Using the new PO files in real life, I realized that it is not so easy for developers to check each time they add a string to the language file if that particular string has showed up already with another numeric id, but in another context.
In these cases we should have written some unique context message.
To solve this problem I came up with an idea of instead of storing the numeric id in a separate line, we could store it in the "msgctxt" line in the entry. This case we have a place for these ids AND we automatically have a completely unique context message for each msgid strings.
It is a one line change in the parser code, but of course the language files change massively.
Of course, if I am causing any troubles with pre-written PRs, Please let me know and I will convert those strings for you.
Please if there are no strong objections, I'd like to pull this in ASAP so that we finalize the format and finally, I can get the official Transifex project up and running. There is a great deal of requests coming from translators :-)
Thank you, Cheers, Attila
So a typical entry would look like this:
msgid "File manager"
A full blown entry would look like this
(note you do NOT have to specify the reference and comment, just if you want to)
#. play GUI sounds
changed: POUtils to parse modified PO file format
changed: language files to modified PO file format for core and Confl…
Maybe this is just an english thing but wouldn't it be better this way
msgctxt "File manager"
because the ID is a identification number
the TXT is actually the Text the string uses
and the STR is the translated string
also why do we need the # in it just seems like an extra character you need to type for no reason when it can just be msgid "7" simple to read that as its number 7 that the skin would use unless you can add other stuff for some od reason like msgid "#7 omg look what we have here"
Thanks for the comments. I was also thinking about these two points before:
OK so basically the reason is because that's the way the site works :) I can live with that.
Kind of curious about the "non numeric-id based gettext calls" and how that would work in the skin and add-ons when we use things like
But I guess that can be discussed in the forum and not a pull request
Thanks for the understanding in the format change.
About the text based gettext calls:
I'll make a big discussion period for that, when all things are working for translations.
We can find the best way to do things, which will be good for everyone.
Whatever we do, will be optional. So everyone will be able to use the numeric IDs if he prefers.
My first thought here, was to leave the numeric ID based calls for skins at least. But if we can find a good solution AND it makes skinners' life easier we can implement anything we found out.
But as I said I really plan to make a BIG discussion with the team on that. :-)
Can I pull this in, or should I wait for it until the merge window ?
My idea is to pull it in and I can help all other PRs to check and correct if the language files are ok in them, so that they get finalized until the new merge window is open.
For example I saw that Lars has an open PR with still XML files in them (LibCEC).
I'm personally on the side of its a bug fix for some previous commit it should go in as soon as possible but I don't make the rules and like you don't have much of a clue on what's set in stone and what's not.
Also I guess another "programmer" maybe needs to look over the code first since we have had a couple of false starts on this in the past month as well maybe @jmarshallnz or whoever else has commented in the past
Agreed that this is a fix. I shall review the code today.
EDIT: change is trivial - feel free to pull.