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 Tue 22 Aug 2017, 11:20
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
New files 'gettextized' for everyone 2015
Moderators: Lobster, MU, raffy
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 7 [92 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Thu 22 Jan 2015, 06:41    Post subject:  

Packit and Uextract mods.
changed the save path for the files .mo.
now they are normally placed in LC_MESSAGES for beginners translators.
packit.tar.gz
Description 
gz

 Download 
Filename  packit.tar.gz 
Filesize  9.37 KB 
Downloaded  228 Time(s) 
uextract.tar.gz
Description 
gz

 Download 
Filename  uextract.tar.gz 
Filesize  28.31 KB 
Downloaded  221 Time(s) 

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 4654
Location: Ontario

PostPosted: Thu 22 Jan 2015, 21:36    Post subject:  

Here's a tip for people making gettext translations of their script
in many foreign languages .

1) install script in executable place with devx file installed as well

2) install poeditor

3) set your computer to a language you know you haven't a mo file ex. Russian

4) run momanager and tick the poedit box . Find your script. and click create.

5) From menu of poedit , run 'Export' which exports a html file which is mostly
empty but has the English text that needs to be translated.

6) You can copy this text out of html file easily and use Google translate service
to translate into a language you don't know such as Chinese.
This method allows the script creator to localise his script into many languages.
quickly.

One negative I have found is the Arabic language, as clipboard of windows will reverse flow of text.
___________________________________________
Back to top
View user's profile Send private message 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Sat 24 Jan 2015, 06:02    Post subject:  

Hi Don,
Idea is an interesting way, above all for long files, but we must remember to check the translation because google sometimes translates in his own way, not the right one.

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 4654
Location: Ontario

PostPosted: Sat 24 Jan 2015, 14:58    Post subject:  

I noticed that '/n' formatting symbol confuses Google translation service,
so they need to be removed before clicking on 'Translate' button.

Also deleting the dollar sign ($) of a variable value would help the translation
as well.

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


Joined: 10 Mar 2010
Posts: 4654
Location: Ontario

PostPosted: Mon 26 Jan 2015, 16:19    Post subject:  

Also put a period or question mark after every sentence and lay
out the sentences line by line. A button label should take up just one line.

Click the translate button that google supplies
and save the Google page as html. This way you have both
the English and the foreign language side by side.

I found that Arabic is possible although tricky because of reverse flow of text.

\n becomes n\ in Arabic

____________________________________
Back to top
View user's profile Send private message 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Tue 27 Jan 2015, 02:47    Post subject:  

If, after writing many translations, you realize that you have repeatedly done something wrong, you can fix using this script from the terminal.
Create a folder containing all files .po interested, and from terminal write:
Code:
sed -ri '/msgstr\s+"/s/OLDTERM/NEWTERM/' *.po

where OLDTERM is a word to change and NEWTERM is the word to be replaced.
Thanks to an anonymous user who send me this script.
Last thing to create yet, is how to convert many files po2mo in one shot. Someone can suggest a way?

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
L18L

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

PostPosted: Tue 27 Jan 2015, 06:21    Post subject: msgfmt  

xanad wrote:
...how to convert many files po2mo in one shot. Someone can suggest a way?

not convert but format:
Code:
for f in `ls  *.po`; do  msgfmt $f  -o ${f//po/mo}; done
try it because not tested.
Back to top
View user's profile Send private message 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Tue 27 Jan 2015, 08:04    Post subject: Re: msgfmt  

L18L wrote:

not convert but format:
Code:
for f in `ls  *.po`; do  msgfmt $f  -o ${f//po/mo}; done
try it because not tested.


Works fine, thanks L18L Very Happy

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Tue 27 Jan 2015, 09:45    Post subject:  

@L18L,
Cool useful commands, and finally... to reverse many files mo2po?
With these commands would be interesting to make a .pet...

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
L18L

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

PostPosted: Tue 27 Jan 2015, 11:38    Post subject:  

xanad wrote:
useful commands, and finally... to reverse many files mo2po?..

open a consile
type:
Quote:
msg

then preass tab key twice and there you can see useful commands.
Guess (and try command --help) which one is for your question.
Back to top
View user's profile Send private message 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Tue 27 Jan 2015, 11:59    Post subject:  

Wow! This is just a nice tip ..., damn did not know it ... Laughing
Code:
for f in `ls  *.mo`; do  msgunfmt $f  -o ${f//mo/po}; done

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Tue 27 Jan 2015, 13:04    Post subject:  

After unfmt, three files return this answer:
Code:
msgunfmt: file "acpi.mo" is not in GNU .mo format
msgunfmt: file "net-setup.mo" is not in GNU .mo format
msgunfmt: file "refresh-menus.mo" is not in GNU .mo format

The others files are right.

If I use java -p
Code:
read-mo.c:240: message catalog has context dependent translations, but the output format does not support them.
read-mo.c:240: message catalog has plural form translations, but the output format does not support them. Try generating a Java class using "msgfmt --java", instead of a properties file.

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Wed 28 Jan 2015, 08:04    Post subject: Re: msgfmt  

L18L wrote:
xanad wrote:
...how to convert many files po2mo in one shot. Someone can suggest a way?

not convert but format:
Code:
for f in `ls  *.po`; do  msgfmt $f  -o ${f//po/mo}; done
try it because not tested.

ok it works, but also replaces all the characters 'po' with 'mo'.... and vice versa.
ex .: 'osmo' becomes 'ospo' and 'momanger' becomes 'pomanager' Shocked

Arrow Solution: adds the dots before the extensions
mo2po
Code:
for f in `ls  *.mo`; do  msgunfmt $f  -o ${f//.mo/.po}; done


po2mo
Code:
for f in `ls  *.po`; do  msgfmt $f  -o ${f//.po/.mo}; done

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
xanad


Joined: 28 Feb 2014
Posts: 400
Location: 2 locations: MonteRosa Alp and Milano

PostPosted: Fri 30 Jan 2015, 03:40    Post subject:  

Further changes to strengthen the code (from an italian user):

mo2po:
Code:
for f in *.mo; do msgunfmt "$f" -o "${f%.mo}.po"; done


po2mo:
Code:
for f in *.po; do msgfmt "$f" -o "${f%.po).mo"; done


First very, very simple example for a gtk-gui:
mo2po

-Create a folder with the files .mo to be converted to .po
-Place inside the folder the file mo2po
-Click ok button
-If launched directly from geany, you will also have the reports of possible errors creating .mo files.
mo2po.tar.gz
Description 
gz

 Download 
Filename  mo2po.tar.gz 
Filesize  415 Bytes 
Downloaded  212 Time(s) 

_________________
www.xanad.tk Html5 Parallax
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 4654
Location: Ontario

PostPosted: Sat 31 Jan 2015, 13:45    Post subject:  

I've finished puppy units 2.1
- added more languages - now Italian , French ,Spanish , German

____________________________________________________

I used Google translation service

Tips ----> remove \n and add lots of punctuation. Space out the
sentences line by line. Then save the Google translation page
to a HTML file to be opened up later.

________________________________________
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 7 [92 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 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.0858s ][ Queries: 14 (0.0124s) ][ GZIP on ]