I am going to bother you all again on this same issue, only that now in a separate thread.
The intention of this proyect, is, that before version 4.2 is launched, we can have all scripts fetch language files from a directory. (As done here)

So the script will "source" (the . means to read a file) this languagefile:
/usr/share/locale/en/LC_MESSAGES/mytest.mo

In mytest.mo you define the variable L_TEST.
It will be good practice, to start localized variables with "L_", so that they can easily be found in a script. I did not do that in my first scripts, and later it was hard, to find them again.

Code:

L_TEST="hello world!"

Then in your script, this variable is available too, as it was just "sourced" from the languagefile.
So you can print it now:

Code:

echo "${L_TEST}"

Sidenote:
I use ${L_TEST} and not $L_TEST, as like this, it can be put in other words.
works not:
echo "$L_TESTis my first test."
works:
echo "${L_TEST}is my first test."

I was thinking of using what you localized so as not to waste effort. So i thought I could compare the version you localized (before localization) and current version, but I need you to tell me exactly which version it is you translated, so as not to make the script any older by accident.

After you and the current developers of scripts answer, I should be able to start working. It shouldn't be a lot of work, i think.

to compare files on the command line use
diff file1 file2
puppy 4 contains the graphical diff program xfdiff in the utility menu, I usually start it from the prompt, ie
xfdiff file1 file2_________________Will
contribute: community website, screenshots, puplets, wiki, rss

Sorry for the inconvenience, but in fact it was missing the file /usr/share/locale/en/LC_MESSAGES/xorgwizard.mo. But not sure it was the issue.
Then it works.
Attached file xorgwizard4.2-localized and connectwizard-420loc for test and english and french files

It's really great news to see an effort to localize Puppy scripts.
If I may, I've got a few questions concerning gettext (po files), translation and puppy 4.2.

1: If Puppy is going to be completely translated, i.e. all scripts will use gettext and po files,
Could there be a problem, kernel or other wise, using so many extra variables for translation (a limit to the nber of variables used) and also could this impact Puppy's performance ?
... Some scripts use over a 100 translation variables and might call other scripts with extra translation variables.
performance drop i.e : .. number of translation variables and parsing the po file(s) to find the correct variable entry.

2: Has the community set-up any standard rules/guidelines to localise variables in a script : i.e preset variable names inside scripts or rules to define the variable names for translation.
.. There doesn't seem to be any real consistancy in the variable naming process.
frame -> $frame1 and in a completely different hbox/vbox $frame2 .. I can elaborate a bit more if needed.

3: What do you do about a Title, Label, Button or other forgotten bits that have no translation in a script ?
i.e. <button OK> or button cancel or Title ...dialup modem, MB/KB to Mo/Ko ..
Do we change the english script and submit the english modification.. but then, where to post the proposed change ?

4: Can All the text messages be translated with a po file in any script ? (except of course initrd.gz : language specific manual translation must be done)
i.e... echo "blabla" > /dev/console or echo "blabla" > 2&1
and indirectly, does X have to be running for gettext to work ?

Translation part:
5: Has anybody found an equivalent to yaf-splash ?
As it only correctly displays english characters, no matter what the encoding used.

6: Dialog doesn't seem to like accents -> shutdown/save script and others
The displayed box has holes punched in it using accents (incorrectly displayed) and the right edge is completely distorted.

7: From what I understand, the Puppy 4.2 will keep to UTF-8 encoding for scripts,
but then, we (French Toutou 4.1.2 ) had to encode some scripts into ISO-8859-1 for them to display the accents correctly.
MU kindly gave us a partial solution, his gxmessage and the switch "-encoding UTF-8", thanks MU.

The info I've found about UTF-8 is that english characters are 1 byte encoded and french characters are 2 byte encoded
Using the ISO-8859-1 encoding the french characters are 1 byte encoded.
This makes it difficult for us and probally others : we have to test each script and if necessary modify the script and adapt the encoding accordingly.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum