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 Sun 23 Nov 2014, 14:46
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 2 of 4 [57 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Author Message
L18L

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

PostPosted: Tue 14 Jan 2014, 05:43    Post subject:  

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.
Back to top
View user's profile Send private message 
jamesbond

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

PostPosted: Tue 14 Jan 2014, 10:28    Post subject:  

No worries.

So - what do you think of this:

jamesbond wrote:
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.

_________________
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: 2578
Location: www.eussenheim.de/

PostPosted: Tue 14 Jan 2014, 11:57    Post subject:  

jamesbond wrote:
So - what do you think of this:
jamesbond wrote:
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.

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.
Back to top
View user's profile Send private message 
jamesbond

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

PostPosted: Wed 15 Jan 2014, 08:31    Post subject:  

Ok, "export TEXTDOMAIN" it is.
_________________
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: 2578
Location: www.eussenheim.de/

PostPosted: Thu 16 Jan 2014, 08:57    Post subject: Internationalization of Fatdog
Subject description: index, home and faq
 

Code:
#!/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
faq.png
 Description   
 Filesize   12.81 KB
 Viewed   665 Time(s)

faq.png

help_de_1.tar.gz
Description  see image for content
gz

 Download 
Filename  help_de_1.tar.gz 
Filesize  5.96 KB 
Downloaded  145 Time(s) 

Last edited by L18L on Mon 20 Jan 2014, 10:33; 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: Sat 18 Jan 2014, 14:19    Post subject: Re: Internationalization of Fatdog
Subject description: index, home and faq
 

L18L wrote:
@jamesbond
take it and change menu entry for help to "fhelp" please.
Done, thanks, but Fatdog actually doesn't have a menu entry for "help". It is accessible directly from the browser's homepage. May be I should add one, hmmm ...
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
icake

Joined: 26 Jul 2012
Posts: 185

PostPosted: Sat 18 Jan 2014, 22:52    Post subject: Fatdog Chinese Language pets
Subject description: Unable to print chinese character in menu button
 

I am making new Chinese Language pets for fatdog64 630rc2 and runs into this challenge:

1. the starting menu at the lower left hand corner of the screen shows a fatdog logo with the word "Menu"
2. I think this is controlled by /etc/xdg/razor/razor-panel/panel.conf 2nd section [mainmenu] line 3:
English version: text=Menu
3. when I changed the above line to Chinese:
text=菜单 or text=菜單 and restart X, the menu is showing some unprintable characters
the attached picture shows the before/after English/Chinese menus

Does anyone know how to fix this?
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Sun 19 Jan 2014, 06:31    Post subject: Re: Fatdog Chinese Language pets
Subject description: Unable to print chinese character in menu button
 

icake wrote:
Does anyone know how to fix this?

Sorry, no idea how to fix this.
It is not specific to Chinese, just no UTF-8 support I think.
Code:
[mainmenu]
showText=true
type=mainmenu
text=Menü
menü.png
 Description   German menu which is Menü (last letter is u umlaut)
 Filesize   2.35 KB
 Viewed   661 Time(s)

menü.png

Back to top
View user's profile Send private message 
icake

Joined: 26 Jul 2012
Posts: 185

PostPosted: Sun 19 Jan 2014, 09:58    Post subject: Internationalization of Fatdog
Subject description: UTF-8 characters in Start menu
 

Here are my 2 cents input on how to tackle this UTF-8 label:

1. In a perfect world, /etc/xdg/razor/razor-panel/panel.conf should be able to print UTF-8 characters. It cannot. We can wait for the next version(s) and hope UTF-8 will be correctly shown soon.

2. We can recompile the program from source with UTF-8 enabled. However I do not think the effort is justified.

3. A temporary fix is to hide the label text (showtext=false) and replace the fatdog icon with a new icon with fatdog logo on the left and UTF-8 characters on the right, all in one image file. This requires the name of the file controlling what icon to print. I still cannot find this file and wonder whether someone might know the answer.
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Mon 20 Jan 2014, 05:27    Post subject: fatdog-control-panel
Subject description: bug ?
 

/usr/sbin/fatdog-package-manager-library.awk and fatdog-control-panel.sh installed
(downloaded, moved to /usr/sbin and made executable)

Code:
#!/bin/dash
# Fatdog Package Manager
# A puppy-compatible replacement for Puppy Package Manager
puppy-compatible sounds good.

Code:
# fatdog-package-manager.sh
awk: Diese Option benötigt ein Argument -- »f«
BusyBox v1.22.0.git (2013-07-05 02:56:35 WIT) multi-call binary.

Usage: awk [OPTIONS] [AWK_PROGRAM] [FILE]...

   -v VAR=VAL   Set variable
   -F SEP      Use SEP as field separator
   -f FILE      Read program from FILE
Argument of -f is blanc, see
Code:
#
# which fatdog-package-manager-library.awk
#
Hope that helps

EDIT
Overriding "which"
Code:
AWK_LIB=$(which fatdog-package-manager-library.awk)
AWK_LIB=/usr/sbin/fatdog-package-manager-library.awk
makes the error messages disappear but slows down performance.
Rolling Eyes
Back to top
View user's profile Send private message 
jamesbond

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

PostPosted: Mon 20 Jan 2014, 07:22    Post subject: Re: Internationalization of Fatdog
Subject description: UTF-8 characters in Start menu
 

icake wrote:
Here are my 2 cents input on how to tackle this UTF-8 label:

1. In a perfect world, /etc/xdg/razor/razor-panel/panel.conf should be able to print UTF-8 characters. It cannot. We can wait for the next version(s) and hope UTF-8 will be correctly shown soon.

2. We can recompile the program from source with UTF-8 enabled. However I do not think the effort is justified.
I can't answer this two. I've asked kirk.

Quote:
3. A temporary fix is to hide the label text (showtext=false) and replace the fatdog icon with a new icon with fatdog logo on the left and UTF-8 characters on the right, all in one image file. This requires the name of the file controlling what icon to print. I still cannot find this file and wonder whether someone might know the answer.
I think the filename can't be changed (it's mainmenu.svg) but what you can change is the "theme". The default theme is "ambiance", you can copy the entire directory (in /usr/share/razor/themes), change the theme name (e.g. ambience-de), and tell razor-panel to use that theme in /etc/xdg/razor/razor.conf. Disclaimer: haven't tried it myself Cool

