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

#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 ...

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

#36 Post by nyu »

Thanks, I am learning more and more. There are many software
packages in Puppy which can't display Chinese. I want to know why.
Basically because they were written in gtk 1.x? I brought up Dillo because
it is the internal web browser for Puppy. It will be nice to display menus
and option-dialogs in Chinese. More and easier localization of Puppy will
spread Puppy to China, Taiwan, Hong Kong and oversea Chinese :lol:
I am just wondering why the following Dillo setup page can display Japanese.
http://teki.jpn.ph/pc/software/dillo-cfg-i18n.png
Are they using other than Unicode? I also have tried a Knoppix Chinese
distribution which uses zh_TW.Big5 as the locale. It can display menus
and option-dialogs in Traditional Chinese. Searching google gave me some
information of how to make a file in /etc/gtk to deal with gtk 1.x and Unicode.
But I have tried in Puppy without success. I am stuck. If some more
knowledgale people in this community can give me hands, I will be really
appreciated it.
Thanks again,
nyu

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

#37 Post by MU »

nyu, I have no idea...
I think Gtk itself might have to be compiled with UTF8-support?
Maybe Barry deactivated it?

maybe at http://gtk.org some hints can be found.

I know from wxWidgets (that uses Gtk), that the Utf8-feature in version 2.6 was very difficult to compile, one reason why wxBasic still uses the older wxWidgets 2.4.

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

#38 Post by Nathan F »

I haven't tried it but this seems on target:
GTK 1.x method

XMMS use GTK 1.x and sometimes don't display utf-8. this is a little tweak. Just define a gtk1 font for the your user by creating (or editing) ~/.gtkrc:

Type "nano ~/.gtkrc" and put the following into the file.

Code: Select all

style "user-font"
      fontset = "-misc-fixed-*-*-*-*-12-*-*-*-*-*-iso10646-1"
       
widget_class "*" style "user-font"
From some gentoo documentation on enabling unicode, this is a GTK-1.x section. It mentions XMMS but hopefully the same applies to other GTK-1 apps as well.

Nathan
Bring on the locusts ...

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

#39 Post by nyu »

I have tried it but it didn't work for me.

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

#40 Post by nyu »

MU wrote:nyu, I have no idea...
I think Gtk itself might have to be compiled with UTF8-support?
Maybe Barry deactivated it?

maybe at http://gtk.org some hints can be found.

I know from wxWidgets (that uses Gtk), that the Utf8-feature in version 2.6 was very difficult to compile, one reason why wxBasic still uses the older wxWidgets 2.4.
Since Barry is very interested in the OLPC project, he should be more aware of Internationalization and localization of Puppy. I assume most of these laptops
will be end up to developing countries :oops:
nyu

Post Reply