Localizing scripts

For efforts in internationalising Puppy and solving problems in this area
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#46 Post by MU »

esmourguit,
remasterpup2 already has the code for ntfs, line 81:

Code: Select all

   mount -t $AFS /dev/$ATAG /mnt/$ATAG > /dev/null 2>&1
So if ntfs does not work, there must be a bug somewhere else.
I don't know if in the script itself, or somewhere else in Puppy.
Do you use a original Puppy 4.12, or a puplet?

I will not have time to test it myself before weekend.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#47 Post by esmourguit »

Bonjour,
@MU,
I have Burnt and ran a brand new Puppy 4.1.2 (kernel 2.6.25.16) with "puppy pfix=ram"
The remasterpup2 localized script could create puppylivecdbuild on ntfs partition, but still no custom-puppy.iso.

I have localized chooselocale script and it works OK. Attached file
I started localizing puppyinstaller, but there is already something wrong. I continue.
Cordialement ;)

New uploaded version is now fixed.
Attachments
chooselocale-420Loc.pet
(4.74 KiB) Downloaded 1282 times
Last edited by esmourguit on Tue 24 Feb 2009, 15:59, edited 1 time in total.
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#48 Post by esmourguit »

Bonjour,

@MU,
About xwin localized and the issues line 482 and 490.
Here are the comments after exiting to prompt :
/usr/X11R7/bin/xwin:line 482:unexpected EOF while looking for matching '"'
/usr/X11R7/bin/xwin:line 490: Syntax error:unexpected end of file
What about that?
Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#49 Post by esmourguit »

Bonjour,
I have localized /usr/sbin/bootmanager. I have to test it before upload.
Puppyinstaller script : always with the same issues not yet fixed.
Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#50 Post by esmourguit »

Bonjour,
Here is bootmanager localized.
Cordialement ;)
Attachments
bootmanage420-loc.tar.gz
(7.52 KiB) Downloaded 1430 times
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
droope
Posts: 801
Joined: Fri 01 Aug 2008, 00:17
Location: Uruguay, Mercedes

#51 Post by droope »

esmourguit wrote:Bonjour,

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

Cordialement ;)
Hi there esmorguit. I've been testing connectwizard there, because someone translated it to spanish, but it isn't working for me... no error shows in console, but it doesn't run... Any ideas of what could be happening?

Mine isn't working, either. I am guessing it's an issue with locales, and i will solve it soon. Don't worry too much about it.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#52 Post by MU »

esmourguit wrote:Bonjour,

@MU,
About xwin localized and the issues line 482 and 490.
Here are the comments after exiting to prompt :
/usr/X11R7/bin/xwin:line 482:unexpected EOF while looking for matching '"'
/usr/X11R7/bin/xwin:line 490: Syntax error:unexpected end of file
What about that?
Cordialement ;)
I'll have a look at it at weekend.
Within the week, I am too busy with my course and tired, when I come home.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#53 Post by esmourguit »

Bonjour,
@Droope,
Hi there esmorguit. I've been testing connectwizard there, because someone translated it to spanish, but it isn't working for me... no error shows in console, but it doesn't run... Any ideas of what could be happening?
Sorry, there is an error in line 17, in /usr/share/locale/fr/LC_MESSAGES/connectwizard.mo. (only this one, the english.mo file is OK).
Change
comment5=
by
comment6=
Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#54 Post by esmourguit »

Bonjour,
About puppyinstaller script : there are issues when we get to the part on superfloppy and following.
The script does not take the localization variables.
I don't think this is a job in my skills. Sorry.
I will work on eventmanager script for now.
Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
droope
Posts: 801
Joined: Fri 01 Aug 2008, 00:17
Location: Uruguay, Mercedes

#55 Post by droope »

hi there, made a list for the spanish community, guess it could be usefull here too.
Connect wizard
Xwin
XorgWizard
Remasterpup2
Chooselocale
Bootmanager

Esmorguit, thanks a lot for all your work :D i mean it, it's really apreciated.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#56 Post by MU »

esmourguit,
I tested your xorgwizard today in a new newyearspup.
I get no errors so far, except there:

french mo:
line 166
(: instead of =)

english mo, line 166 as in french, and line 276, there is a " in the end, that must be removed.


You can check for such errors, if you examine:
/tmp/xorgwizard-errors.log

I attach a pet with the two updated mo files and the unmodified xorgwizard.
So this is an updated pet of the one posted here:
http://www.murga-linux.com/puppy/viewto ... 521#274521

I plan to incorporate the localized scripts from this thread in newyearspup next weekend :)

Mark
Attachments
xorgwizard420-loc.pet
(24.1 KiB) Downloaded 1175 times
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#57 Post by esmourguit »

Bonjour,

@MU,
Thank you Mark. And what about xwin?

Here is cups_shell localized, i'had forgotten to upload.
Cordialement ;)
Attachments
cups_shell-420Loc.tar.gz
(2.69 KiB) Downloaded 1316 times
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
droope
Posts: 801
Joined: Fri 01 Aug 2008, 00:17
Location: Uruguay, Mercedes

#58 Post by droope »

Hi there, a member of Spanish community, not me, suggests this

Code: Select all

#-- simple localization for scripts by MU. Essai de JJM
mo=connectwizard.mo
if [ -f "/usr/share/locale/$LANG/LC_MESSAGES/$mo" ];then
. /usr/share/locale/$LANG/LC_MESSAGES/$mo
else
. /usr/share/locale/en/LC_MESSAGES/$mo
fi 
Instead of this:

Code: Select all