L18L wrote:
Argument of -f is blanc, see
That's because you're supposed to chmod +x fatdog-package-manager-library.awk too. Or just override the stuff like you did - that should work too.

Quote:
makes the error messages disappear but slows down performance.
Now this is annoying Crying or Very sad How much slower? Where is it slow (initial startup?).

EDIT:
Quote:
puppy-compatible sounds good.
Yes, but you need to know which version of PPM it is compatible with Laughing - the very earliest one (puppy 4.x). In fact, Puppy's PPM is still in Fatdog, just run /usr/local/petget/pkg_chooser.sh and you'll be greeted with something very familiar Smile (and it still works - whatever is installed by FPM can be uninstalled by PPM and vice versa).
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
kirk

Joined: 11 Nov 2005
Posts: 1436
Location: florida

PostPosted: Mon 20 Jan 2014, 09:11    Post subject:  

Quote:
icake wrote:
Here are my 2 cents input on how to tackle this UTF-8 label:

1. In a perfect world, /etc/xdg/razor/razor-panel/panel.conf should be able to print UTF-8 characters. It cannot. We can wait for the next version(s) and hope UTF-8 will be correctly shown soon.

2. We can recompile the program from source with UTF-8 enabled. However I do not think the effort is justified.
I can't answer this two. I've asked kirk.


I removed all of the localization files from razorqt-panel, which is what we have normally done in the past since everything was english only and we try to keep things as small as possible. For Fatdog64-700 we will have to reconsider that. I've attached a pet with the razorqt-panel localization files. I just happened to still have that around. Hope that helps.
int-1.0.pet
Description 
pet

 Download 
Filename  int-1.0.pet 
Filesize  92.16 KB 
Downloaded  125 Time(s) 
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Mon 20 Jan 2014, 09:50    Post subject: Re: Internationalization of Fatdog
Subject description: awk issue
 

jamesbond wrote:
L18L wrote:
Argument of -f is blanc, see
That's because you're supposed to chmod +x fatdog-package-manager-library.awk too. Or just override the stuff like you did - that should work too.
That's it. Has not been executable.

