<font><font face="arial,helvetica,sans-serif"></font></font>2013/1/11 John Dennis <span dir="ltr"><<a href="mailto:jdennis@redhat.com" target="_blank">jdennis@redhat.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 01/11/2013 10:04 AM, Petr Viktorin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello list,<br>
This discussion was started in private; I'll continue it here.<br>
<br>
On 01/10/2013 05:41 PM, John Dennis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 01/10/2013 04:27 AM, Petr Viktorin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 01/09/2013 03:55 PM, John Dennis wrote:<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

And I could work on improving the i18n/translations infrastructure,<br>
starting by writing up a RFE+design.<br>
</blockquote></blockquote></blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Could you elaborate as to what you perceive as the current problems and<br>
what this work would address.<br>
</blockquote></blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here are my notes:<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Use fake translations for tests<br>
</blockquote>
<br>
We already do (but perhaps not sufficiently).<br>
</blockquote>
<br>
I mean use it in *all* tests, to ensure all the right things are<br>
translated and weird characters are handled well.<br>
See <a href="https://www.redhat.com/archives/freeipa-devel/2012-October/msg00278.html" target="_blank">https://www.redhat.com/<u></u>archives/freeipa-devel/2012-<u></u>October/msg00278.html</a><br>
</blockquote>
<br>
Ah yes, I like the idea of a test domain for strings, this is a good idea. Not only would it exercise our i18n code more but it could insulate the tests from string changes (the test would look for a canonical string in the test domain)<br>
</blockquote><div><br>FWIW, KDE also uses an empty .po (e.g. empty translated messages) in order to easier spot strings not marked for translations.<br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

- Split up huge strings so the entire text doesn't have to be<br>
retranslated each time something changes/is added<br>
</blockquote>
<br>
Good idea. But one question I have is should we be optimizing for our<br>
programmers time or the translators time? The Transifex tool should make<br>
available to translators similar existing translations (in fact it<br>
might, I seem to recall some functionality in this area). Wouldn't it be<br>
better to address this issue in Transifex where all projects would benefit?<br>
<br>
Also the exact same functionality is needed to support release versions.<br>
The strings between releases are often close but not identical. The<br>
Transifex tool should make available a close match from a previous<br>
version to the translator working on a new version (or visa versa). See<br>
your issue below concerning versions.<br>
<br>
IMHO this is a Transifex issue which needs to be solved there, not<br>
something we should be investing precious IPA programmers time on. Plus<br>
if it's solved in Transifex it's a *huge* win for *everyone*, not just IPA.<br>
</blockquote>
<br>
Huh? Splitting the strings provides additional information<br>
(paragraph/context boundaries) that Transifex can't get otherwise. From<br>
what I hear it's a pretty standard technique when working with gettext.<br>
</blockquote>
<br>
I'm not sure how splitting text into smaller units gives more context but I can see the argument for each msgid being a logical paragraph. We don't have too many multi-paragraph strings now so it shouldn't be too involved.<br>
</blockquote><div><br>One issue also discussed on this list is the problem of 100+ lines strings in man pages generated from ___doc___ tags in scripts.<br>Those are a _real_ pain for translators to maintain when only one line is changed.<br>
<br>Didn't have the time yet to explore splitting those strings, I need to take some to do so.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
For typos, gettext has the "fuzzy" functionality that we explicitly turn<br>
off. I think we're on our own here.<br>
</blockquote>
<br>
Be very afraid of turning on fuzzy matching. Before we moved to TX we used the entire gnu tool chain. I discovered a number of our PO files were horribly corrupted. With a lot of work I traced this down to fuzzy matches. If memory serves me right here is what happened.<br>

<br>
When a msgstr was absent a fuzzy match was performed and inserted as a candidate msgstr. Somehow the fuzzy candidates got accepted as actual msgstr's. I'm not sure if we ever figured out how this happened. The two most likely explanations were 1) a known bug in TX that stripped the fuzzy flag off the msgstr or 2) a translator who blindly accepted all "TX suggestions". (A suggestion in TX comes from a fuzzy match).<br>

