Author |
Message |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Wed 12 Jun 2013, 14:44 Post subject:
How to localize Manna?SOLVED |
|
Hello Everyone,
This area is new for me, but before I continue with my Manna-Reader and Manna OS I would like to have the reader and the individual books that I made be able to be read in other languages.
I have no idea on how to use gettext so if someone could help me with this it would be appreciated.
the Manna-Reader is here http://www.murga-linux.com/puppy/viewtopic.php?t=84566
Manna OS is here http://www.murga-linux.com/puppy/viewtopic.php?t=86106
Thanks
Last edited by oldyeller on Mon 17 Jun 2013, 04:40; edited 1 time in total
|
Back to top
|
|
 |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Thu 13 Jun 2013, 16:03 Post subject:
|
|
Hello Everyone,
I have been trying to localize Manna Editor. This is what I have got so far
Code: |
export MAIN_DIALOG='
<window title="'$(gettext "Manna Editor")'" icon-name="Com" resizable="false">
<frame>
<vbox spacing="0">
<menubar>
<menu use-underline="true">
<menuitem stock-id="gtk-new">
<action>launch:ADD_FILE</action>
</menuitem>
<menuitem stock-id="gtk-save">
<action>Save:EDITOR</action>
<action>Save:Saving</action>
<action>refresh:EDITOR</action>
</menuitem>
<menuitem stock-id="gtk-refresh">
<action>refresh:EDITOR</action>
</menuitem>
<menuitem stock-id="gtk-delete">
<action>launch:DEL_FILE</action>
</menuitem>
<menuitem stock-id="gtk-quit">
<action>exit:Quit</action>
</menuitem>
<label>"_File"</label>
</menu>
<menu label="'$(gettext "Edit")'">
<menuitem stock-id="gtk-edit" label="'$(gettext "Send to Abiword")'">
<action>abiword '"$TMPDIR"'/notes &</action>
</menuitem>
</menu>
<menu label="'$(gettext "View")'" tooltip-text="'$(gettext " Change font size ")'">
<menuitem '$FONTSIZE12_ICON' label="12">
<action>echo "12" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
<menuitem '$FONTSIZE14_ICON' label="14">
<action>echo "14" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
<menuitem '$FONTSIZE16_ICON' label="16">
<action>echo "16" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
<menuitem '$FONTSIZE18_ICON' label="18">
<action>echo "18" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
</menu>
<menu label="'$(gettext "Help")'" >
<menuitem stock-id="gtk-info" label="'$(gettext "Help")'">
<action>defaultbrowser '$WORKDIR'/editor-docs/MannaEditorHelp.html &</action>
</menuitem>
<menuitem stock-id="gtk-info" label="'$(gettext "About")'">
<action>/tmp/Editor-help &</action>
</menuitem>
</menu>
</menubar>
</vbox> |
I do have the German lang pack installed and the only thing that gets changed is the submenus under File in the menubar.
What else am I missing for the rest of the menu to change?
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3450 Location: www.eussenheim.de/
|
Posted: Fri 14 Jun 2013, 06:10 Post subject:
|
|
oldyeller wrote: | I do have the German lang pack installed and the only thing that gets changed is the submenus under File in the menubar. | These are in German because they are coded as gtk stock items
Code: | <menuitem stock-id="gtk-new"><action>launch:ADD_FILE</action></menuitem> |
Example "New" and others see:
https://developer.gnome.org/gtk2/2.24/gtk2-Stock-Items.html#GTK-STOCK-NEW:CAPS
oldyeller wrote: | What else am I missing for the rest of the menu to change? | You mean the "gettexted" items?
I have copied your script (named manna_editor) to /root/my-applications/bin/ (thus momanager can find it) and edited some lines.
My /root/my-applications-bin/manna_editor: Code: | #!/bin/sh
#130617 i18n started
export TEXTDOMAIN=manna_editor
export OUTPUT_CHARSET=UTF-8
export MAIN_DIALOG='
<window title="'$(gettext "Manna Editor")'" icon-name="Com" resizable="false">
<frame>
<vbox spacing="0">
<menubar>
<menu use-underline="true" label="'$(gettext "_File")'">
<menuitem stock-id="gtk-new"><action>launch:ADD_FILE</action></menuitem>
<menuitem stock-id="gtk-save"><action>Save:EDITOR</action>
<action>Save:Saving</action>
<action>refresh:EDITOR</action>
</menuitem>
<menuitem stock-id="gtk-refresh"><action>refresh:EDITOR</action></menuitem>
<menuitem stock-id="gtk-delete"><action>launch:DEL_FILE</action></menuitem>
<menuitem stock-id="gtk-quit"><action>exit:Quit</action></menuitem>
</menu>
<menu use-underline="true" label="'$(gettext "_Edit")'">
<menuitem stock-id="gtk-edit" label="'$(gettext "Send to Abiword")'"><action>abiword '"$TMPDIR"'/notes &</action></menuitem>
</menu>
<menu use-underline="true" label="'$(gettext "_View")'" tooltip-text="'$(gettext " Change font size ")'">
<menuitem '$FONTSIZE12_ICON' label="12">
<action>echo "12" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
<menuitem '$FONTSIZE14_ICON' label="14">
<action>echo "14" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
<menuitem '$FONTSIZE16_ICON' label="16">
<action>echo "16" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
<menuitem '$FONTSIZE18_ICON' label="18">
<action>echo "18" > '$WORKDIR'/font_size</action>
<action>'$WORKDIR'/Editor &</action>
<action type="exit">quit_now</action>
</menuitem>
</menu>
<menu use-underline="true" label="'$(gettext "_Help")'" >
<menuitem stock-id="gtk-help">
<action>defaultbrowser '$WORKDIR'/editor-docs/MannaEditorHelp.html &</action>
</menuitem>
<menuitem stock-id="gtk-about" >
<action>/tmp/Editor-help &</action>
</menuitem>
</menu>
</menubar>
</vbox>
</frame>
</window>'
MM1RET="`gtkdialog --program=MAIN_DIALOG`"
|
Hope that helps
Description |
before |
Filesize |
8.58 KB |
Viewed |
301 Time(s) |

