Question about gettext! [SOLVED]
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Question about gettext! [SOLVED]
Hello,
How to make gettext working while compiling an application from source files? => For example
This application (retrovol) is built to generate locales directories when "fr" or any language is specified in ./po/LINGUAS file. I created a po file from pot, then a French mo file called retrovol.mo that I copied into /usr/share/locale/fr/LC_MESSAGES/ but nothing happens .
Something else has to be done, of course... but what?
Thank you for your help.
Cordialement.
How to make gettext working while compiling an application from source files? => For example
This application (retrovol) is built to generate locales directories when "fr" or any language is specified in ./po/LINGUAS file. I created a po file from pot, then a French mo file called retrovol.mo that I copied into /usr/share/locale/fr/LC_MESSAGES/ but nothing happens .
Something else has to be done, of course... but what?
Thank you for your help.
Cordialement.
Last edited by Argolance on Sat 28 Jan 2012, 18:24, edited 3 times in total.
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
I found `ABOUT-NLS' file inside source files directory: I assume that the distributed package of retrovol does use GNU `gettext' internally. So I tried this:
Where do I copy the mo and po files (generated with poeditor).
Regards.
I found `ABOUT-NLS' file inside source files directory: I assume that the distributed package of retrovol does use GNU `gettext' internally. So I tried this:
./configure --with-included-gettext
... as result in consoleconfigure: WARNING: unrecognized options: --with-included-gettext
Where do I copy the mo and po files (generated with poeditor).
Regards.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Question about gettext!
I have copied into /usr/local/share/locale/fr/LC_MESSAGES/ and it works!Argolance wrote:... retrovol.mo that I copied into /usr/share/locale/fr/LC_MESSAGES/ but nothing happens...
I think this TEXTDOMAINDIR /usr/local/share/locale is set in the configuration.
Happy New Year
- Attachments
-
- retrovol_german.png
- "Volume" translated to "Lautstärke"
- (2.62 KiB) Downloaded 633 times
Question about gettext!
I do have another problem - or better two.
1. Some of the .mo files are empty, if i open them to edit - while others opens as they should.
2. What do i have to put into the code to use GETTEXT in my own programs?
RSH
1. Some of the .mo files are empty, if i open them to edit - while others opens as they should.
2. What do i have to put into the code to use GETTEXT in my own programs?
RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
@RSH
@L18L
I will see that when I am back home... Don't you think anyway it should be better the mo files to be copied into /usr/share/locale and if this is configurable, TEXTDOMAINDIR to be modified?
Thank you a lot!
Best regards.
@RSH
They only seem to be empty but are not: this sort of mo files are directly created from po files and cannot be opened and modified through a text editor.1. Some of the .mo files are empty, if i open them to edit - while others opens as they should.
@L18L
I will see that when I am back home... Don't you think anyway it should be better the mo files to be copied into /usr/share/locale and if this is configurable, TEXTDOMAINDIR to be modified?
Thank you a lot!
Best regards.
I do use msgunfmt in the devx.sfs. I use my own GUI to do this. If i am opening such files and running the GUI in the terminal, msgunfmt sends an error message of: unknown format.
Do you mean these files?
L18L told me, it is necessary to load the devx to edit .mo files, because of msgunfmt inside the devx.
How do you open and edit these "error"-files?
What else is needed instead of msgunfmt?
Do you mean these files?
L18L told me, it is necessary to load the devx to edit .mo files, because of msgunfmt inside the devx.
How do you open and edit these "error"-files?
What else is needed instead of msgunfmt?
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Question about gettext!
I agree, that would be better for Pizzasgood´s pet.Argolance wrote:...Don't you think anyway it should be better the mo files to be copied into /usr/share/locale and if this is configurable, TEXTDOMAINDIR to be modified?...
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
.mo files cannot be edited.RSH wrote: L18L told me, it is necessary to load the devx to edit .mo files, because of msgunfmt inside the devx.
msgunfmt converts a .mo file to an editable .po file and
msgfmt can convert a .po file back to a .mo file.
If a .po file contains only empty msgstr´s, that is if no translation was made, then the resulting .mo file is empty of course.
HTH
Thank you for displaying the correct way to edit the files. I did not wrote it correctly, but did mean it like you described. I just tought, this would be clear, because this is really not a "how-to-shoe-shopping" topic.L18L wrote:.mo files cannot be edited.
msgunfmt converts a .mo file to an editable .po file and
msgfmt can convert a .po file back to a .mo file.
These files do not have empty msgstr's. They have nothing! No text, 0 bytes!L18L wrote:If a .po file contains only empty msgstr´s, that is if no translation was made, then the resulting .mo file is empty of course.
As i have had written before: The msgunfmt sends an error message of: unknown format.
However, this gives no answer to my questions!
F.E.: icewm could be translated to german etc using gettext, but how do i tell icewm which .po file to load and read?RSH wrote:1. Some of the .mo files are empty, if i open them to edit - while others opens as they should.
2. What do i have to put into the code to use GETTEXT in my own programs?
It only gives more questions:RSH wrote:How do you open and edit these "error"-files?
What else is needed instead of msgunfmt?
Why are there empty or not yet edited/translated .mo files to some programs?
Did the kb-savers get drunk at that time?
---
Nice to be corrected, but nicer to get answered - because of knowledge.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Question about gettext!
I have to correct myself now.L18L wrote:I agree, that would be better for Pizzasgood´s pet.Argolance wrote:...Don't you think anyway it should be better the mo files to be copied into /usr/share/locale and if this is configurable, TEXTDOMAINDIR to be modified?...
Pizzasgood´s pet is OK.
I have deleted my /usr/local/share/locale/de/retrovol.mo
/usr/share/locale/de/retrovol.mo is still existing.
Configured as adviced by pizzasgood
Code: Select all
./configure --prefix=/usr
(Before I had used just configure without option)
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
I have no idea what you are talking about and so cannot reproduce your problem:RSH wrote:...These files do not have empty msgstr's. They have nothing! No text, 0 bytes!L18L wrote:If a .po file contains only empty msgstr´s, that is if no translation was made, then the resulting .mo file is empty of course.
As i have had written before: The msgunfmt sends an error message of: unknown format.
However, this gives no answer to my questions!
F.E.: icewm could be translated to german etc using gettext, but how do i tell icewm which .po file to load and read?RSH wrote:1. Some of the .mo files are empty, if i open them to edit - while others opens as they should.
2. What do i have to put into the code to use GETTEXT in my own programs?
It only gives more questions:RSH wrote:How do you open and edit these "error"-files?
What else is needed instead of msgunfmt?
Why are there empty or not yet edited/translated .mo files to some programs?
Did the kb-savers get drunk at that time?
---
Nice to be corrected, but nicer to get answered - because of knowledge.
Some of the .mo files are empty, if i open them to edit - while others opens as they should.
Are you talking about retrovol 0.11?
These files, do they have a name?
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Not sure but I think I am understanding what RSH means (??):
If an application is localized with the shinobar's simple script based on MU for example, mo files can be simply created with any text editor and later edited with! These mo files have got the same extension and are copied in the same places but are not of the same sort than those which are directly created to work with gettext from po file. So, inside /usr/share/locale directories, one can find mo files that can be edited, and the others that cannot be and seem to be empty when edited though!
Cordialement.
Not sure but I think I am understanding what RSH means (??):
If an application is localized with the shinobar's simple script based on MU for example, mo files can be simply created with any text editor and later edited with! These mo files have got the same extension and are copied in the same places but are not of the same sort than those which are directly created to work with gettext from po file. So, inside /usr/share/locale directories, one can find mo files that can be edited, and the others that cannot be and seem to be empty when edited though!
Cordialement.
Question about gettext!
What do i have to put into the code to use GETTEXT in my own programs?
http://murga-linux.com/puppy/viewtopic.php?t=73321
You have seen this already - then.
You have seen this already - also then.
---
So, i think it is absolutely clear:
Talking or writing about editing the .mo files does mean: convert the .mo to .po and load the .po into a texteditor (geany, notepad etc.).
Except: you are running human language under the rules of programming languages!
F.E. (to eat some): stand up. leave the room were you are actually in. go to the Out house. open the refrigerator. take what you want. eat.
Or in assemmbler: move your arms. push your body up and get on the feet. move right feet 40cm forward. step down. move left feet...
Mein Gott!
I think you are doing a little bit of HAARSPALTEREI here?
I will search the files and reproduce what i wanted to describe and get a solution for in here. I will make notes and screenshots and come back to this point when it's done.
Thanks
RSH
Edit:
Thank you.
What do i have to put into the code to use GETTEXT in my own programs?
Title: GUI for editing .mo filesL18L wrote:I have no idea what you are talking about and so cannot reproduce your problem:
Some of the .mo files are empty, if i open them to edit - while others opens as they should.
http://murga-linux.com/puppy/viewtopic.php?t=73321
@L18L:RSH wrote:Hello,
i have created a little GUI to edit the .mo files. Drag & drop the .mo file into the textfield at the GUI and the .mo file will be converted to .po file and automatically loaded into geany or leafpad (if geany is not available).
You can get the tool right here. It has got an english GUI and a german GUI.
http://murga-linux.com/puppy/viewtopic. ... 538#581538
I hope, this is a useful tool to you. I have enjoyed to create this little pet.
My best wishes,
RSH
You have seen this already - then.
@L18L:BarryK wrote:RSH,
That is a very useful tool, I will put it into Racy and Wary I reckon (well, I have to try it first!)
You have seen this already - also then.
---
So, i think it is absolutely clear:
Talking or writing about editing the .mo files does mean: convert the .mo to .po and load the .po into a texteditor (geany, notepad etc.).
Except: you are running human language under the rules of programming languages!
F.E. (to eat some): stand up. leave the room were you are actually in. go to the Out house. open the refrigerator. take what you want. eat.
Or in assemmbler: move your arms. push your body up and get on the feet. move right feet 40cm forward. step down. move left feet...
Mein Gott!
I think you are doing a little bit of HAARSPALTEREI here?
I will search the files and reproduce what i wanted to describe and get a solution for in here. I will make notes and screenshots and come back to this point when it's done.
Thanks
RSH
Edit:
Right!Argolance wrote:So, inside /usr/share/locale directories, one can find mo files that can be edited, and the others that cannot be and seem to be empty when edited though!
Thank you.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Thank you L18L: Perfect!
I should say almost perfect: My mo file is taken in account and French words are displayed in the application .
The problem now (problem that I already encountered several times and which made me unfortunately be a bit... wary with gettext because I finally could not solve it and gave up!) The problem now is accentuation... I tried UTF-8, ISO-8859-1... but didn't succeed to get accents.
This time, I would have liked to understand what's going wrong and solve this problem for good!
Cordialement!
Thank you L18L: Perfect!
I should say almost perfect: My mo file is taken in account and French words are displayed in the application .
The problem now (problem that I already encountered several times and which made me unfortunately be a bit... wary with gettext because I finally could not solve it and gave up!) The problem now is accentuation... I tried UTF-8, ISO-8859-1... but didn't succeed to get accents.
This time, I would have liked to understand what's going wrong and solve this problem for good!
Cordialement!
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Cordialement.
End of this little saga: This problem appears only with Puppy/Toutou 4.31 and as long as it was not possible to compile (retrovol in particular and other applications in general) with Wary 5.2.2 (=> BarryK made a pet package to correct this issue, posted on 9 Dec 2011), I could not test and diagnose that my French translation was finally working as well as possible!This time, I would have liked to understand what's going wrong and solve this problem for good!
Cordialement.