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 Wed 20 Aug 2014, 06:53
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
How to localize Manna?SOLVED
Moderators: Lobster, MU, raffy
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

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

Edited_time_total
Back to top
View user's profile Send_private_message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: 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
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: 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 Very Happy
manna1.png
 Description   before
 Filesize   8.58 KB
 Viewed   243 Time(s)

manna1.png

create_manna_editor.mo.png
 Description   momanager
 Filesize   8.93 KB
 Viewed   198 Time(s)

create_manna_editor.mo.png

manna_de.png
 Description   Menu translated using momanager
 Filesize   7.18 KB
 Viewed   215 Time(s)

manna_de.png

Back to top
View user's profile Send_private_message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: 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
Manna-Reader.gz
Description 
gz

 Download 
Filename  Manna-Reader.gz 
Filesize  99.76 KB 
Downloaded  205 Time(s) 
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: 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. Smile
Back to top
View user's profile Send_private_message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: 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
View user's profile Send_private_message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: 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
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: 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 Laughing
Back to top
View user's profile Send_private_message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: 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 Laughing


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

Unless there is another one out there?


Cheers
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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