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 28 Nov 2014, 17:43
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Internationalization of Fatdog64-700b2
Moderators: Lobster, MU, raffy
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 4 [57 Posts]   Goto page: 1, 2, 3, 4 Next
Author Message
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Thu 09 Jan 2014, 08:41    Post subject:  Internationalization of Fatdog64-700b2
Subject description: started with fatdog64-630. actual: Fatdog64-700b2
 

Internationalization of Fatdog

This is NOT Puppy (right?) ... Quirky6x is also NOT Puppy,
And both use puppy's langpacks as base, and their langpacks, langpackFatdog_* and langpackQuirky_* are just additions.

We will use puppy tools and puppy knowledge to make Fatdog bark in many languages.



EDIT 2014-10-13
fatdog64-700 is different, start from 3rd page
-


EDIT 2014-11-06
fatdog64-700 is different, start from 3rd page
-
DickerHund.png
 Description   
 Filesize   8.96 KB
 Viewed   678 Time(s)

DickerHund.png


Last edited by L18L on Thu 06 Nov 2014, 09:48; edited 12 times in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Thu 09 Jan 2014, 08:41    Post subject: Internationalization of Fatdog
Subject description: tools
 

To enable your language (other than English) you have to install
glibc_locale package from Fatdog64 Package Manager
and then choose Fatdog64 Set Locale from Localisation tab in Fatdog64 Control Panel

momanager is the tool to manage translations of
scripts, menu items, help files, man pages...

You will find a version of momanger in fatdog's devx
or the latest version at the end of
http://www.murga-linux.com/puppy/viewtopic.php?t=81259
momanager needs pupdialog from puppy which is attached here..

Now it is time to install the official langpack_ of your language.
Then some apps will already run in your language.

Our job is to make all of them run in your language.

-
pupdialog.gz
Description  save to /usr/bin and
gunzip pupdialog.gz
or simply click on it and decompress it

...and don't forget to make it executable
gz

 Download 
Filename  pupdialog.gz 
Filesize  4.55 KB 
Downloaded  238 Time(s) 

Last edited by L18L on Thu 09 Jan 2014, 12:17; edited 8 times in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Thu 09 Jan 2014, 08:41    Post subject: Internationalization of Fatdog  

