Discussion: translating Puppys System-tools

For efforts in internationalising Puppy and solving problems in this area
Message
Author
GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#16 Post by GuestToo »

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?

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#17 Post by rarsa »

GuestToo wrote:so to work properly (for demo purposes), LANG variables should be set and exported before ever calling the script
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.

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

User avatar
nyu
Posts: 110
Joined: Tue 14 Mar 2006, 15:30
Location: good earth

Re: Discussion: translating Puppys System-tools

#18 Post by nyu »

MU wrote:
So we need coders that start adding the functions, and later users (without programming-experience) to translate .mo -files.

Mark
I am not a coder but I can translate English to Traditional Chinese :lol:
Can someone help me to translate Dillo-0.5.8-i18n-misc into zh_TW.UTF-8
environment under Puppy?
Thanks,
nyu

Kingskid
Posts: 4
Joined: Sun 22 Jan 2006, 07:16
Location: Czech Republic, Kladno
Contact:

Rosetta

#19 Post by Kingskid »

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?

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#20 Post by GuestToo »

Can someone help me to translate Dillo-0.5.8-i18n-misc into zh_TW.UTF-8
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 file

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

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#21 Post by GuestToo »

How can Linux beginner extract the texts from Puppy to translate it?
for programs, the programs should be written (re-written) to support translations ... if the programs are written properly, the strings can be automatically extracted to a .po file (a text file with the text strings and spaces for the translations) ... for example, for a bash script, text stings in quotes with a leading $ will be extracted ( $"text" ) to the .po file

normally, the programmer would provide a .po file with a list of the text strings that need translation ... someone could add the translations and upload the translated .po file

a .po file would look something like this:

msgid "Reset"
msgstr ""

msgid "Reload"
msgstr ""

msgid "Save"
msgstr ""

after translation, it would look something like this:

# Dillo Chinese Translation

msgid "Reset"
msgstr "重設"

msgid "Reload"
msgstr "重載"

msgid "Save"
msgstr "儲存"

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

Re: Rosetta

#22 Post by rarsa »

Kingskid wrote:How can Linux beginner extract the texts from Puppy to translate it?
As Guesttoo explained:

"Translating" consist on two steps:

Internationalization (i18n):
Consist on enabling the application for multiple locales: (Language, text directionality, etc)

Localization (l10n):
Is the actuall translation of the strings apearing in an Internationalized application.

A developer does the i18n a translator the l10n.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
nyu
Posts: 110
Joined: Tue 14 Mar 2006, 15:30
Location: good earth

#23 Post by nyu »

GuestToo wrote:
Can someone help me to translate Dillo-0.5.8-i18n-misc into zh_TW.UTF-8
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 file

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
Hi GuestToo,
Thanks for leading me to the right direction. Here is my locale environment:
-----------------------------------------------------------------
#locale
LANG=zh_TW.UTF-8
LC_CTYPE=zh_TW.UTF-8
LC_NUMERIC="zh_TW.UTF-8"
LC_TIME="zh_TW.UTF-8"
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY="zh_TW.UTF-8"
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER="zh_TW.UTF-8"
LC_NAME="zh_TW.UTF-8"
LC_ADDRESS="zh_TW.UTF-8"
LC_TELEPHONE="zh_TW.UTF-8"
LC_MEASUREMENT="zh_TW.UTF-8"
LC_IDENTIFICATION="zh_TW.UTF-8"
LC_ALL=

#locale -a
C
en_AU
en_US
POSIX
zh_CN.utf8
zh_TW.UTF-8
-----------------------------------------------------------------
I downloaded dillo-0.8.5-i18n-misc source file and found the zh_TW.po file.
I can open the file using Leafpad. It is indeed in Unicode (UTF-8 ) format and I can
read the Chinese translation under my installed fonts. I wnat to compile the po file to
generate zh_TW.mo file but I can not do it in Puppy. Fortunately, I have another
system with Ubuntu and it has "gettext " installed by default. I used "msgfmt" to
generate the corresponding .mo file successfully. Then I copied the file back to my
Puppy computer and changed the file name from zh_TW.mo to dillo.mo because Dillo
suppose to read this file under /usr/local/share/locale/zh_TW/LC_MESSAGES/dillo.mo.
But when I open Dillo browser, the system sub-menus are still not readable in Chinese.
My question is when I compile zh_TW.po file, does it generate Unicode .mo file?

nyu

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#24 Post by rarsa »

nyu wrote:But when I open Dillo browser, the system sub-menus are still not readable in Chinese.
Do you mean that they have garbage characters? or that they are in English?
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#25 Post by rarsa »

look at this page. There is a section for Dilo:

