site  contact  subhomenews

MoManager: one .pot for many scripts

July 30, 2012 — BarryK
A problem with MoManager was reported to this blog:
http://bkhome.org/archive/blog2/201207/39de39-39ru39-langpacks.html

And solutions proposed on the Puppy Forum:
http://www.murga-linux.com/puppy/viewtopic.php?p=643538

The solution proposed by L18L looks good. I presume for the example of 'pprocess', that the scripts 'box_ok' and 'func' will not have the "export TEXTDOMAIN=..." declaration?

I have implemented L18L's solution, Woof commit:
http://bkhome.org/fossil/woof2.cgi/info/4eebc559f0

Comments

Momanager and pot-file.
Username: rodin.s
What if two (or more) different scripts has the same textdomain? I meant the situation like that in my comment. In that case one pot-file for that two (or more) scripts should be generated. But I guess it's hard to implement. There should be some check for several scripts using the same textdomain. Another, maybe simpler, solution... I somehow thought it's already implemented in MoManager, but I was wrong... If there is a textdomain.pot file in /usr/share/doc/nls then it is used directly and it is not regenerated from scripts again. (Something similar is done with alsaconf). In that case if I have "multyscript" pot file I will place it in /usr/share/doc/nls and when I choose to translate any of those scripts (with same textdomain) then common pot-file will be used. Maybe this mechanism works for binary files...

Another Idea
Username: rodin.s
"Maybe there should be separate field for direct handling pot files from /usr/share/doc/nls. For example, pot files for tray applets are not found in MoManager. With direct access to /usr/share/doc/nls one could find them. Also any pot file found there could be translated directly even if it is a "multyscript" pot file.

Re another idea
Username: BarryK
"L18L's solution will only work if those child-scripts are called from 'pprocess' script. If called directly, they would need their own TEXTDOMAIN? rodin.s, Yes, I think that the .pot file in /usr/share/doc/nls was implemented for binary files, not for scripts. Perhaps I need a bit more time to think of the best way to do this... For example, if 'pprocess', 'box_ok' and 'func' all had "export TEXTDOMAIN='pprocess'", MoManager could recognise scripts in the same directory with the same TEXTDOMAIN and then automatically combine them to one .pot file. That would be more elegant than L18L's solution? ...if you think that looks like a better solution, I will implement it this afternoon/evening (it is 6.30am here right now).

Re:Re: another idea
Username: zigbert
"Barry wrote: [i]For example, if 'pprocess', 'box_ok' and 'func' all had "export TEXTDOMAIN='pprocess'", MoManager could recognise scripts in the same directory with the same TEXTDOMAIN and then automatically combine them to one .pot file.[/i] That sounds logical to me

Re:Re:Re: another idea
Username: L18L
"[i]That sounds logical to me [/i] to me too, and [b]better[/b] because there is no "list" to maintain and can be called directly. .pot file in /usr/share/doc/nls (and po files) was implemented first by shinobar IIRC.

MoManager enhanced
Username: BarryK
"Solution: http://bkhome.org/archive/blog2/201207/momanager-multiple-scripts-one-textdomain.html


Tags: woof