<br>
But the real problem is the fuzzy matching is horribly bad. Most of the fuzzy suggestions (primarily on short strings) were wildly incorrect.<br>
<br>
I had to go back to a number of PO files and manually locate all fuzzy suggestions that had been promoted to legitimate msgstr's. A tedious process I hope to never repeat.<br>
<br>
BTW, if memory serves me correctly the fuzzy suggestions got into the PO files in the first place because we were running the full gnu tool chain (sorry off the top of my head I don't recall exactly which component inserts the fuzzy suggestion), but I think we've since turned that off, for a very good reason.<br>

<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Keep a history/repo of the translations, since Transifex only stores<br>
the latest version<br>
</blockquote>
<br>
We already do keep a history, it's in git.<br>
</blockquote>
<br>
It's not updated often enough. If I mess something up before a release<br>
and Transifex gets wiped, or if a rogue translator deletes some<br>
translations, the work is gone.<br>
</blockquote>
<br>
Yes, updating more frequently is an excellent goal.<br></blockquote><div><br>Yes, please!<br><br>Having nothing to translate for months on Transifex is not fun.<br>Having a mass of new strings to translate every once in a while when a new set of strings is eventually pushed to Transifex when someone remembers to so is certainly not.<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Update the source strings on Transifex more often (ideally as soon as<br>
patches are pushed)<br>
</blockquote>
<br>
Yes, great idea, this would be really useful and is necessary.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Break Git dependencies: make it possible generate the POT in an<br>
unpacked tarball<br>
</blockquote>
<br>
Are you talking about the fact our scripts invoke git to determine what<br>
files to process? If so then yes, this would be a good dependency to get<br>
rid of. However it does mean we somehow have to maintain a manifest list<br>
of some sort somewhere.<br>
</blockquote>
<br>
A directory listing is fine IMO. We use it for more critical things,<br>
like loading plugins, without any trouble.<br>
Also, when run in a Git repo the Makefile can compare the file list with<br>
what Git says and warn accordingly.<br>
</blockquote>
<br>
How do you which files in a directory should be scanned for translations? Perhaps it doesn't hurt to scan every file, we never tried scanning inappropriate files so I don't know what the consequence would be.<br>

<br>
A little history: Originally there was a manifest of every file to be scanned. Simo made some fixes to the i18n infrastructure and didn't like the manifest idea (it has an obvious downside, it has to be updated when source files are added/deleted/moved). Simo used git to get a list of source files. But that mechanism depended on identifying a source files via it's filename extension. Our scripts don't have an extension so those were hardcoded just like the original manifest. It didn't eliminate the maintenance problem, it just made it smaller. To my mind that was the worst of both worlds, it introduced a git dependency but didn't solve the manual manifest problem.<br>

<br>
One could do something else, if a file doesn't have an extension you can read the beginning of the file and look for a shebang (#!) interpreter line, that would identify the file as a script and hence a translation candidate.<br>
</blockquote><div><br>At least this is scriptable easily using file(1).<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
But perhaps your idea of scan everything and throw away (or ignore) anything which won't scan correctly because because it's not valid input is the best. As I said I don't think we ever explored that, but it might also be because in some instances we have to tell the scanner what type of file the input is (a chicken-n-egg problem). But it's an interesting idea and we should see how it works in practice.<br>

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Figure out how to best share messages across versions (2.x vs. 3.x) so<br>
they only have to be translated once<br>
</blockquote>
<br>
There is a crying need for this, but isn't this a Transifex issue? Why<br>
would we solving this in IPA? What about SSSD and every other project,<br>
they all have identical issues. As far as I can tell Transifex has never<br>
addressed this issue sufficiently (see above) and the onus is on them to<br>
do so.<br>
</blockquote>
<br>
I don't think waiting for Transifex will solve the problem.<br>
</blockquote>
<br>
Then what is your suggestion?<br>
<br>
Pull every msgid from every version, put it into one massive unified pot file and then split the resulting unified PO files back into version specific PO files?<br>
<br>
Well I suppose we wouldn't have to split the PO files, they could just contain translations that are never referenced, it would make them larger but wouldn't hurt anything.<br>
<br>
Of course merging the strings from every version into one unified POT would play havoc with the msgid references (where is the string located) unless the filename was modified to include it's git branch.<br></blockquote>
<div><br>I'd see a few remarks here:<br>- this massive .po file would grow wildly, especially when a typo is corrected in huge strings (__doc___), when additional sentences are added to those, etc.<br>- breaking down bigger strings in smaller ones will certainly help here in avoiding duplicated content,<br>
- in Transifex, it is easy to upload a .po onto another branch, and only untranslated matching strings would be updated. I used it on ananconda where there are multiple branches between Fedora & RHEL5/6 & master, that worked easily without breaking anything.<br>
<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Just thinking off the top of my head.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Clean up checked-in PO files even more, for nicer diffs<br>
</blockquote>
<br>
A nice feature, but I'm wondering to extent we're currently suffering<br>
because of this. It's rare that we have to compare PO files. Plus diff<br>
is not well suited for comparing PO's because PO files with equivalent<br>
data can be formatted differently. That's why I wrote some tools to read<br>
PO files, normalize the contents and then do a comparison. Anyway my top<br>
level question is is this something we really need at this point?<br>
</blockquote>
<br>
You're right that files have to be normalized to diff well.That's<br>
actually the point here :)<br></blockquote></blockquote><div><br>That would be nice before getting translated content from Transifex, or any other sources of translation, since every single po editor seems to use its own format, being one massive line including \n, or multi line by ending and reopening quotes to keep everything in 72/80 cols.<br>
NB: That one is usually not a problem for translators (except those using a mail based review process, where having 72 cols may help, or not).<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Anyway I'm just thinking of sorting the PO alphabetically - an extra<br>
option to msgattrib should do it.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Automate & document the process so any dev can do it<br>
</blockquote>
<br>
Excellent goal, we're not too far from it now, but of all the things on<br>
the list this is the most important.<br>
</blockquote></blockquote></blockquote><div><br>Indeed.<br>Please setup automation on pushing strings to Transifex, ideally in a "master" branch.<br>Then each time a new significant release is prepared:<br>- advertise the strings freeze,<br>
- possibly create a specific branch in Transifex, using available translations from the master branch, <br>- advertise the new branch for translators to work on it.<br><br>My 2 cents,<br><br>J. <br></div></div>-- <br>Jérôme Fenal<br>