#-- simple localization for scripts by MU. Essai de JJM
mo=connectwizard.mo
lng=`echo $LANG | sed "s/\(..\).*/\1/"`
. "/usr/share/locale/en/LC_MESSAGES/$mo"
if [ -f "/usr/share/locale/$lng/LC_MESSAGES/$mo" ];then
. "/usr/share/locale/$lng/LC_MESSAGES/$mo"
fi 
Reasons:

-He erases the " characters, otherwise it wont work. (In Spanish).

-He erases the order that chops the $lang variable (from being es_ES it would become "es" so that would limit the possibility of translating to other languages). He says he'd rather use $lang directly and then place the translations in "es_ES" or "es_AR", for example.

- Allows the possibility of, if desirable, the other localizations can be erased, so as to reduce the iso size. If no translation exists, it'll use the english one.

I don't understand much the code, but thought it could be iteresting. If you think it is worth it, i'll change all localized scripts to use it, so that you don't have to do it.

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#59 Post by esmourguit »

Bonjour,
Let's wait the MU's opinion.
It sounds interesting and there may be various specific localizations in the same language in relation to different countries.
Cordialement ;)

Edited Feb 27 18:00
I just look in the connectwizard file in version 4.20 RC1, and it is already like this:
#-- simple localization for scripts by MU.
mo=connectwizard.mo
lng=`echo $LANG | sed "s/\(..\).*/\1/"`
#echo $lng
. "/usr/share/locale/en/LC_MESSAGES/$mo"
if [ -f "/usr/share/locale/$lng/LC_MESSAGES/$mo" ];then
. "/usr/share/locale/$lng/LC_MESSAGES/$mo"
fi
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#60 Post by MU »

ok, we can use the full $LANG, if it is required for different languages.
I did not use it, to save space.
For example:
de_DE
de_CH

This is german and swiss german.
In Scripts, they are usually identical.
So if we check just for "de", just one .mo is needed.
This could be solved however if we would place a symlink to the "de_DE/LC_MESSAGES/example.mo" in "de_CH/LC_MESSAGES/".

This would combine both advantages: seperate language files if required (like for "es_"), and just one with symlinks, if it is the same for all "de".

But one change is needed:
the english file should ALWAYS be loaded.
So do not use "if else".
Reason: translations are often incomplete.
Example:
mywizard 4.0 is written by MU.
droope translates it to spanish.
Then MU enhances the wizard to 5.0. As MU speaks no spanish, new words are available in english only, until droope finds time to update the translation.
With "if else" the 5.0 would not work in spanish, but if english is always loaded, then it would work, just the not yet translated words would be english.

So this would be ok:

Code: Select all

#-- simple localization for scripts by MU. Essai de JJM 
mo=connectwizard.mo 

. /usr/share/locale/en/LC_MESSAGES/$mo
if [ -f "/usr/share/locale/$LANG/LC_MESSAGES/$mo" ];then 
. /usr/share/locale/$LANG/LC_MESSAGES/$mo
fi
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#61 Post by MU »

esmourguit,

I can reproduce your errors with "xwin".
Unfortunately I could not find out yet, what causes them.

Newyearspup02 rc4 will contain bootmanager, cups_shell, xorgwizard (not xwin), remasterpup2 (and connectwizard from droope in english, though I am not certain, if Dougal has a more recent version meanwhile. Which one should we use?)

For the next release I will look, if droope already created spanish translations, I currently just use the french ones that were included in esmourguits files.

Is Droopes spanish remasterscript.mo compatible with esmourguits remasterpup2?
Esmurguit: remasterpup2: 19455 byte
Droope: remasterpup2: 18057 byte.

So I assume, that the one from esmurguit is more complete?

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#62 Post by esmourguit »

Bonjour,
@ MU here is the connectwizard in 4.20RC1.
It is bad for xwin issue, although it works normally
I 'm working on localization of the Petget package. May be ready for wednesday.
II have translated in french Remaster Express by pa_mcclamrock. Is it possible to localize this kind of program in a similar way as the scripts?
Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#63 Post by MU »

thanks for the connectwizard-link :)

remaster-express is written in Tcl/Tk.
It is also a script-language, but the syntax is very different from bash scripts.
I coded some small utilities maybe 8 years ago, but have forgotten most.
It would be best, to request David to show you an example, or to add the basic stuff to use external languagefiles with a short example.

Once you see how the syntax works, you could add more localization variables on your own, just like for the bash scripts.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#64 Post by esmourguit »

Bonjour,
@MU,
I had already asked pa_mcclamrock, see here.
But i found that
#==========================================#
# Load international messages #
#==========================================#
# msgdir : directory where message file are
# file name example fr.msg de.msg nl.msg es.msg
proc IntlMsg {msgdir {lang {}} } {
package require msgcat
if {$lang == ""} {set lang [string range [::msgcat::mclocale] 0 1] }
set msgfile [file join $msgdir $lang.msg]
if { [catch {open $msgfile r} fmsg] } {
puts stderr "Could not open $msgfile for reading\n$fmsg"
} else {
while {[gets $fmsg ligne] >= 0} {
lappend ll $ligne
}
close $fmsg
::msgcat::::mcmset $lang [join $ll]
unset ll
}
}
on this site,
How do I indicate the path of files.msg in this part of script, if they are in /usr/local/remasterex for example?
Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#65 Post by esmourguit »

Bonjour,
Here is a new localized utility that is petget.
There are the french and english file.mo.
If someone wants to test it?
Cordialement ;)

Edited and modified the Petget_Loc.tar.gz, today friday march 6
Attachments
Petget_Loc.tar.gz
(7.11 KiB) Downloaded 1154 times
Last edited by esmourguit on Fri 06 Mar 2009, 07:26, edited 1 time in total.
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

Post Reply