MoManager builds bigger langpack

I think it was vicmz who reported that some translation files were getting left out when a langpack PET was built in MoManager.

Yes, MoManager only puts in those translation files that it manages.

However, I have added the option to search for all mo, po, pot and t12s translation files in the system and put them all into the PET (only those of the target language of course).

This will also search for zigbert's translation files. So, if you had installed zigbert's Pburn, Pmusic, etc., translation PETs, the appropriate translations would also be put into the langpack.

This can be accumulative. In a new pristine Puppy, you can install your langpack, then put in any more translations that you can find, then rebuild the langpack via MoManager main window.

If the new code leaves out some language translations, let me know. Currently, it searches all of /usr for mo and po files that have "/de" somewhere in the path/name (using 'de' as the example), and all pot files, and t12s files named as de_[A-Z][A-Z]:*.

Woof commit:
http://bkhome.org/fossil/woof2.cgi/info/6a17e54d18


Posted on 14 Mar 2012, 10:21


Comments:

Posted on 15 Mar 2012, 7:30 by L18L
momanager
mo and po files that have "/de" somewhere in the path/name

in path is ok
but in name I have got ex:
/usr/share/locale/fr/LC_MESSAGES/default...mo
/usr/share/locale/fr/LC_MESSAGES/delayedrun.mo

t12s files are in directory /usr/share/locales/de
de_[A-Z][A-Z]:*
appears not needing a directory but why _[A-Z] ??
The language in Austria is not different from that in Germany or Belgium.






Posted on 15 Mar 2012, 8:46 by BarryK
translation files searching
l18L,
Ok, I have modified the search for mo and po files:

find /usr -type f -name '*.po' -o -name '*.mo' | grep "/${ORIGLANG1}[/_.]"

where ORIGLANG1 would be, for example, "de".

Zigbert has his t12s translation files in a different location, for example:

/usr/local/pburn/locales

...directory contains de_DE:german, el_GR:greek, etc.

The t12s search code:

find /usr -type f -name "${ORIGLANG1}_[A-Z][A-Z]:*"

this will find file de_DE:german, but I cast the net a bit wider. Actually, I was thinking of Portuguese as written and spoken in Portugal, and that in Brazil, but such a case will probably need separate langpacks. Or maybe not, maybe grabbing all translations, pt_PT and pt_BR in the one langpack might be ok.

Anyway, leave that one for now, the Puppy-user guys from Brazil will need to have some input.

I just did a quick search:
http://www.necco.ca/faq_european_brazilian_port.htm

...so it seems that a pt_BR langpack could have some 'pt' or 'pt_PT' translations in it to "get by" until proper translations become available.

One question: are there any t12s translation files in some other format, for example "de:german"?



Posted on 15 Mar 2012, 8:50 by BarryK
Pburn locals
That should have been:

/usr/local/pburn/locals



Posted on 15 Mar 2012, 9:05 by vicmz
Portuguese langpack
Although the difference isn't great, there is some difference between Brazilian Portuguese and European Portuguese. Note that the latter is used in all Portuguese-speaking countries (Portugal, Angola, Mozambique, Cape Verde, East Timor and Macau), with the sole exception of Brazil. In spite of the fact that Brazil is the most important and representative, sometimes the pt_PT locale is used as a standard. However, I think including both pt_PT and pt_BR in a single package shouldn't be a problem -- think of the Spanish language, it has many more locales (es_ES, es_AR, es_MX, es_CO, es_CL etc.) but there is a standard language, too. The only Spanish locales that have some visible differences between each other are the Peninsular locale (es_ES, spoken in Spain) and the River Plate locale (es_AR, which although AR stands for Argentina it is also spoken in Uruguay and Paraguay), and the rest of the Hispanic countries have a locale that written is almost the same as the Mexican (es_MX). It is very important to use a standard first to reach to most people, and then focus on regional locales if users are interested.


Posted on 15 Mar 2012, 18:02 by L18L
National translations
/usr/local/pburn/locales

...directory contains de_DE:german, el_GR:greek, etc.

Tested in de_LU: no german





Posted on 15 Mar 2012, 23:39 by rodin.s
zigbert's locales
I have tried to create big langpack. It found almost everything except Zigbert's locales.
Files are named like that: /usr/local/pmusic/locals/ru_RU.UTF-8


Posted on 16 Mar 2012, 6:06 by L18L
translation file format
Barry asked:
One question: are there any t12s translation files in some other format, for example "de:german"?

They donīt have an extension. Language is a directory.
But there is no live t12s file at the moment. We could give them an extension if that will help.

Review:
Technosaurus had made translations of jwm menu categories in a file
/usr/share/locale/<language>/LC_MESSAGES/jwm
My suggestion was: not inside LC_MESSAGES because they are no LC_MESSAGES but 1 level higher.
Then Technosaurus voted for /usr/share/locales/

News:
jwm_menu_create (jwm_tools) is using /usr/share/locales/<language>/jwm now and names in the same directory.
http://www.murga-linux.com/puppy/viewtopic.php?t=70804&start=108



Posted on 16 Mar 2012, 7:50 by BarryK
Zigbert's locales
rodin.s,
Zigbert has them as separate PETs, that you can find on the forum, for example 'pburn_NLS.pet' and pmusic_NLS.pet.

The first one has file /usr/local/pburn/locals/ru_RU:russian

Note, the folder name is "locals" not "locales".



Posted on 16 Mar 2012, 8:16 by BarryK
t12s translations
L18L,
Thanks for the clarification. I have added this in MoManager to scoop up those extra t12s translations:

   #120316 other t12s translations, refer http://bkhome.org/blog/?viewDetailed=02748 ...

if [ -d /usr/share/locales/${ORIGLANG1} ];then
mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/locales/${ORIGLANG1}
cp -a -f /usr/share/locales/${ORIGLANG1}/* /root/langpack_${GENLANG}-${ADATE}/usr/share/locales/${ORIGLANG1}/
fi
if [ -d /usr/share/locales/${ORIGLANG12} ];then
mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/locales/${ORIGLANG12}
cp -a -f /usr/share/locales/${ORIGLANG12}/* /root/langpack_${GENLANG}-${ADATE}/usr/share/locales/${ORIGLANG12}/
fi


Where, for example $ORIGLANG1 is "de" and $ORIGLANG12 is "de_DE".

I haven't committed it to Woof yet, need to do a bit more work on the script.



Posted on 17 Mar 2012, 2:51 by L18L
momanager man
I am planning to add manpages to the langpack.

translated manpages are located in
/usr/share/man/${ORIGLANG1}/man*

and can be rendered correct with the following small patch for pman, insert the following after line 87:
          #L18L enable correct Character Encoding: UTF-8

sed 's/<\/HEAD><BODY>/<meta http-equiv="Content-Type" content="text\/html; charset=UTF-8" \/><\/HEAD><BODY>/' $TMPFILE > ${TMPFILE}1
mv -f ${TMPFILE}1 $TMPFILE

Tested successfully example:
pman ls






Posted on 17 Mar 2012, 5:38 by L18L
momanager man 2
manpages from debian installed

and this code added in momanager

   if [ -d /usr/share/man/${ORIGLANG1} ];then

mkdir -p /root/langpack_${GENLANG}-${ADATE}/usr/share/man/${ORIGLANG1}
cp -a -f /usr/share/man/${ORIGLANG1}/man* /root/langpack_${GENLANG}-${ADATE}/usr/share/man/${ORIGLANG1}/
fi


my langpack has manpages now


Posted on 17 Mar 2012, 6:51 by BarryK
Re man pages
L18L,
Great, I have added that! Will upload Woof soon.