New files 'gettextized' for everyone 2015
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
Packit and Uextract mods.
changed the save path for the files .mo.
now they are normally placed in LC_MESSAGES for beginners translators.
changed the save path for the files .mo.
now they are normally placed in LC_MESSAGES for beginners translators.
- Attachments
-
- uextract.tar.gz
- (28.31 KiB) Downloaded 641 times
-
- packit.tar.gz
- (9.37 KiB) Downloaded 618 times
[url]http://www.xanad.tk[/url] Html5 Parallax
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.
___________________________________________
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.
___________________________________________
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
____________________________________
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
____________________________________
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
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:
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?
Create a folder containing all files .po interested, and from terminal write:
Code: Select all
sed -ri '/msgstr\s+"/s/OLDTERM/NEWTERM/' *.po
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?
[url]http://www.xanad.tk[/url] Html5 Parallax
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
msgfmt
not convert but format:xanad wrote:...how to convert many files po2mo in one shot. Someone can suggest a way?
Code: Select all
for f in `ls *.po`; do msgfmt $f -o ${f//po/mo}; done
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
Re: msgfmt
Works fine, thanks L18LL18L wrote: not convert but format:try it because not tested.Code: Select all
for f in `ls *.po`; do msgfmt $f -o ${f//po/mo}; done
[url]http://www.xanad.tk[/url] Html5 Parallax
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
Wow! This is just a nice tip ..., damn did not know it ...
Code: Select all
for f in `ls *.mo`; do msgunfmt $f -o ${f//mo/po}; done
[url]http://www.xanad.tk[/url] Html5 Parallax
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
After unfmt, three files return this answer:
The others files are right.
If I use java -p
Code: Select all
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
If I use java -p
Code: Select all
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.
[url]http://www.xanad.tk[/url] Html5 Parallax
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
Re: msgfmt
ok it works, but also replaces all the characters 'po' with 'mo'.... and vice versa.L18L wrote:not convert but format:xanad wrote:...how to convert many files po2mo in one shot. Someone can suggest a way?try it because not tested.Code: Select all
for f in `ls *.po`; do msgfmt $f -o ${f//po/mo}; done
ex .: 'osmo' becomes 'ospo' and 'momanger' becomes 'pomanager'
Solution: adds the dots before the extensions
mo2po
Code: Select all
for f in `ls *.mo`; do msgunfmt $f -o ${f//.mo/.po}; done
Code: Select all
for f in `ls *.po`; do msgfmt $f -o ${f//.po/.mo}; done
[url]http://www.xanad.tk[/url] Html5 Parallax
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
Further changes to strengthen the code (from an italian user):
mo2po:
po2mo:
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:
Code: Select all
for f in *.mo; do msgunfmt "$f" -o "${f%.mo}.po"; done
Code: Select all
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.
- Attachments
-
- mo2po.tar.gz
- (415 Bytes) Downloaded 613 times
[url]http://www.xanad.tk[/url] Html5 Parallax
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.
________________________________________
- 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.
________________________________________
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
Warning, do not rely on automatic translations, very often they are wrong. They should always be checked by a native speaker.don570 wrote: I used Google translation service
Example:
from
Code: Select all
msgid "22) The volume of a pyramid:"
msgstr "22) Volume di un pyramido:"
Code: Select all
msgid "22) The volume of a pyramid:"
msgstr "22) Volume di una piramide:"
[url]http://www.xanad.tk[/url] Html5 Parallax
- xanad
- Posts: 400
- Joined: Fri 28 Feb 2014, 14:56
- Location: 2 locations: MonteRosa Alp and Milano
- Contact:
New file again... edit export
acpi_poweroff.sh
acpi_poweroff.sh
- Attachments
-
- acpi_poweroff.sh.tar.gz
- (2.62 KiB) Downloaded 604 times
[url]http://www.xanad.tk[/url] Html5 Parallax
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonsoir,
Silly question: Why keeping the file named "demo.mo" instead of doing things to get something like "psip.mo"? Isn't it a bit confusing?
Thanks
Cordialement.
The link goes to a page that gives the list of the source files, but how to download the whole directory?robwoj44 wrote:I gettextized psip32.
1. Download the source from https://chiselapp.com/user/jamesbond/re ... dir?ci=tip
Silly question: Why keeping the file named "demo.mo" instead of doing things to get something like "psip.mo"? Isn't it a bit confusing?
Thanks
Cordialement.
I do not know how to download the whole directory, but it is not necessary.The link goes to a page that gives the list of the source files, but how to download the whole directory?
Silly question: Why keeping the file named "demo.mo" instead of doing things to get something like "psip.mo"? Isn't it a bit confusing?
You can use standard psip which is in puppy. Download psip.pot from http://www.murga-linux.com/puppy/viewto ... h&id=83189. Translate, make demo.mo because the orginal psip looks for demo.mo as translated file.
I'm agree that it is confusing, but in the orginal source code there is 'textdomain ("demo")'. Of course you can download and recompile psip with 'textdomain ("psip")'.