| Author |
Message |
Argolance

Joined: 06 Jan 2008 Posts: 1407 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Thu 19 Jan 2012, 08:27 Post subject:
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.
_________________

Last edited by Argolance on Sat 28 Jan 2012, 14:24; edited 3 times in total
|
|
Back to top
|
|
 |
amigo
Joined: 02 Apr 2007 Posts: 1776
|
Posted: Thu 19 Jan 2012, 13:18 Post subject:
|
|
YOu need to add your translations to the sources and re-generate the po/mo files to have them available into the binary.
|
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 1407 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Thu 19 Jan 2012, 13:32 Post subject:
|
|
Hello amigo,
Thank you a lot for replying | Quote: | | YOu need to add your translations to the sources... | What do you exactly mean, please? I already tried to copy my translation files (po and mo) inside the po directory. Sorry but I need a bit more explanation
Thank you for your attention.
Cordialement.
_________________

|
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 1407 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Thu 19 Jan 2012, 14:26 Post subject:
|
|
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: | Quote: | | ./configure --with-included-gettext |
| Quote: | configure: WARNING: unrecognized options: --with-included-gettext
| ... as result in console
Where do I copy the mo and po files (generated with poeditor).
Regards.
_________________

|
|
Back to top
|
|
 |
amigo
Joined: 02 Apr 2007 Posts: 1776
|
Posted: Fri 20 Jan 2012, 02:15 Post subject:
|
|
They go wherever the other po files are, but the Makefiles must be altered to add them to the mix.
|
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 1407 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Fri 20 Jan 2012, 06:57 Post subject:
|
|
Hello,
How do I call these po and mo files: fr.po and fr.mo or retrovol.po and retrovol.mo? Perhaps is it wrong names which make the compilation missing them?
Regards.
_________________

|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 1802 Location: Burghaslach, Germany
|
Posted: Sat 21 Jan 2012, 08:49 Post subject:
Re: Question about gettext! Subject description: unusual TEXTDOMAINDIR |
|
| Argolance wrote: | | ... retrovol.mo that I copied into /usr/share/locale/fr/LC_MESSAGES/ but nothing happens... |
I have copied into /usr/local/share/locale/fr/LC_MESSAGES/ and it works!
I think this TEXTDOMAINDIR /usr/local/share/locale is set in the configuration.
Happy New Year
| Description |
"Volume" translated to "Lautstärke" |
| Filesize |
2.62 KB |
| Viewed |
475 Time(s) |

|
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Sat 21 Jan 2012, 08:59 Post subject:
Question about gettext! Subject description: How to use in own created applications? |
|
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
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 1407 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Sat 21 Jan 2012, 11:02 Post subject:
|
|
Hello,
@RSH
| Quote: | | 1. Some of the .mo files are empty, if i open them to edit - while others opens as they should. | 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.
@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.
_________________

|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Sat 21 Jan 2012, 13:18 Post subject:
|
|
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?
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 1802 Location: Burghaslach, Germany
|
Posted: Sat 21 Jan 2012, 13:30 Post subject:
Question about gettext! Subject description: TEXTDOMAINDIR |
|
| 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?... |
I agree, that would be better for Pizzasgood´s pet.
|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 1802 Location: Burghaslach, Germany
|
Posted: Sat 21 Jan 2012, 13:38 Post subject:
|
|
| RSH wrote: |
L18L told me, it is necessary to load the devx to edit .mo files, because of msgunfmt inside the devx.
|
.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.
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
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Sat 21 Jan 2012, 14:00 Post subject:
|
|
| 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. |
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: | | 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. |
These files do not have empty msgstr's. They have nothing! No text, 0 bytes!
As i have had written before: The msgunfmt sends an error message of: unknown format.
However, this gives no answer to my questions!
| 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?
|
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: | How do you open and edit these "error"-files?
What else is needed instead of msgunfmt? |
It only gives more questions:
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.
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 1802 Location: Burghaslach, Germany
|
Posted: Sat 21 Jan 2012, 15:12 Post subject:
Re: Question about gettext! Subject description: TEXTDOMAINDIR |
|
| L18L wrote: | | 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?... |
I agree, that would be better for Pizzasgood´s pet. |
I have to correct myself now.
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: | | ./configure --prefix=/usr |
And localization is working
(Before I had used just configure without option)
|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 1802 Location: Burghaslach, Germany
|
Posted: Sat 21 Jan 2012, 16:11 Post subject:
|
|
| RSH wrote: | ...
| 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. |
These files do not have empty msgstr's. They have nothing! No text, 0 bytes!
As i have had written before: The msgunfmt sends an error message of: unknown format.
However, this gives no answer to my questions!
| 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?
|
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: | How do you open and edit these "error"-files?
What else is needed instead of msgunfmt? |
It only gives more questions:
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.  |
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.
Are you talking about retrovol 0.11?
These files, do they have a name?
|
|
Back to top
|
|
 |
|