Quote:
Quote:
makes the error messages disappear but slows down performance.
Now this is annoying Crying or Very sad How much slower? Where is it slow (initial startup?).

Code:
time populate_all_pkg
does not work. Therefore just the raw seconds:

AWK_LIB=$(which fatdog-package-manager-library.awk) Arrow 15sec
AWK_LIB= Arrow 5sec and error messages in console

But I do not see any difference in GUI output. Rolling Eyes
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Mon 20 Jan 2014, 10:15    Post subject: Re: Internationalization of Fatdog
Subject description: index, home and faq
 

L18L wrote:
Some notes, howto create these translations will follow.
Or just a shell script (store it where ever you like or just paste it to terminal):
Code:
#!/bin/sh
# create translation files for fatdog's home and faqs
# /usr/share/doc/home/htm must be translated first
# /usr/share/doc/faqs/faq.html must be translated secondly
# choose from faqs directory which one to translate

# functions
go() { echo "
  $1
  Press ENTER to continue or Ctrl_C to cancel"; read x; }

create_file() {
  from=$1
  to=$2

  go "Convert $from to $to --to-code=UTF-8"
  iconv --from-code=ASCII --to-code=UTF-8 $from --output=$to

  go "Insert language and change charset to UTF-8"
  sed -i "s/<html>/<html lang=\"$L\">/" $to
  sed -i 's/charset=ISO-8859-1/charset=UTF-8/' $to

  go "Set base for all links"
  sed -i "s#<head>#<head>${BASE}#" $to

  go "Some style"
  sed -i 's@</head>@<style type="text/css">#container {max-width:44em;margin:auto;} h1 img {height:100px;margin:0 2em -.1em 0;} h1 {text-align:center;}   .translated {text-align:right;font-size:67%;}</style></head>@' $to

  echo "Set link back to original"
  sed -i "s#</body>#<p class="translated">Translated from the <a href="$from">English Original</a></p></body>#" $to

  go "That's all I could do for you.

 Note, properties of this file is yet shown as ASCII, when you have entered the first non-ASCII word then it will be shown as UTF-8.

 The file $to will be opened in text editor geany now
 Happy translating"
 geany $to
}
# /functions

L=${LANG%_*}
# create subdirs for language
for i in /usr/share/doc/help /usr/share/doc/faqs; do mkdir -p $i/$L; done

for i in /usr/share/doc/help/$L/home.htm /usr/share/doc/faqs/$L/faq.html; do
 [ -f $i ] && continue
 case $i in
   *home*) f=/usr/share/doc/home.htm; BASE='<base a href="../../">' ;;
   *faq*)  f=/usr/share/doc/faqs/faq.html BASE='<base a href="../">';;
 esac
 create_file $f $i
done  # home.htm and faqs/faq.html translated

cd /usr/share/doc/faqs
while true; do # translate one or some or all faq
  f=$1
  until [ `ls ${f}* | wc -w` -eq 1 ]; do
    echo ""; ls ${f}*.htm*; echo ""; read f
  done
  f=`ls ${f}*`
  BASE='<base a href="../">'
  create_file $f ${L}/$f
done # break endless loop by pressing Ctrl-C

cd - > /dev/null
You might
- translate line 30 (Translated from the <a href="$from">English Original</a>) to your language....
- change style
EDIT
- override an already translated file Crying or Very sad
Back to top
View user's profile Send private message 
jamesbond

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

PostPosted: Mon 20 Jan 2014, 12:01    Post subject: Re: Internationalization of Fatdog
Subject description: awk issue
 

L18L wrote:
Code:
time populate_all_pkg
does not work.
No, of course not. This is dash we're talking about (bash is more versatile and can do that - dash can only "time" external commands and not internal functions).
Quote:

Therefore just the raw seconds:

AWK_LIB=$(which fatdog-package-manager-library.awk) Arrow 15sec
This is odd - "which" shouldn't take that long. You need to check your system. Anyway, I've hardcoded the location to /usr/sbin rather than doing 'which'.
Quote:
But I do not see any difference in GUI output. Rolling Eyes
You're not supposed to see any difference. Only shorter delays. Which isn't happening too Crying or Very sad
_________________
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 2 of 4 [57 Posts]   Goto page: Previous 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.1189s ][ Queries: 13 (0.0040s) ][ GZIP on ]