site  contact  subhomenews

MoManager builds bigger langpack

March 14, 2012 — BarryK
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:


Username: L18L
mo and po files that have "/de" somewhere in the path[b]/name[/b] in path is ok but in name I have got ex: /usr/share/locale/fr/LC_MESSAGES[b]/de[/b] /usr/share/locale/fr/LC_MESSAGES[b]/de[/b] t12s files are in directory /usr/share/locales/de de[b]_[A-Z][A-Z][/b]:* appears not needing a directory but why _[A-Z] ?? The language in Austria is not different from that in Germany or Belgium.

translation files searching
Username: BarryK
"l18L, Ok, I have modified the search for mo and po files: [i]find /usr -type f -name '*.po' -o -name '*.mo' | grep "/${ORIGLANG1}[/_.]"[/i] where ORIGLANG1 would be, for example, "de". Zigbert has his t12s translation files in a different location, for example: [i]/usr/local/pburn/locales[/i] contains de_DE:german, el_GR:greek, etc. The t12s search code: [i]find /usr -type f -name "${ORIGLANG1}_[A-Z][A-Z]:*"[/i] 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: 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"?

Pburn locals
Username: BarryK
"That should have been: [i]/usr/local/pburn/locals[/i]

National translations
Username: L18L
"/usr/local/pburn/locales contains de_DE:german, el_GR:greek, etc. Tested in de_LU: no german [img][/img]

zigbert's locales
Username: rodin.s
"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

translation file format
Username: L18L
"Barry asked: [i]One question: are there any t12s translation files in some other format, for example "de:german"? [/i] 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.

Zigbert's locales
Username: BarryK
"rodin.s, Zigbert has them as separate PETs, that you can find on the forum, for example '' and The first one has file /usr/local/pburn/locals/ru_RU:russian Note, the folder name is "locals" not "locales".

t12s translations
Username: BarryK
"L18L, Thanks for the clarification. I have added this in MoManager to scoop up those extra t12s translations: [code] #120316 other t12s translations, refer ... 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 [/code] 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.

momanager man
Username: L18L
"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: [code] #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 [/code] Tested successfully example: [code]pman ls[/code]

momanager man 2
Username: L18L
"manpages from debian installed and this code added in momanager [code] 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 [/code] my langpack has manpages now :cool:

Re man pages
Username: BarryK
"L18L, Great, I have added that! Will upload Woof soon.

Tags: woof