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 Sat 22 Nov 2014, 10:49
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Question about gettext! [SOLVED]
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [38 Posts]   Goto page: 1, 2, 3 Next
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 1846
Location: PORT-BRILLET (Mayenne - France)

PostPosted: 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 Crying or Very sad .
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
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2276

PostPosted: 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
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1846
Location: PORT-BRILLET (Mayenne - France)

PostPosted: 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 Embarassed

Thank you for your attention.

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1846
Location: PORT-BRILLET (Mayenne - France)

PostPosted: 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 Confused
Where do I copy the mo and po files (generated with poeditor).

Regards.

_________________

Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2276

PostPosted: 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
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1846
Location: PORT-BRILLET (Mayenne - France)

PostPosted: 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
View user's profile Send private message Visit poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2574
Location: Moved from Hosla to www.eussenheim.de

PostPosted: 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 Smile
retrovol_german.png
 Description   "Volume" translated to "Lautstärke"
 Filesize   2.62 KB
 Viewed   567 Time(s)

retrovol_german.png

Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: 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

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1846
Location: PORT-BRILLET (Mayenne - France)

PostPosted: 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
Very Happy 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
View user's profile Send private message Visit poster's website 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: 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? Confused

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2574
Location: Moved from Hosla to www.eussenheim.de

PostPosted: 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
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2574
Location: Moved from Hosla to www.eussenheim.de

PostPosted: 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
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: 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. Wink

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? Laughing

---

Nice to be corrected, but nicer to get answered - because of knowledge. Wink

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2574
Location: Moved from Hosla to www.eussenheim.de

PostPosted: 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 Very Happy

(Before I had used just configure without option)
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2574
Location: Moved from Hosla to www.eussenheim.de

PostPosted: 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? Laughing

---

Nice to be corrected, but nicer to get answered - because of knowledge. Wink


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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [38 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0891s ][ Queries: 12 (0.0041s) ][ GZIP on ]