Internationalization of Fatdog64-700b2

For efforts in internationalising Puppy and solving problems in this area
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog64-700b2

#1 Post by L18L »

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-12-31
fatdog64-700 is different, all infos for a fresh start
-



EDIT 2014-12-20
fatdog64-700 is different, fresh start from 4th page
-


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


EDIT 2014-11-06
fatdog64-700 is different, start from 3rd page
-
Attachments
DickerHund.png
(8.96 KiB) Downloaded 1547 times
Last edited by L18L on Wed 31 Dec 2014, 14:09, edited 14 times in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog

#2 Post by L18L »

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.

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

...and don't forget to make it executable
(4.55 KiB) Downloaded 727 times
Last edited by L18L on Thu 09 Jan 2014, 16:17, edited 8 times in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog

#3 Post by L18L »

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, 13:04, edited 6 times in total.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#4 Post by jamesbond »

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 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#5 Post by L18L »

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

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog

#6 Post by L18L »

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: Select all

[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
Attachments
control-panel-using_name_and_comment.png
(13.79 KiB) Downloaded 1501 times
fatdog-control-panel.sh.gz
save to /usr/bin and
gunzip and
chmod +x fatdog-control-panel.sh
(3.96 KiB) Downloaded 661 times

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#7 Post by jamesbond »

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 :)

cheers!

PS: "DickerHund" ("Thick Dog") - I like that :)
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#8 Post by L18L »

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: Select all

[ "${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: Select all

#!/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 :)
Hmh... namesshould not be translated, translated back it is
Image :oops: )

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#9 Post by L18L »

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: Select all

# 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')"

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#10 Post by jamesbond »

L18L wrote:
jamesbond wrote:desktop file for package-manager committed
Why? Translations have to go into langpackFatdog only.
Oops! Ok will remove it.
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: Select all

[ "${LANG:0:2}" = "en" ] && LANG=C # because it is faster
? It is running in my Fatdog installation
Yes, that's the line.
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.
Where can I download your committed things?
Here: http://www.ibiblio.org/fatdogscm/cgi-bi ... i/timeline (login first as anonymous).
jamesbond wrote:PS: "DickerHund" ("Thick Dog") - I like that :)
Hmh... namesshould not be translated, translated back it is
Image :oops: )
:lol: I didn't know it is a name, I thought it is a literal translation of "Fat" "Dog" :lol:

Code: Select all

[ "${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: Select all

# 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 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog

#11 Post by L18L »

jamesbond wrote:Here: http://www.ibiblio.org/fatdogscm/cgi-bi ... i/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" :lol:
You are right. It is not a name. It is the brand of a GNU/Linux distribution.
jamesbond wrote:

Code: Select all

[ "${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: Select all

# std localisation stanza.....
Here is mine:

Code: Select all

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: Select all

[ -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, 13:17, edited 2 times in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog

#12 Post by L18L »

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: Select all

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 :cry: )

EDIT: problem SOLVED, see http://www.murga-linux.com/puppy/viewto ... 1&start=41
Last edited by L18L on Wed 29 Jan 2014, 15:15, edited 2 times in total.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#13 Post by jamesbond »

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.
Here is mine:

Code: Select all

export TEXTDOMAIN=fatdog
Why does it have to be exported? Why wouldn't TEXTDOMAIN=fatdog suffice?
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: Select all

[ -z $TEXTDOMAIN ] && export TEXTDOMAIN=fatdog
causes
- 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?
- momanager to not recognize the script as using gettext translations
As above.

I will look into choose-locale later ...
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog

#14 Post by L18L »

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: Select all

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) :D

...and see that /usr/share/locale is used if TEXTDOMAINDIR is not set
gtk server needs it to be set.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#15 Post by jamesbond »

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 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#16 Post by L18L »

jamesbond wrote:... 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.
Thank you, now I also know why TEXTDOMAIN has to be exported.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#17 Post by jamesbond »

No worries.

So - what do you think of this:
jamesbond wrote:Note

Code: Select all

[ -z $TEXTDOMAIN ] && export TEXTDOMAIN=fatdog
causes
- 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?
- momanager to not recognize the script as using gettext translations
As above.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#18 Post by L18L »

jamesbond wrote:So - what do you think of this:
jamesbond wrote:Note

Code: Select all

[ -z $TEXTDOMAIN ] && export TEXTDOMAIN=fatdog
causes
- 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?
- momanager to not recognize the script as using gettext translations
As above.
momanager uses find '^export TEXTDOMAIN='

The app needs a TEXTDOMAIN defined by the developer.
An app could use more than one TEXTDOMAINs.

If we had NOT defined the TEXTDOMAIN inside the script we would need an additional file containing all the scripts that use a TEXTDOMAIN.

I cannot see any good reason to export TEXTDOMAIN before launching the app.

That's all for now.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#19 Post by jamesbond »

Ok, "export TEXTDOMAIN" it is.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Internationalization of Fatdog

#20 Post by L18L »

Code: Select all

#!/bin/sh
# fhelp is fatdog's internationalized help
# each language in their own subdirectory linked back to original
#
# Austrian help starts at /usr/share/doc/help/de_AT/home.htm (if any)
# German   help starts at /usr/share/doc/help/de/home.htm (if any)
# English  help starts at /usr/share/doc/home.htm
#

for i in help/${LANG%.*}/ help/${LANG%_*}/ ""
do
  h_file=/usr/share/doc/${i}home.htm
  [ -f $h_file ] && break
done

#echo $h_file

defaulthtmlviewer file://$h_file
I have used this file (fhelp under /usr/local/bin) to start translation of home and some pages in faq.

@jamesbond
take it and change menu entry for help to "fhelp" please.

I have made translations directly in text editor geany:
Some notes, howto create these translations will follow. EDIT: done... see 9 posts down
Attachments
faq.png
(12.81 KiB) Downloaded 1031 times
help_de_1.tar.gz
see image for content
(5.96 KiB) Downloaded 566 times
Last edited by L18L on Mon 20 Jan 2014, 14:33, edited 2 times in total.

Post Reply