http://puppylinux.org/wikka/LanguageSupport
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#26 Post by GuestToo »

nyu, i am not an expert in localisation

maybe what you need is to add a locale for
zh_TW.UTF-8 ... there is a locale for zh_TW, but maybe you need one for zh_TW.UTF-8 too

i think maybe the dillo.mo file for zh_TW.UTF-8 would be identical to the dillo.mo file for zh_TW

i installed MU's dillo package, and if is set LANG and LC_ALL to zh_TW or to zh_TW.UTF-8, i get an error message:

Gdk-WARNING **: locale not supported by Xlib, locale set to C

and dillo just runs in english ... maybe i would need to use localedef or something to setup my locales first?

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#27 Post by GuestToo »

when I compile zh_TW.po file, does it generate Unicode .mo file?
i do not know ... i would think that since the .po file is UTF8 then the .mo file will be too

and locale -a seems to show that you have a zh_TW.UTF-8 locale

do you get any error messages if you start dillo in an rxvt console?

and of course, you are using the internationalised dillo and not the standard version?

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#28 Post by GuestToo »

maybe it's the way bash was compiled ... maybe it was compiled without NLS support?
well, i tried using bash from 2 other distros that i have installed, and the implicit $"text" method does not seem to work with those version of bash either ... maybe they were compiled without NLS support either

maybe i'm not using the right syntax, but i think i'm doing it right ... for example, see here

User avatar
nyu
Posts: 110
Joined: Tue 14 Mar 2006, 15:30
Location: good earth

#29 Post by nyu »

rarsa wrote:
nyu wrote:But when I open Dillo browser, the system sub-menus are still not readable in Chinese.
Do you mean that they have garbage characters? or that they are in English?
Yes, they have garbage characters.

User avatar
nyu
Posts: 110
Joined: Tue 14 Mar 2006, 15:30
Location: good earth

#30 Post by nyu »

rarsa wrote:look at this page. There is a section for Dilo:

http://puppylinux.org/wikka/LanguageSupport
I have visited the page several times already. It mentions to view web pages in other
languages and I can read pages in Chinese but the problem is that I can't read the Dillo system sub-menus. The characters are all unreadable - garbage.

User avatar
nyu
Posts: 110
Joined: Tue 14 Mar 2006, 15:30
Location: good earth

#31 Post by nyu »

GuestToo wrote:

and locale -a seems to show that you have a zh_TW.UTF-8 locale

do you get any error messages if you start dillo in an rxvt console?

and of course, you are using the internationalised dillo and not the standard version?
When I run dillo in an rxvt console, I got the following errors but I am not sure they are related to my problem:

debianinstallerrc :38: unexpected string constant "send", expected symbol
debianinstallerrc :38: unexpected string constant "referer", expected symbol

And yes, I am using MU's dotpup Dillo file.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#32 Post by GuestToo »

that is strange ... i do not know why dillo would be accessing a file called debianinstallerrc ... i do not have that file, i just unzipped MU's package and copied the files to the appropriate places, i try to avoid registering things with pupget, and i did not want the package to mess with my menus either ... i try to make my own packages so that they are as independent of Puppy as possible

it seems that your locale is working, or there would be an error message "locale set to C"

maybe the locale is using the wrong character set ... as i said, i do not know a lot localisation

User avatar
nyu
Posts: 110
Joined: Tue 14 Mar 2006, 15:30
Location: good earth

#33 Post by nyu »

GuestToo wrote:that is strange ... i do not know why dillo would be accessing a file called debianinstallerrc ... i do not have that file, i just unzipped MU's package and copied the files to the appropriate places, i try to avoid registering things with pupget, and i did not want the package to mess with my menus either ... i try to make my own packages so that they are as independent of Puppy as possible

it seems that your locale is working, or there would be an error message "locale set to C"

maybe the locale is using the wrong character set ... as i said, i do not know a lot localisation
I need to spend some more time to find out what is going on......

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

#34 Post by MU »

Dillo is based on Gtk1.
Gtk1 cannot display Unicode as far as I know.

So Dillo will not be able to display chinese in the menus and option-dialogs.
The next release of Dillo will be based on Fltk, maybe that can display unicode.

Mark

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#35 Post by Nathan F »

This is something I will look into (FLTK + unicode) but right off my guess would be that unicode will be supported. Dillo is not the only major project porting over to FLTK, Cinepaint is doing so as well. I have to assume the developers at least took this into consideration.

If my memory serves I did read about it once, and the reply given was that unicode will be supported by FLTK but that support is not fully complete yet. Like I said, I'll research it.

Nathan
Bring on the locusts ...

Post Reply