site  contact  subhomenews

Simplified translation for EasyPup

May 08, 2020 — BarryK

I have posted previously about internationalization of EasyPup:

https://bkhome.org/news/202002/files-that-transform-easyos-to-easypup.html

And:

https://bkhome.org/news/202002/international-translation-of-easypup.html

Those posts are now superseded.

What I have now done, is any gettext'ed script that is different in EasyPup, from EasyOS, or not in EasyOS, has a TEXTDOMAIN prefixed with "pup_".  For example, /usr/sbin/mscw in EasyOS has TEXTDOMAIN=mscw, while in EasyPup the script has TEXTDOMAIN=pup_mscw.

This has two enormous advantages. Firstly, a single "langpack" PET can have all translations for both EasyOS and EasyPup. Secondly, you will know at a glance which scripts are different or unique in EasyPup compared with EasyOS.

These are scripts from EasyOS that have had occurrences of "EasyOS" and "Easy" in gettexted strings replaced with "Puppy". The TEXTDOMAIN of these scripts has been modified, with "pup_" prepended:

File
TEXTDOMAIN
/usr/sbin/pmount
pup_pupmount
/usr/sbin/easydd
pup_easydd
/usr/sbin/quicksetup
pup_quicksetup
/usr/sbin/firewall_ng
pup_firewall_ng
/usr/sbin/mscw
pup_mscw
/usr/sbin/doc-launcher.sh
pup_doclauncher
/usr/sbin/remove_builtin
pup_remove_builtin
/usr/sbin/loginmanager
pup_loginmanager
/usr/local/petget/configure.sh
pup_petget__configure.sh
/usr/bin/xwin
pup_xwin

These are scripts in EasyPup that are either complete replacements for those in EasyOS or do not exist in EasyOS. Again, they all have "pup_" prepended:

File
TEXTDOMAIN
/usr/share/doc/easy/welcome.sh
pup_easyhelp
/usr/share/doc/easy/help.sh
pup_easyhelp
/usr/share/doc/easy/home.sh
pup_easyhelp
/usr/sbin/bootmanager
pup_bootmanager
/usr/sbin/bootflash
pup_bootflash
/usr/sbin/shutdownconfig
pup_shutdownconfig
/usr/sbin/savesession-dvd
pup_savesession-dvd
/usr/sbin/resizepfile.sh
pup_resizepfile.sh
/usr/sbin/puppyinstaller
pup_puppyinstaller
/usr/sbin/remasterpup2
pup_remasterpup2x
/usr/sbin/delayedrun
pup_delayedrun
/usr/sbin/dotpup
pup_dotpup
/usr/sbin/snapmergepuppy
pup_snapmergepuppy
/usr/sbin/sfsget
pup_sfsget
/etc/rc.d/rc.shutdown
pup_rc.shutdown

I have updated L18L's 'de' and esmourguit's 'fr' langpacks, though both have some of the above still not translated. They could probably check that out at the next release of EasyPup.

Note, esmourguit recently sent me some updates for his 'fr' langpack, that I have also applied.

Technical notes

A technical note about how the scripts in the first table are created...

In woofQ there is a script puppy/7build-puppy-cd, that converts EasyOS to EasyPup. One of the things it does is scan all of the gettext'ed scripts in EasyOS (in rootfs-skeleton folder), and replaces occurrences of "EasyOS" and "Easy" with "Puppy". Any scripts found that have this fix, also have "pup_" prepended to its TEXTDOMAIN.

The replacements are achieved with some fairly simple sed commends:

sed -i -e 's%\(gettext [^)]*\)EasyOS%\1Puppy%g' rootfs-complete/${BASEPATH}
sed -i -e 's%\(gettext [^)]*\)Easy\([. ]\)%\1Puppy\2%g' rootfs-complete/${BASEPATH}
sed -i -e 's%^export TEXTDOMAIN=\([^ ]*\)%export TEXTDOMAIN=pup_\1%' rootfs-complete/${BASEPATH}

...that's for anyone who is interested in the code. You would need to examine the complete 7build-puppy-cd script to see how it is done correctly in context.

The scripts in the second table are in woofQ, in folder puppy/rootfs-skeleton, and 7build-puppy-cd will write these to the final build overwriting any of the same name from EasyOS.   

Tags: easy