Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 19:58
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Localizing scripts
Moderators: Lobster, MU, raffy
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 2 of 9 Posts_count   Goto page: Previous 1, 2, 3, 4, ..., 7, 8, 9 Next
Author Message
droope


Joined: 31 Jul 2008
Posts: 814
Location: Uruguay, Mercedes

PostPosted: Sun 08 Feb 2009, 17:08    Post_subject:  

Hi there maddox:

I don't think i have the moral authority to answer to that post Razz And that is a really fancy way of saying, I don't know what to say. I guess there could be an issue with those, yes.


Ondevelop:

My script is acting weird, I've just started, but heres what I changed.

connectwizard.mo (es) wrote:
$DIALUP="Internet by turtle..."


connectwizard 4.1.2 wrote:
#-- simple localization for scripts by MU
mo=conectwizard.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

And:
the same file, later on wrote:
<label>${DIALUP}</label>



And the weird behaviours are:

number 1: When I click on the script with rox, nothing happens. When I open a console there and run it, it works :/

Number 2: The text is not changing, I am using ES_es locales, and the mo file is located in /usr/share/locales/es/LC_MESSAGES/ ... :/


Could I get a hand? Sorry for all the newbieing. Smile Thanks


EDIT:

DOH!!! (homer style) I had localized a part of the script that was comented out. Razz Now it still won't work, I've edited my post to correct the horror i had done.
Back to top
View user's profile Send_private_message 
maddox

Joined: 28 Sep 2007
Posts: 453
Location: sometimes in France

PostPosted: Sun 08 Feb 2009, 18:10    Post_subject:  

Hi droope,
For the Rox problem, your file is probally not executable, right-click on the file in Rox and choose File -> Properties ...Tick all 3 Execute boxes.
An executable script needs this 1st line for it to run : #!/bin/bash
If your script doesn't use any X boxes (yaf-splash, xmessage/gxmessage), the console will just flash by, no time to see any messages.
But if you want to see what's happening, you'll have to run it from a console anyway.

For the locale problem: normally locales are like this -> fr_FR ... lowercase underline UPPERCASE
so I suppose yours should be -> es_ES and not ES_es

connectwizard.mo (es) wrote:
$DIALUP="Internet by turtle..."
Internet by turtle... -> this should be in your language, it's the translation
check your po file

Hope this helps you.
Back to top
View user's profile Send_private_message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 08 Feb 2009, 19:20    Post_subject:  

droope wrote:
My script is acting weird, I've just started, but heres what I changed.

connectwizard.mo (es) wrote:
$DIALUP="Internet by turtle..."



Must be:
Code:
DIALUP="Internet by turtle..."


When you assign a value to a variable, it must not have the leading $.
Mark

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 08 Feb 2009, 19:37    Post_subject:  

maddox,

Quote:
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 ?


In Muppy I had no problems yet concerning this.

Quote:
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.


No.
However it does not matter, as every program uses an own mo file, there is no "central" mo used by more than one script.

The process is basically, that one starts to localize a script.
He will first create the english mo file.
It then has all the required variables, that other translators can use for translated mo files.

Quote:
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 ..


Dialog itself has a mo file to translate "yes", "no" and similar.
But I think it is not included in Puppy.
I attach a "full" dialog with translations.
For custom texts, that are used later in a condition, it is a problem though.
Here we had to keep the english text, or rewrite the conditions somehow.
This would require a non-trivial rewrite of the script Confused

Quote:
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 ?


My simple approach does not require gettext Smile

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


In Muppy and Newyearspup I use a wrapperscript that invoques gxmessage:
Code:
#!/bin/bash

XMESSAGE="gxmessage -encoding UTF-8"

text=`echo $@ | sed -e "s/.*-text \(.*\)/\1/"`
#echo "$text"

a=`echo $@ | sed -e "s/-bg pale /-bg /" -e "s/-placement [^ ]* //" -e "s/-outline [^ ]* //" -e "s/-margin [^ ]* //" -e "s/-text .*//"`

