How to localize Manna?SOLVED
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
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, 08:40, edited 1 time in total.
Hello Everyone,
I have been trying to localize Manna Editor. This is what I have got so far
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?
I have been trying to localize Manna Editor. This is what I have got so far
Code: Select all
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>
What else am I missing for the rest of the menu to change?
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
These are in German because they are coded as gtk stock itemsoldyeller wrote:I do have the German lang pack installed and the only thing that gets changed is the submenus under File in the menubar.
Code: Select all
<menuitem stock-id="gtk-new"><action>launch:ADD_FILE</action></menuitem>
https://developer.gnome.org/gtk2/2.24/g ... K-NEW:CAPS
You mean the "gettexted" items?oldyeller wrote:What else am I missing for the rest of the menu to change?
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: Select all
#!/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`"
- Attachments
-
- manna1.png
- before
- (8.58 KiB) Downloaded 301 times
-
- create_manna_editor.mo.png
- momanager
- (8.93 KiB) Downloaded 276 times
-
- manna_de.png
- Menu translated using momanager
- (7.18 KiB) Downloaded 286 times
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
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
- Attachments
-
- Manna-Reader.gz
- (99.76 KiB) Downloaded 454 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Hi oldyeller
Here is how your does not run:
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.
Here is how your does not run:
Code: Select all
# ./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
#
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.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Usually the first translator will find something that has to be changed in the code...oldyeller wrote:Manna Editor is done, now the fun starts on Manna-Reader.
So feel free to publish (or PM).
Just 1 comment:oldyeller wrote:How good is Google Translate?
http://www.murga-linux.com/puppy/viewto ... 0&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.L18L wrote:Usually the first translator will find something that has to be changed in the code...oldyeller wrote:Manna Editor is done, now the fun starts on Manna-Reader.
So feel free to publish (or PM).Just 1 comment:oldyeller wrote:How good is Google Translate?
http://www.murga-linux.com/puppy/viewto ... 0&start=47
I can only use google translator or (m$ which I really don't want to use)
Unless there is another one out there?
Cheers