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 Thu 18 Sep 2014, 10:04
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
MoManager tips for gettext translations
Moderators: Lobster, MU, raffy
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [19 Posts]   Goto page: Previous 1, 2
Author Message
don570


Joined: 10 Mar 2010
Posts: 3287
Location: Ontario

PostPosted: Mon 06 May 2013, 13:06    Post subject:  

Quote:
Your white space between Pmusic and Playlist is not ASCII.



I did a lot of copying of text using the clipboard, since this reduced the
number of spelling mistakes and speeded up the process of writing the script.

Maybe Zigbert put in whitespace with hard spaces(the alt key).
This is something I would never do.

When I typed out the 'Add to pmusic playlist' menu item it solved the
problem.

Fortunately the US-keyboard layout does a good job at showing
the characters that programmers use.


______________________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3287
Location: Ontario

PostPosted: Tue 06 Aug 2013, 12:35    Post subject:  

I did French and German translation of puppy-rsync

I found that using poedit would result in an error message,
but momanager would still create the various translation files (pot,po,mo)

However whenever I tried to launch poedit again I would get errors
reported. I discovered an interesting line in the po file indicating that
ASCII was the text format used which was obviously wrong.

My method to fix was following

1) use momanager and launch translation with geany rather than poedit
2)geany opens the script for tranlation. Using clipboard
I transfer previous translations made in poedit to geany.
I make a change of the following line to UTF-8

Code:
"Content-Type: text/plain; charset=UTF-8\n"


3) Save and quit geany. There is message that says that mo file
is created. When I check this mo file has few or no flaws in it Laughing
so it is useful.


Here is the beginning of po file for reference....

Code:

msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-08-06 06:59-0400\n"
"PO-Revision-Date: 2013-08-06 06:19-0400\n"
"Last-Translator: root <don570@hotmail.com>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"


_______________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3287
Location: Ontario

PostPosted: Thu 29 Aug 2013, 16:12    Post subject:  

I was converting several scripts from the old fashioned Zigbert's method
of localization to gettext locallization and I found that the only way I
could make the scripts work properly was to put 'set -a' near beginning of
script. This allows the variable values to be sent to functions??

I found in the script baconrecorder that set -a had to be written before
the gettext.sh script is loaded like this...

Code:

set -a
. gettext.sh


I don't know why but that is the order required.

__________________________


Another tip ---> Be sure that all non- ascii characters are removed from script.

You can test the script you've written with this command . Of course
devx file must be loaded to execute this command.

Code:
xgettext -L shell some_script.sh -o -


__________________________________________

Another tip---> When using eval_gettext --->
Don't forget to put three slashes in front of dollar sign which represents
the contents of a variable.

Code:
`eval_gettext \"Bacon Recorder \\\$VERSION\"; echo`


__________________________________________

Another tip: Don't confuse the dollar sign when it's being used
as the contents of a variable with the results of a command.

In that case the three slashes doesn't work (apparently)

For an example ---> the result of a date command ---> $( date )
must be loaded into another variable ----> TIME_START

Code:

TIME_START="$( date )"
...
...
echo "`eval_gettext \"The recording started at \\\$TIME_START\"; echo`"    >>  $WORKDIR/log


Then that new variable can be treated as standard variable containing
data i.e. a string, so I now put three slashes in front of dollar sign.




_________________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3287
Location: Ontario

PostPosted: Sat 31 Aug 2013, 14:19    Post subject:  

Another tip :

If you accidentally make a mo file for de_CH rather than de locale,
it's easy to make the change. Just drag mo file over to the
equivalent mo folder i.e. /usr/share/locale/de/LC_MESSAGES/
Then launch momanager and choose the script again --->

It will read 'de' beside the script name rather than de_CH

Do a 'Save' then 'Quit' in poeditor and the corrected mo file will be created
(including in /root/ and /tmp/)

_________________________________________
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [19 Posts]   Goto page: Previous 1, 2
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.0600s ][ Queries: 12 (0.0049s) ][ GZIP on ]