#echo $a

exec $XMESSAGE -center -buttons "" -borderless $a "$text"


It covers most, but not all the usage of yaf-splash in Puppy.
So far, enough to use it in those pupletts.

Quote:
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.


In Muppy, I used a newer version from Slackware.
I attach it, please try that one.
I did not check it in Puppy itself, so I hope it has no missing dependencies.
Backup your savefile first!

Quote:
7: UTF-8 in general:

For serious localization, Puppy needs to use UTF-8.
The newer kernels activate utf-8 by default.
In Muppy 0084c4 that worked fine.
For older kernels, ugly backports had to be written, to use a mix of ISO and UTF-8.
I know no simple solution for that.
But this basically just concerns initrd.gz (init), and one or 2 other files (I think /etc/rc.d/rc.shutdown, as it runs with dialog in console).

In the Muppy-buildsystem, I added a condition:
for new kernels, copy a UTF encoded file, for old ones, a ISO encoded file.

Mark
dialog-1.1_20070930-i486-1.pet
Description 
pet

 Download 
Filename  dialog-1.1_20070930-i486-1.pet 
Filesize  76.48 KB 
Downloaded  559 Time(s) 

_________________
my recommended links

Edited_times_total
Back to top
View user's profile Send_private_message Visit_website 
maddox

Joined: 28 Sep 2007
Posts: 453
Location: sometimes in France

PostPosted: Sun 08 Feb 2009, 22:56    Post_subject:  

Hi MU,
Thanks for all that VERY usefull info, it will be relayed back into Toutou and put into practice.
Will keep you informed about your yaf-splash and Dialog work-arounds Wink