|
Description |
momanager |
Filesize |
8.93 KB |
Viewed |
276 Time(s) |

|
Description |
Menu translated using momanager |
Filesize |
7.18 KB |
Viewed |
286 Time(s) |

|
|
Back to top
|
|
 |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Fri 14 Jun 2013, 14:13 Post subject:
|
|
Hi L18L,
Thanks now when I do the full script for Manna Editor and with MoManager will others be able to use with their language packs?
My Manna-Reader has a lot of input files how would one do those;
here is all the code for Manna-Reader. I don't want you or any one else to do this, just give me hand to get started.
Thanks
Description |
|

Download |
Filename |
Manna-Reader.gz |
Filesize |
99.76 KB |
Downloaded |
409 Time(s) |
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3450 Location: www.eussenheim.de/
|
Posted: Fri 14 Jun 2013, 15:01 Post subject:
|
|
Hi oldyeller
Here is how your does not run:
Code: | # ./Manna-Reader
cat: /usr/local/Manna/font_size: Datei oder Verzeichnis nicht gefunden
./Manna-Reader: line 52: /usr/local/Manna/font_size: Datei oder Verzeichnis nicht gefunden
./Manna-Reader: line 59: /usr/local/Manna/gtkrc_size: Datei oder Verzeichnis nicht gefunden
cat: /usr/local/Manna/current-book: Datei oder Verzeichnis nicht gefunden
./Manna-Reader: line 149: /usr/local/Manna/current-book: Datei oder Verzeichnis nicht gefunden
cat: /usr/local/Manna/current-chapter: Datei oder Verzeichnis nicht gefunden
cat: /usr/local/Manna/chapter-selection: Datei oder Verzeichnis nicht gefunden
** (gtkdialog:3676): ERROR **: gtkdialog: Error in line 994, near token '</vbox>': syntax error
./Manna-Reader: line 1753: 3676 Trace/Breakpoint ausgelöst $GTKDIALOG --center --program=MAIN_DIALOG
# |
Maybe it runs when the files in /usr/local exist?
Continue to use gettext
example:
change
TITLE="Book of Genesis"
to
TITLE="$(gettext 'Book of Genesis')"
and always make sure that the code can run.
That's all for now.
|
Back to top
|
|
 |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Fri 14 Jun 2013, 15:17 Post subject:
|
|
Hi L18L,
Look at the first post it has link to the Manna-Reader.
Will keep working on it Thanks
|
Back to top
|
|
 |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Fri 14 Jun 2013, 21:31 Post subject:
|
|
Hi L18L,
Manna Editor is done, now the fun starts on Manna-Reader.
How good is Google Translate?
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3450 Location: www.eussenheim.de/
|
Posted: Sun 16 Jun 2013, 07:48 Post subject:
|
|
oldyeller wrote: | Manna Editor is done, now the fun starts on Manna-Reader. | Usually the first translator will find something that has to be changed in the code...
So feel free to publish (or PM).
oldyeller wrote: | How good is Google Translate? | Just 1 comment:
http://www.murga-linux.com/puppy/viewtopic.php?t=73440&start=47
|
Back to top
|
|
 |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Sun 16 Jun 2013, 11:46 Post subject:
|
|
L18L wrote: | oldyeller wrote: | Manna Editor is done, now the fun starts on Manna-Reader. | Usually the first translator will find something that has to be changed in the code...
So feel free to publish (or PM).
oldyeller wrote: | How good is Google Translate? | Just 1 comment:
http://www.murga-linux.com/puppy/viewtopic.php?t=73440&start=47  |
I will be doing a few more languages for the Editor before uploading and posting a new pet. Will PM all language maintainers when I am done.
I can only use google translator or (m$ which I really don't want to use)
Unless there is another one out there?
Cheers
|
Back to top
|
|
 |
|