Sort of TOC
in accordance with Barry's momanager
(Fatdog's momanager renders just what is already tested to work)

scripts

menu items

menu categories

XML files

SSS, documentation, help files, man pages...see first result here Arrow fatdog's help

binaries (ELF programms)



_______________

Last edited by L18L on Thu 16 Jan 2014, 09:04; edited 6 times in total
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Thu 09 Jan 2014, 11:47    Post subject:  

Marking my place here so that I can find it again.

L18L, I will copy the FPM stanzas to other gtk-server based tools too.

cheers!

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Thu 09 Jan 2014, 12:33    Post subject:  

jamesbond wrote:
I will copy the FPM stanzas to other gtk-server based tools too.

For everyone interested:
Fatdog uses gtk-server and XML files where translatable items are marked 'translatable="yes"' .
The translator will not have to take care about this because momanager can handle these things so that the translator will translate just the msgstr in po files as usual.

The only script ready for translation shipped in Fatdog64-630RC2 is FPM (Fatdog Package Manager). Therefore you will not see much more in "scripts that do not have a mo file".
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Thu 09 Jan 2014, 14:05    Post subject: Internationalization of Fatdog
Subject description: Control Panel
 

Let us start with Fatdog Control Panel

This script uses LANG=C (faster) if user's language is English.

...and the translations of Name and Comment in .desktop files are used,
ex: /usr/share/applications.in/fatdog-package-manager.desktop.
Code:
[Desktop Entry]
Encoding=UTF-8
Name[de]=Fatdog64 Paket-Manager
Name=Fatdog64 Package Manager
Icon=pet48x.png
Comment=Download and manage installed application software
Comment[de]=Herunterladen und Verwaltung installierter Anwendungs-Software
Exec=fatdog-package-manager.sh
Terminal=false
Type=Application
Categories=X-SetupEntry
GenericName=Fatdog64 Package Manager
NoDisplay=true
Translation of Comment is tooltip in control panel
control-panel-using_name_and_comment.png
 Description   
 Filesize   13.79 KB
 Viewed   664 Time(s)

control-panel-using_name_and_comment.png

fatdog-control-panel.sh.gz
Description  save to /usr/bin and
gunzip and
chmod +x fatdog-control-panel.sh
gz

 Download 
Filename  fatdog-control-panel.sh.gz 
Filesize  3.96 KB 
Downloaded  220 Time(s) 
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Sat 11 Jan 2014, 03:30    Post subject:  

Thanks L18L.

Pupdialog committed; momanager 20131219 committed to devx (with t12s stuff); desktop file for package-manager committed; fatdog-control-panel.sh committed (with changes, I took the stanza from FPM as the one you provided didn't work ${VAR:x:y} is bash-only and fatdog-control-panel uses ash).

Keep it coming Smile

cheers!

PS: "DickerHund" ("Thick Dog") - I like that Smile

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sun 12 Jan 2014, 05:46    Post subject:  

jamesbond wrote:
desktop file for package-manager committed
Why? Translations have to go into langpackFatdog only.

jamesbond wrote:
fatdog-control-panel.sh committed (with changes, I took the stanza from FPM as the one you provided didn't work ${VAR:x:y} is bash-only and fatdog-control-panel uses ash).
You mean just the line
Code:
[ "${LANG:0:2}" = "en" ] && LANG=C # because it is faster
? It is running in my Fatdog installation:
my Terminal wrote:
# echo $LANG
de_DE.UTF-8
# echo ${LANG:0:2}
de
# echo ${LANG%_*}
de
#
or from a script named varxy:
Code:
#!/bin/ash
 echo $LANG
#de_DE.UTF-8
 echo ${LANG:0:2}
#de
 echo ${LANG%_*}
#de
#
my Terminal wrote:
# varxy
de_DE.UTF-8
de
de
#
# LANG=en_AU varxy
en_AU
en
en
#
If it is not working then there should be another reason.
It is difficult for me to reproduce your not working situation. Where can I download your committed things?

jamesbond wrote:
PS: "DickerHund" ("Thick Dog") - I like that Smile
Hmh... namesshould not be translated, translated back it is
[img]http://static1.wikia.nocookie.net/__cb20131105035239/kingdomhearts/images/f/f0/Retro_Goofy.png [/img] Embarassed )
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Sun 12 Jan 2014, 13:07    Post subject:  

jamesbond wrote:
...I took the stanza from FPM as the one you provided didn't work...

Here is how it works English (very fast) and translated
Code:
# Note to myself: gtk_tree_store_set must always be defined before use

#next 2 lines need to be set at boot time only
export TEXTDOMAINDIR=/usr/share/locale
export OUTPUT_CHARSET=UTF-8

# std localisation stanza
export TEXTDOMAIN=fatdog
. gettext.sh

TRANSLATE_CATEGORIES_AND_PACKAGE_DESCIPTIONS=/usr/share/locale/${LC_MESSAGES}/translate

# performance tweak - disable LC_MESSAGES unless there is localisation, makes it faster
#! [ -e $TEXTDOMAINDIR/${LC_MESSAGES%.*}/LC_MESSAGES/$TEXTDOMAIN.po ] &&
#unset LC_MESSAGES # disable translation and make things go really really faster
#LANG=C # make bash run faster
[ "${LANG%_*}" = "en" ]   && LANG=C # make bash run faster

### configuration
APPTITLE="$(gettext 'Fatdog64 Package Manager')"
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Mon 13 Jan 2014, 00:01    Post subject:  

L18L wrote:
jamesbond wrote:
desktop file for package-manager committed
Why? Translations have to go into langpackFatdog only.

Oops! Ok will remove it.

Quote:

jamesbond wrote:
fatdog-control-panel.sh committed (with changes, I took the stanza from FPM as the one you provided didn't work ${VAR:x:y} is bash-only and fatdog-control-panel uses ash).
You mean just the line
Code:
[ "${LANG:0:2}" = "en" ] && LANG=C # because it is faster
? It is running in my Fatdog installation

Yes, that's the line.
Quote:
It is difficult for me to reproduce your not working situation.

No that's my mistake - the code actually works under 'ash' (!) I would have expected it *not* to work because that syntax belongs to bash, not ash (if you look at http://linux.die.net/man/1/ash you can't find it; and in fact if you try it with a plain 'dash' it won't work). It actually works in 'ash' because I enabled some "bash-compatible" syntax when I built ash (which is part of busybox). The problem with "some" is that you'll never know which ones work and which ones don't unless you test for them. Plus different version of busybox tend to have different ideas of how much "bash-compatibility" it can support.
Quote:
Where can I download your committed things?

Here: http://www.ibiblio.org/fatdogscm/cgi-bin/fatdog64.cgi/timeline (login first as anonymous).

Quote:
jamesbond wrote:
PS: "DickerHund" ("Thick Dog") - I like that Smile
Hmh... namesshould not be translated, translated back it is
[img]http://static1.wikia.nocookie.net/__cb20131105035239/kingdomhearts/images/f/f0/Retro_Goofy.png [/img] Embarassed )
Laughing I didn't know it is a name, I thought it is a literal translation of "Fat" "Dog" Laughing

Quote:
Code:
[ "${LANG%_*}" = "en" ]   && LANG=C # make bash run faster
Okay I will take this, but I still want to revert to "C" if langpack isn't installed even though the locale isn't "en".

EDIT: Here's the new stanza looks like:
Code:
# std localisation stanza
[ -z $TEXTDOMAINDIR ] && export TEXTDOMAINDIR=/usr/share/locale
[ -z $TEXTDOMAIN ] && export TEXTDOMAIN=fatdog
. gettext.sh
# performance tweak - use "C" if language is "en" and there is no localisation
[ "${LANG%_*}" = "en" ] && LANG=C
! [ -e $TEXTDOMAINDIR/${LANG%.*}/LC_MESSAGES/$TEXTDOMAIN.mo ] &&
! [ -e $TEXTDOMAINDIR/${LANG%_*}/LC_MESSAGES/$TEXTDOMAIN.mo ] && LANG=C
Note: no OUTPUT_CHARSET as it is now set in /etc/profile and is available for all to use.
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Mon 13 Jan 2014, 08:24    Post subject: Internationalization of Fatdog
Subject description: std localisation stanza
 

jamesbond wrote:
Here: http://www.ibiblio.org/fatdogscm/cgi-bin/fatdog64.cgi/timeline (login first as anonymous).
Thanks, I will login and look in.

jamesbond wrote:
I didn't know it is a name, I thought it is a literal translation of "Fat" "Dog" Laughing
You are right. It is not a name. It is the brand of a GNU/Linux distribution.

jamesbond wrote:
Quote:
Code:
[ "${LANG%_*}" = "en" ]   && LANG=C # make bash run faster
Okay I will take this, but I still want to revert to "C" if langpack isn't installed even though the locale isn't "en".
One or the other but not both please.
Let us retain the option of using translations for en_AUS or en_GB and forget [ "${LANG%_*}" = "en" ] && LANG=C.

jamesbond wrote:
EDIT: Here's the new stanza looks like:
Code:
# std localisation stanza.....

Here is mine:
Code:
export TEXTDOMAIN=fatdog
# std localisation stanza
. gettext.sh
! [ -e $TEXTDOMAINDIR/${LANG%.*}/LC_MESSAGES/$TEXTDOMAIN.mo ] &&
! [ -e $TEXTDOMAINDIR/${LANG%_*}/LC_MESSAGES/$TEXTDOMAIN.mo ] && LANG=C
Note: no TEXTDOMAINDIR as it is now should be set in /etc/profile and is available for all to use.

Note
Code:
[ -z $TEXTDOMAIN ] && export TEXTDOMAIN=fatdog
causes
- momanager to not recognize the script as using gettext translations
- TEXTDOMAIN becoming unchangeable.

_______________________
Puppy user since 1.04

Last edited by L18L on Mon 13 Jan 2014, 09:17; edited 2 times in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Mon 13 Jan 2014, 09:06    Post subject: Internationalization of Fatdog
Subject description: fatdog-choose-locale.sh
 

The tree view of language>country>locale is excellent.
Much simpler to use than with puppy where it is always difficult (for old geezers at least) to choose the locale from a very long list.

Even better would it be when fatdog-choose-locale.sh displays names of language in the language of language. ex: Deutsch not German, Suomi not Finnish, Pycckuu not Russian,.......

It is possible, I have been trying but without success.
/usr/share/i18n/locales/<locale> does contain lang_name
Code:
lang_name="`grep lang_name /usr/share/i18n/locales/de_DE`";lang_name=${lang_name#*\"}
lang_name=${lang_name//>}
lang_name=${lang_name//</\\}
printf "$lang_name"
Deutsch"
Sort by this lang_name and the Non-English world will be happy.

One and only problem I see is some east Asian languages will not be rendered...
We can live with this if this lang_name is additional to (English) name (or insert Asian font or a graphic Crying or Very sad )

EDIT: problem SOLVED, see http://www.murga-linux.com/puppy/viewtopic.php?t=91301&start=41

Last edited by L18L on Wed 29 Jan 2014, 11:15; edited 2 times in total
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Mon 13 Jan 2014, 13:21    Post subject:  

Quote:
One or the other but not both please.
Let us retain the option of using translations for en_AUS or en_GB and forget [ "${LANG%_*}" = "en" ] && LANG=C.
Agreed and done.

Quote:
Here is mine:
Code:
export TEXTDOMAIN=fatdog
Why does it have to be exported? Why wouldn't TEXTDOMAIN=fatdog suffice?

Quote:
Note: no TEXTDOMAINDIR as it is now should be set in /etc/profile and is available for all to use.
Agreed and done.

Note
Code:
[ -z $TEXTDOMAIN ] && export TEXTDOMAIN=fatdog
causes
Quote:
- TEXTDOMAIN becoming unchangeable.
On the contrary it means you can export TEXTDOMAIN=xxx before you launch the app and the app will use that "xxx" as the text-domain instead "fatdog". The question is, whether this is valuable enough functionality to justify modifying momanager for recognise it?
Quote:
- momanager to not recognize the script as using gettext translations
As above.

I will look into choose-locale later ...

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2579
Location: www.eussenheim.de/

PostPosted: Mon 13 Jan 2014, 14:01    Post subject: Internationalization of Fatdog
Subject description: export TEXTDOMAIN
 

jamesbond wrote:
Why does it have to be exported? Why wouldn't TEXTDOMAIN=fatdog suffice?

For a very short moment I have been attempted to answer "because we have always exported the TEXTDOMAIN" but let us prove it right now.
My /usr/share/locale/de/LC_MESSAGES/fatdog.mo has content:
Code:
msgid "Description"
msgstr "Beschreibung"
(That is po file, if you want to play with it you have to
msgfmt <this po file> -o - > /usr/share/locale/en_AUS/LC_MESSAGES/fatdog.mo)
my Terminal wrote:
# gettext "Description"
Description#
#
# gettext "fatdog" "Description"
Beschreibung#
#
# TEXTDOMAIN=fatdog gettext "Description"
Beschreibung#
#
# TEXTDOMAIN=fatdog
# gettext "Description"
Description#
#
# export TEXTDOMAIN=fatdog
# gettext "Description"
Beschreibung#
#
# echo $TEXTDOMAINDIR

#
#
Hope that helps to understand (not why but that export is needed) Very Happy

...and see that /usr/share/locale is used if TEXTDOMAINDIR is not set
gtk server needs it to be set.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Mon 13 Jan 2014, 15:01    Post subject:  

Yes, thanks for that L18L. I was being extremely silly - I forgot that in scripts "gettext" is another application, not a C function linked into the main executable (in which case it doesn't need to be exported). Same reason for gtk-server.
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 4 [57 Posts]   Goto page: 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1265s ][ Queries: 12 (0.0041s) ][ GZIP on ]