The complete UTF-8 way (KERNEL and UTF-8 compatible programs) is really the right road from now on, just look at the numerous Puppy translations available.
- Most of the other (non english) Puppy translations had to recompile the kernel with UTF-8 support for simple things like fat/vfat bindings and other hitches :
.. nls_cp437 (english only) and nls_iso8859-1 (doesn't include all world languages) .. Then modify the "init" script accordingly and add the nls_utf8 file.

UTF-8 might slow Puppy down as characters could be multi-byte encoded, depends on the language used.
But it will have the added advantage of easier Puppy translation to many foreign languages (no need to change the script encoding)

Thanks for the positive info about the po/mo question. (nber 1)
Back to top
View user's profile Send_private_message 
droope


Joined: 31 Jul 2008
Posts: 814
Location: Uruguay, Mercedes

PostPosted: Mon 09 Feb 2009, 12:10    Post_subject:  

COnnectio n wizard Smile still a lot to go tho. And no time.
connectwizard.tar.gz
Description 
gz

 Download 
Filename  connectwizard.tar.gz 
Filesize  2.55 KB 
Downloaded  531 Time(s) 
Back to top
View user's profile Send_private_message 
droope


Joined: 31 Jul 2008
Posts: 814
Location: Uruguay, Mercedes

PostPosted: Mon 09 Feb 2009, 12:27    Post_subject:  

Great news! net-setup.sh already was localized.

By dougal.

So there, I declare the networking localized, even tho there is still the dialup.

Puppy universal installer is the one to go next, tho i think it'll take a year or two Razz
Back to top
View user's profile Send_private_message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Mon 09 Feb 2009, 13:07    Post_subject:  

Bonjour,
@Droope,
It seems you've done the same job on connect-wizard i does (see same forum on February 6).
Cordialement Wink

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send_private_message 
droope


Joined: 31 Jul 2008
Posts: 814
Location: Uruguay, Mercedes

PostPosted: Mon 09 Feb 2009, 17:26    Post_subject:  

Well, at least I am a programming beast now Razz (?)

I thought that wasn't complete? Sad

Well, mine or yours, it's the same. The good thing is that dougal localized net-setup, WHIch is HUGE, extremely long. I love dougal, I'd be mad by now.

I' think that localizing puppy universal installer would be usefull.I'll do it, when i feel like doing it (too tired now), if you want to do it, feel free, but please MP or post it. Smile

I think we'll be done in no time.
Back to top
View user's profile Send_private_message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Wed 11 Feb 2009, 04:27    Post_subject:  

Bonjour,

@ droope,
I am trying to complete xorgwizard, but i have some issues.
I let you work on Puppy Installer.
I'll make a list of scripts to be localized and submit it to the community.

Cordialement Wink

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send_private_message 
droope


Joined: 31 Jul 2008
Posts: 814
Location: Uruguay, Mercedes

PostPosted: Wed 11 Feb 2009, 23:29    Post_subject:  

Puppy remaster script Smile
REMASTERSCRIPT.tar.gz
Description 
gz

 Download 
Filename  REMASTERSCRIPT.tar.gz 
Filesize  9.15 KB 
Downloaded  567 Time(s) 
Back to top
View user's profile Send_private_message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Fri 13 Feb 2009, 10:38    Post_subject:  

Bonjour,

For anyone who wants to test, here are /usr/sbin/xorgwizard and /usr/X11R7/bin/xwin localized as they have relations. I have tried to localize /etc/rc.d/functions4puppy4, but I am not able to.
There are also the english and french .mo files, for both.
There are 2 issues in xwin : line 482 and 490. If somebody wants to fix.

@Droope,
I've found an issue in your puppy remaster script. Is the file you've joined the good one?

Cordialement Wink

Edited by esmourguit feb 19 - 03:14 PM: below updated files
xwin-420loc.tar.gz
Description 
gz

 Download 
Filename  xwin-420loc.tar.gz 
Filesize  8.91 KB 
Downloaded  804 Time(s) 
xorgwizard420-loc.tar.gz
Description 
gz

 Download 
Filename  xorgwizard420-loc.tar.gz 
Filesize  24.05 KB 
Downloaded  548 Time(s) 

_________________
Toutou Linux - Pets francisés

Edited_times_total
Back to top
View user's profile Send_private_message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Fri 13 Feb 2009, 17:18    Post_subject:  

esmourguit wrote:

There are 2 issues in xwin : line 482 and 490. If somebody wants to fix.


Please explain it in detail.

482 looks ok:
Code:
   if [ ! "$NEWLANG" = "$LANG" ];then


490: is an empty line, the last one in the script.

Mark

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
droope


Joined: 31 Jul 2008
Posts: 814
Location: Uruguay, Mercedes

PostPosted: Fri 13 Feb 2009, 17:54    Post_subject:  

Darn Sad didn't get that error the last time i tried it. :/

But yes, that's the finished version. Every time i try to fix it i think i break it further. Perhaps mu... Razz

I'm sure it's just something i deleted, or something. (Thanks esmorguit for testing it!!)

The file is above,



Here is a screenshot of the error.

And the console error:

This i got the second time:
Quote:
/root/NewDir/NewDir/remasterpup2: line 49: kill: (15246) - No such process
SIZETOTALM=424
cat: /tmp/tag.txt: No such file or directory



Quote:
/root/NewDir/NewDir/remasterpup2: line 50: 16841 Terminated Xdialog --wrap --title "${L_CALCULATINGT}" --msgbox "${L_CALCULATING}" 0 0
SIZETOTALM=424
cat: /tmp/tag.txt: No such file or directory


I get a diferent error every time :/ If someone can help me it would be great Smile
Back to top
View user's profile Send_private_message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Fri 13 Feb 2009, 18:39    Post_subject:  

droope,

line 110
Code:
 echo -n "${L_CHOOSEDRIVE}" 0 0 5 " >> /tmp/savedlg


must be:
Code:
 echo -n "${L_CHOOSEDRIVE}\" 0 0 5 " >> /tmp/savedlg


Smile

Mark

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 2 of 9 Posts_count   Goto page: Previous 1, 2, 3, 4, ..., 7, 8, 9 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1098s ][ Queries: 13 (0.0110s) ][ GZIP on ]