site  contact  subhomenews

SeaMonkey misbehaving

January 06, 2019 — BarryK

We currently have SeaMonkey 2.49.4 in EasyOS. It starts up at file:///usr/share/doc/home.htm

Fine, except in recent builds of EasyOS, it has been doing this:

file:///usr/share/doc/easy/home_en.htm%E5%E5%E5%E5%E5%E5%E5 cannot be found
Except that it isn't anymore! (grinding of teeth)

Yep, I started this post to report the problem, started SM, and the problem has gone away. I also tested with Chromium, that works OK also.

File /usr/share/doc/home.htm has this in it:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="refresh" content="0; url=file:///usr/share/doc/easy/home.htm" />
<title></title>
</head>
<body>
</body>
</html>
File /usr/share/doc/easy/home.htm is a symlink to home_en.htm

Somehow, SM was getting upset by that symlink, appending those "%E5" characters. Now it isn't. Perplexing.

Tags: easy

Syslinux and reFind boot-manager translation

January 06, 2019 — BarryK

EasyOS ships as an image file that may be written to a USB Flash stick, or even an SSD, or the contents extracted and manually installed into a SSD/HD.

The image file contains two boot manager, Syslinux for booting on traditional BIOS PCs, and reFind for booting on UEFI PCs. These boot managers provide a menu, which is in English.

It is probably not a big deal, as most non-English computer users probably understand some simple English words. However, for the complete translation experience, translation of the boot managers is now implemented.

initrd and gettext

I posted yesterday about implementation of the initrd:

http://bkhome.org/news/201901/translation-of-early-boot-messages.html

This is done using gettext. The initrd needs to have support for the language in it. When there is a change of locale, /usr/lib/locale/<lang>, for example /usr/lib/locale/de_DE.utf8, is copied into the initrd, however, /usr/lib/locale/de_DE.utf8/LC_COLLATE and LC_CTYPE are left out due to their sizes.

Also, /usr/share/locale/<language>/LC_MESSAGES/easyinitrd.mo, for example /usr/share/locale/de/LC_MESSAGES/easyinitrd.mo, if it exists, is copied into the initrd.

Then, "INIT_LANG='de_DE.UTF-8'" is appended to /BOOT_SPECS in the initrd, and the initrd is good-to-go, translated.

This is MoManager-friendly. When MoManager is run (in the Utility menu), there is /usr/share/doc/nls/easyinitrd/easyinitrd.pot, and an existing translation will be found at /usr/share/locale/<language>/LC_MESSAGES/easyinitrd.mo. Anyone will be welcome to either do a new translation or tweak the existing one. You need to run MoManager to see how to do this, it is quite easy, much easier to just do it rather than me try to explain how.

Boot managers and SSS

I elaborated on translation of the initrd above, to emphasize that it is different from how the boot manager menus are translated. The menus are translated using SSS (Simple String Replacement).

There is a file, /usr/share/sss/boot_strings/boot_strings. Just a text file, and inside you will find lines like this:

s%Commandline only, do not start X%%

In a text editor, insert translations, like this for German:

s%Commandline only, do not start X%Nur Befehlszeile, starten Sie X nicht%

And save the translated file as /usr/share/sss/boot_strings/boot_strings.de

That's it, done. Whenever there is a locale change, the translation file will be applied to the boot manager menus (files syslinux.cfg and refind.conf) in the boot-partition.

You can also use MoManager to manage SSS translations. Which really just does the same thing, opens the file in a text editor.

Some technical details:

/usr/sbin/quicksetup is where locale change is made. /usr/sbin/chooselocale is a symlink to quicksetup.

When locale is changed, then /usr/sbin/lang2initrd is called, which asks if you want to translate the initrd and boot-manager menus in the boot-partition, If yes, then calls /usr/sbin/fixinitrd and /usr/sbin/fixboot -- actually, both of those are symlinks into /usr/sbin/fixdesk.

In the case of fixboot, if a boot_strings.<language> file exists,then it is applied to the boot-manager menus.

Tags: easy

Translation of early boot messages

January 05, 2019 — BarryK

I posted about implementing translation of the initrd (initramfs) in EasyOS:

http://bkhome.org/news/201901/sss-simple-string-substitution.html

