Discussion: translating Puppys System-tools
Discussion: translating Puppys System-tools
This is difficult.
A program like Gnumeric can easily be localized, for 2 reasons:
1. the lanuage is stored in external gnumeric.mo -files in /usr/share/locale/LANGUAGE/.
2. gnumeric.mo -files already exist for maybe 20 languages.
Puppys tools are different.
Each word is hardcoded in the program itself.
So a "proper" localization would require 4 steps:
1. Replace each word with a variable
2. Add a function, that detects the LANG -environment-variable set with the "chooselocale"-utility.
3. "source" a /usr/share/locale/LANGUAGE/PROGRAM.mo -file to fill the variables with words.
4. Add as many different .mo -files as possible.
So we need coders that start adding the functions, and later users (without programming-experience) to translate .mo -files.
Mark
A program like Gnumeric can easily be localized, for 2 reasons:
1. the lanuage is stored in external gnumeric.mo -files in /usr/share/locale/LANGUAGE/.
2. gnumeric.mo -files already exist for maybe 20 languages.
Puppys tools are different.
Each word is hardcoded in the program itself.
So a "proper" localization would require 4 steps:
1. Replace each word with a variable
2. Add a function, that detects the LANG -environment-variable set with the "chooselocale"-utility.
3. "source" a /usr/share/locale/LANGUAGE/PROGRAM.mo -file to fill the variables with words.
4. Add as many different .mo -files as possible.
So we need coders that start adding the functions, and later users (without programming-experience) to translate .mo -files.
Mark
- Nathan F
- Posts: 1764
- Joined: Wed 08 Jun 2005, 14:45
- Location: Wadsworth, OH (occasionally home)
- Contact:
After 109 releases I could possibly help with adding the variables you mentioned. I think once the first script has had such a conversion it could be used as a model or template, and all the rest would go that much quicker.
This is really something I want to help with because I've already got a lot of people interested in Grafpup from other parts of the world, and in fact the only reviews of Grafpup that have been anything less than positive come from overseas and focus on this issue.
It will of course be up to those who can speak and write a foreign language to add the actual translations. My German and Spanish are so rusty I avoid showing my ignorance
Nathan
This is really something I want to help with because I've already got a lot of people interested in Grafpup from other parts of the world, and in fact the only reviews of Grafpup that have been anything less than positive come from overseas and focus on this issue.
It will of course be up to those who can speak and write a foreign language to add the actual translations. My German and Spanish are so rusty I avoid showing my ignorance
Nathan
Bring on the locusts ...
First, I hope that when you say 'word' you mean 'sentence' or 'code snippets'.
Second,
I really think that we should use something like gettext
It's a de-fact standard. It may speed up the implementation and help us avoid headaches.
The implementation is quite easy and small and it's already included in Puppy.
Second,
I really think that we should use something like gettext
It's a de-fact standard. It may speed up the implementation and help us avoid headaches.
The implementation is quite easy and small and it's already included in Puppy.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
would gettext work something like this?
export TEXTDOMAIN=dotpuphandler
MSG1=`gettext "File not found:"`
MSG2=`gettext "File integrity ERROR:"`
from what i can understand from a quick read of the getttext docs, this should translate those strings if gettext finds an approriate translation file, otherwise it should just set the variable to the string
this seems like it would be easy to implement in a script
however, i tried it with an icewm.po file in /usr/share/locale/fr/LC_MESSAGES/ like this:
# export LANG=fr_FR
# export TEXTDOMAIN="icewm"
# gettext "Error checking mailbox."
Error checking mailbox.
#
and it doesn't seem to work ... i think this should print:
export TEXTDOMAIN=dotpuphandler
MSG1=`gettext "File not found:"`
MSG2=`gettext "File integrity ERROR:"`
from what i can understand from a quick read of the getttext docs, this should translate those strings if gettext finds an approriate translation file, otherwise it should just set the variable to the string
this seems like it would be easy to implement in a script
however, i tried it with an icewm.po file in /usr/share/locale/fr/LC_MESSAGES/ like this:
# export LANG=fr_FR
# export TEXTDOMAIN="icewm"
# gettext "Error checking mailbox."
Error checking mailbox.
#
and it doesn't seem to work ... i think this should print:
yes, sentences instead of words.
Sorry I don't write much concerning localisation at moment.
I'm tracking down Bugs in the 3D-wizard, and Puppy2 now has one with the backgroundsetter.
And we finally have summer, today I was swimming in the Elbe-river, and after 6 hours in the sun I currently look as red as a boiled crustean
But i'm happy first people try to find solutions already
Mark
Sorry I don't write much concerning localisation at moment.
I'm tracking down Bugs in the 3D-wizard, and Puppy2 now has one with the backgroundsetter.
And we finally have summer, today I was swimming in the Elbe-river, and after 6 hours in the sun I currently look as red as a boiled crustean
But i'm happy first people try to find solutions already
Mark
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
Swim, use Puppy, be happy ;)
Good news. Hope you are not over cooked. The sun is (some say) better than the traditional RGB monitor and LCD backlight tanning indulged in by some geeks . . .MU wrote: And we finally have summer, today I was swimming in the Elbe-river, and after 6 hours in the sun I currently look as red as a boiled crustean
Warning for our black Puppys - do not use sun block labled "Micheal Jackson Sun Screen" - you could end up anywhere . . .
Probably the only safe place for sun bathing is China (they never see the sun) My sister was there a few years back and the country is under constant greyness from industrialisation . . .
What a world . . .
Swim, use Puppy, be happy
A bit busy and haven't been around these days. Good to see this new I18n forum section being developed
Gettext should be useful:
http://en.wikipedia.org/wiki/Gettext
Programs like Abiword and patched Dillo support gettext, but do Puppy's wizards and other apps (e.g those Tk/Tcl ones) support gettext too?
And we need a dotpup of this too:
http://www.poedit.org/
"poEdit is cross-platform gettext catalogs (.po files) editor..."
Gettext should be useful:
http://en.wikipedia.org/wiki/Gettext
Programs like Abiword and patched Dillo support gettext, but do Puppy's wizards and other apps (e.g those Tk/Tcl ones) support gettext too?
And we need a dotpup of this too:
http://www.poedit.org/
"poEdit is cross-platform gettext catalogs (.po files) editor..."
[url=http://puppylinux.org]Puppylinux.org - Community home page of Puppy Linux[/url] hosted by Barry (creator of Puppy), created and maintained by the [url=http://puppylinux.org/user/readarticle.php?article_id=8]Puppy Linux Foundation[/url] since 2005
They are not. This project should include internationalizing such scripts.puppian wrote:but do Puppy's wizards and other apps (e.g those Tk/Tcl ones) support gettext too?
Lets try different tools and see which ones are a better match for puppy.puppian wrote:And we need a dotpup of this too:
http://www.poedit.org/
"poEdit is cross-platform gettext catalogs (.po files) editor..."
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
it should be easy to modify scripts and tcl/tk wizards and programs to use gettextdo Puppy's wizards and other apps (e.g those Tk/Tcl ones) support gettext too?
as i said in an earlier post, it should be as easy as something like this in a bash script:
export TEXTDOMAIN=dotpuphandler
MSG1=`gettext "File not found:"`
MSG2=`gettext "File integrity ERROR:"`
this should set the MSGx strings to the value in quotes, but if the locale is set and there is a localization file, it should automatically translate the text
i used msgfmt to create an icewm.mo file from my icewm.po file, and that seems to be what was needed to get it to work:
# TEXTDOMAIN=icewm
# LANG=fr_FR gettext "Error checking mailbox."
Here is a good guide to start with gettext. It shows the basic utilities and commands needed.
http://www.linuxvalley.it/encyclopedia/ ... ation.html
It actually clarified to me what the TEXTDOMAIN value means.
By The way. What's the default localization path for Puppy?
/usr/local/share/locale/
or
/usr/share/locale/ ?
http://www.linuxvalley.it/encyclopedia/ ... ation.html
It actually clarified to me what the TEXTDOMAIN value means.
By The way. What's the default localization path for Puppy?
/usr/local/share/locale/
or
/usr/share/locale/ ?
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
I've been trying to test the get text translation without luck.
I change the locale and follow http://www.linuxvalley.it/encyclopedia/ ... ation.html
but the strings don't get translated.
What am I missing? It seems that it should be straight forward.
I change the locale and follow http://www.linuxvalley.it/encyclopedia/ ... ation.html
but the strings don't get translated.
What am I missing? It seems that it should be straight forward.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
gettext seems to work ... what i couldn't get to work was $"a text string" ... bash is supposed to treat a text string starting with $ as a short syntax to translate a string ... like this:
TEXTDOMAIN=test1
echo $"hello"
if TEXTDOMAINDIR and LANG and an appropriate .mo file is setup, this is supposed to translate "hello" to the language set by LANG ... it works when i explicitly use gettext, but $"hello" does not work
maybe bash was compiled without NLS support? ... it's also possible that LANG is not set when $"hello" is executed ... it might be necessary to kill X or even reboot to properly set LANG ... by the way, this might be the problem if you are having trouble with gettext, i found that for testing, i had to begin a line with LANG=fr_FR or whatever language you choose, or it would use the LANG that was set when you booted, which in my case is en_US (not that i'm in the us), which means there would be no translation
TEXTDOMAIN=test1
echo $"hello"
if TEXTDOMAINDIR and LANG and an appropriate .mo file is setup, this is supposed to translate "hello" to the language set by LANG ... it works when i explicitly use gettext, but $"hello" does not work
maybe bash was compiled without NLS support? ... it's also possible that LANG is not set when $"hello" is executed ... it might be necessary to kill X or even reboot to properly set LANG ... by the way, this might be the problem if you are having trouble with gettext, i found that for testing, i had to begin a line with LANG=fr_FR or whatever language you choose, or it would use the LANG that was set when you booted, which in my case is en_US (not that i'm in the us), which means there would be no translation
i made a simple demo for using gettext in a bash script ... see
http://www.murga.org/~puppy/viewtopic.php?t=7996
http://www.murga.org/~puppy/viewtopic.php?t=7996
I know what my problem was.
I was selecting LANG=es instead of LANG=es_ES.
I was also using the $"text" format instead of the explicit form. gettext...
Now it's working. I'll try internationalizing the Network wizard so it can be localized.
Oh, and you don't need to set the LANG in every line.
I was selecting LANG=es instead of LANG=es_ES.
I was also using the $"text" format instead of the explicit form. gettext...
Now it's working. I'll try internationalizing the Network wizard so it can be localized.
Oh, and you don't need to set the LANG in every line.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
i can't get $"text" to work either ... that's why i put LANG= on each line, to be absolutely sure LANG was set when the line executed
except, the way bash works, i think it substitutes all $"text" strings before any line in the script executes, so to work properly (for demo purposes), LANG variables should be set and exported before ever calling the script
also, gettext uses LANG, but i think bash uses LC_ALL ... but i still couldn't get $"text" to work
maybe it's the way bash was compiled ... maybe it was compiled without NLS support?
except, the way bash works, i think it substitutes all $"text" strings before any line in the script executes, so to work properly (for demo purposes), LANG variables should be set and exported before ever calling the script
also, gettext uses LANG, but i think bash uses LC_ALL ... but i still couldn't get $"text" to work
maybe it's the way bash was compiled ... maybe it was compiled without NLS support?
I just wanted to make sure that other readers understand that when implementing gettext in their scripts they should rely on the locale set for the system.GuestToo wrote:so to work properly (for demo purposes), LANG variables should be set and exported before ever calling the script
Thanks for your demo.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
Re: Discussion: translating Puppys System-tools
I am not a coder but I can translate English to Traditional ChineseMU wrote:
So we need coders that start adding the functions, and later users (without programming-experience) to translate .mo -files.
Mark
Can someone help me to translate Dillo-0.5.8-i18n-misc into zh_TW.UTF-8
environment under Puppy?
Thanks,
nyu
Rosetta
Hi there!
Does anyone know if there is a way to upload all the texts into Rosetta to easier internationalize Puppy?
If you never heard about it just check www.launchpad.net. Its a great tool for translating.
Another question: How can Linux beginner extract the texts from Puppy to translate it? And later put them back translated? Maybe some experienced user could do the extraction for others who don't know how & later help to load them back? What do you think?
Does anyone know if there is a way to upload all the texts into Rosetta to easier internationalize Puppy?
If you never heard about it just check www.launchpad.net. Its a great tool for translating.
Another question: How can Linux beginner extract the texts from Puppy to translate it? And later put them back translated? Maybe some experienced user could do the extraction for others who don't know how & later help to load them back? What do you think?
i think it is already translated to zh_TW ... does the font that is used make a difference? ... if it does, then you should be able to get the zh_TW.po file from the source and adapt it ... zh_TW.po already seems to be a UTF8 text fileCan someone help me to translate Dillo-0.5.8-i18n-misc into zh_TW.UTF-8
maybe you need to add a locale named zh_TW.UTF-8 in /usr/local/share/locale/ ? ... it could probably be a copy or a symlink to the zh_TW locale
source:
http://www.murga.org/~puppy/viewtopic.php?t=7473
i do not know if the Puppy unleased package is significantly different from MU's