I decided to use gettext rather than the SSS or t12s methods. So, it was a matter of sorting out some details. The TEXTDOMAIN for the scripts in the initrd is "easyinitrd", and I created a translation file for German:

/usr/share/locale/de/LC_MESSAGES/easyinitrd.mo

Booting up the latest build of EasyOS, when QuickSetup ran, I chose the "de_DE" locale, with the "UTF-8" checkbox ticked. Clicked "OK" button, and got this:

img1

I clicked "Yes", and it was done:

img2

Then rebooted:

img3

...if you think that translation is odd, it is because I used Google Translation service. Lutz (L18L) has done better translation, however, there are now more strings and some have changed -- I will post the updated 'easyinitrd.pot' file soon to the forum.

Some technical notes:

QuickSetup (/usr/sbin/quicksetup) calls /usr/sbin/lang2initrd, which is responsible for those two information windows shown above. Then, /usr/sbin/fixinitrd is called, which does the actual translation -- it opens up file 'initrd' in the boot-partition and appends "INIT_LANG='de_DE.UTF-8'" (for the German case) in file /BOOT_SPECS

Some translation support files get installed into /usr/lib/locale and /usr/share/locale in the initrd, and it is then closed up.

That script 'fixinitrd' is supposed to work standalone. You can run it in a terminal, say "fixinitrd en" and it will translate back to English -- however, I haven't tested that yet.

There may be a problem with some languages. The initrd has psfu fonts, and an appropriate one is loaded, based on the first two letters of $INIT_LANG. Currently, there are only two, /lib/consolefonts/LatArCyrHeb-16.psfu and LatGrkCyr-8x16.psfu, in the initrd -- the "u" means that they have some UTF-8 mappings. Languages ar, he and iw use the former, all other languages use the latter. English (en) uses the inbuilt kernel font.
We may have to use other psfu fonts for accurate translation of some languages.

What is not yet done is translation of the Syslinux and reFind boot menus. Will do that very soon. 

Tags: easy

SSS Simple String Substitution

January 03, 2019 — BarryK

I have posted about non-English translations for the initrd:

http://bkhome.org/news/201901/non-english-support-in-initrd.html

The scripts use 'gettext' to translate text strings, which does bring in some overhead to the initrd, plus complicates the scripts.

A long time ago, I developed "SSS", Simple String Substitution, using sed expressions, which was integrated into MoManager as "SSS domains". This is going back into the mists of time. I did a search, found this:

http://bkhome.org/archive/blog2/201202/racy-build-with-momanager-and-sss.html

MoManager also has some popup help.

These SSS domains are at /usr/share/sss, which includes /usr/share/sss/initrd_strings. This is a text file with sed expressions for translating files in the initrd.

The SSS mechanism is there, but broken. I can fix it for the initrd. This means that when you run MoManager, you can enter the sed translations into file /usr/share/sss/initrd_strings.

Then, when QuickSetup is run and the locale changed, the initrd in the boot partition will be automatically opened up and the files translated.

As I say, the basic structure is there, just way out of date. The plan now is to fix SSS and use it for the initrd, instead of gettext.

I would like to thank Gyle and zigbert who contributed translations for 'easyinitrd.po' -- I can use those strings in the SSS system. 

Tags: easy

Non-English support in initrd

January 02, 2019 — BarryK

In the very early days of creating EasyOS, a couple of years ago, I designed the scripts in the initrd to use gettext, and compiled an old version of gettext statically. Then, forgot about it.

Until recently. Lutz (L18L in the Puppy Forum) is one of our experts at translation, and currently maintains the MoManager translation tool, used in Puppy and EasyOS. Lutz took a look at language translation in the initrd, found that gettext did not work, so implemented a different solution, using technosaurus's "t12s" method:

http://murga-linux.com/puppy/viewtopic.php?t=114976

I have recompiled gettext, very old version, 0.10.40, statically linked with musl, and it works. This is done in OE:

https://github.com/bkauler/oe-qky-src/tree/master/quirky/meta-quirky/recipes-quirky/gettext0-static

The init script in the initrd now has this code to get translation working, at line 368:

export wkgLANG="$(grep '^LANG=' /mnt/${WKG_DEV}/${WKG_DIR}.session/etc/profile 2>/dev/null | cut -f 2 -d '=')"
if [ "$wkgLANG" ];then #190101
#note, /usr/sbin/quicksetup makes sure a pre-existing 'easyinitrd.mo' is copied-up to .session
export TEXTDOMAINDIR=/mnt/${WKG_DEV}/${WKG_DIR}.session/usr/share/locale
export I18NPATH=/mnt/${WKG_DEV}/${WKG_DIR}.session/usr/lib/locale
#L18L: need to load a console font...
case "${wkgLANG%_*}" in
el|ru|uk|be|sr|tg|os|ba|ce|cv)
zcat /lib/consolefonts/LatGrkCyr-8x16.psfu.gz | loadfont
;;
esac
else
export wkgLANG=C
fi

As soon as the working-partition is mounted, gettext is able to access the locale setting, see variables "TEXTDOMAINDIR" and "I18NPATH".

The fundamental problem with this method is that translation only kicks in after the working-partition is mounted. Earlier text strings to the display remain in English, as does the syslinux and refind boot menus.

So, I am seriously considering abandoning this method entirely. Instead, will do sed translations of the strings, including boot menus, and rebuild the initrd. This is a complete translation of everything, right from initial bootup menu.

Anyway, you guys can help me. I have a easyinitrd.pot file, and anyone proficient in a non-English lanugage could help by filling in the translations. There is a easyinitrd.pot file here:

http://murga-linux.com/puppy/viewtopic.php?p=1014409#1014409

The fields can be translated, for example, this google de translation:

#: init:376
msgid "One-time only operation, creating a snapshot of EasyOS"
msgstr "Einmaliger Vorgang, der eine Momentaufnahme von EasyOS erstellt"

The file can then be saved as, say, de.po, and uploaded to the forum. Two-letter language translations only please, I would rather not have to deal with regional dialects. So de.po only, generic German. I know that will be a compromise with, say, Brazilian Spanish as it differs from Spanish as written in Spain, but the strings are simple and a generic translation agreeable to everyone I am sure can be found.

Although I am considering abandoning the gettext method, the string translations are still needed, if I implement a sed translation method.  Help most welcome! 

Tags: easy

SFSget now supports upgrading

December 28, 2018 — BarryK

In the last couple of days I have uploaded new versions of Chromium and Firefox to the SFS repository in ibiblio.org.

SFSget downloaded the new SFS, but detected if there is already a container named "chromium" or "firefox" and did not install the new SFS. The user would have had to delete the container, using menu Filesystem -> Easy Container Management, then the new SFS could be installed.

Now, a pre-existing container is detected, and there is an offer to upgrade.

Upgrading is very simple. In the case of the "firefox" container, it is at /mnt/wkg/containers/firefox, and contains a symlink firefox.sfs which points to the actual SFS file. It is just a matter of changing this symlink, and the upgrade is done. 

SFSget will delete the old firefox SFS file, to reduce unnecessary clutter. 

Tags: easy

Bug in init due to ash incompatibility

December 26, 2018 — BarryK

There was a bug report before 0.9.14 was released, that if a SFS was installed to the main filesystem, not in a container, then the menu entry was wrong. I announced it as fixed for 0.9.14.

I had inserted the fix into /sbin/fixlayers script in the initrd, and examined the code very carefully, and it was crystal-clear so ticked it off as fixed, without actually testing it.

Bad move! I discovered today that this line failed:

aNAME="${onelayer/*\//}"

What that is supposed to do is transform a string like "abc/def/xyz" to "xyz", that is, delete everything before and including the last "/" character.

It works in bash, and I am so accustomed to doing it this way, didn't think to check that it will work in busybox ash. Instead, have to to it this way, which works for both bash and ash:

aNAME="${onelayer##*/}"

So, SFS menu entry will be fixed for the next release. 

Tags: easy

Pingus puzzle game

December 25, 2018 — BarryK

Pingus has been compiled in EasyOS and made into an SFS file. Just click on the "sfsget" icon on the desktop to download and install it.

I installed it as its own container, but you could install it to the main filesystem if you want -- it has a menu entry under the "Fun" category.

Pingus home page:

https://pingus.seul.org/

Have some amusement over the holiday break! 

Tags: easy