visopsys.org

Visopsys Forums
It is currently Wed Sep 20, 2017 1:30 am

All times are UTC




Post new topic Reply to topic  [ 133 posts ]  Go to page 1, 2, 3, 4, 5 ... 14  Next
Author Message
 Post subject: Translating Visopsys OS
PostPosted: Sun Oct 27, 2013 12:12 am 
Offline
User avatar

Joined: Mon Sep 09, 2013 12:16 am
Posts: 58
Location: Paraguay
Hello!

I want to help translating Visopsys to german and spanish language.
What have I to do? And how have I to do it?

Greetings,

Jens W.

:violin:

_________________
My Homepage: http://www.fosforito.net/ :)


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Mon Oct 28, 2013 8:14 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 459
Hi Jens,

That would be great :mrgreen:

I have (unreleased, attached) German translations for a bunch of stuff. If you could enhance or extend this, or add stuff for other languages, that would be great.

Are you familiar with GNU gettext? https://www.gnu.org/software/gettext/ma ... ttext.html

I use this set of programs to generate its message files (*.po) from the source code, and compile them into binaries (*.pot) on my Linux dev system. There's a script utils/makemsgs.sh that helps to automate the process.

If you look at a simple program such as src/programs/cmdwin.c, you can see how I mark the strings that need to be translated in the source code, with a macro _(...) which at compile time gets turned into gettext() calls.

Then, when Visopsys is running, it uses gettext() in 'libintl' to return the correct messages for the given language.

Let me know if you need more info about how all of this works...
Andy


Attachments:
german.tar.gz [19.97 KiB]
Downloaded 575 times
Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Tue Oct 29, 2013 9:24 am 
Offline
User avatar

Joined: Mon Sep 09, 2013 12:16 am
Posts: 58
Location: Paraguay
Hi!

I readed some capiteles of the "gnu-gettext-documentation-bible" but I don't understand how exactly have I to generate the .po files from the source code. Is there a way to generate one time ALL .po files?

If I understood right, I have to rename the .po files to .pot files and after translating everything, I have to compile that .pot files to .mo files. Right? And the compiled files have I to put with the .po files in a same directory named "es", "de", etc?

Another question - sorry... - how I install gettext and is this everything I need?
sudo apt-get install gettext
And maybe
sudo apt-get poedit
?

Ok. Enough questions for now...
I never translated with gettext but I am interested to learn. :D

Thank you,

Jens

_________________
My Homepage: http://www.fosforito.net/ :)


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Fri Nov 01, 2013 1:39 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 459
fosforito wrote:
I don't understand how exactly have I to generate the .po files from the source code. Is there a way to generate one time ALL .po files?

Sorry! I got it wrong before. It's been a while since I've done this.

fosforito wrote:
If I understood right, I have to rename the .po files to .pot files and after translating everything, I have to compile that .pot files to .mo files. Right? And the compiled files have I to put with the .po files in a same directory named "es", "de", etc?

.pot (PO template) files:

These are generated from the C source using the xgettext command. Using it is a little bit fiddly, and you shouldn't need it unless you're actually changing the strings in the program itself. The .pot files for the programs are already generated, and in the source tree with the corresponding .c file.

.po files:

These are copies of .pot files that you edit for your new language. Wherever the .pot file is, create a subdirectory there named after the 2-letter language code. Put the .po file in the subdirectory named 'de' or 'es' or 'fr', etc., and just add the translation underneath each original English string
Code:
#: cmdwin.c:100
#, c-format
msgid "Unable to load shell\n"
msgstr "Your translation goes here\n"

After that, you would set the BUILDLANG variable to the appropriate 2-letter code, and export it, in the top-level Makefile.include file. Then build the OS. If that variable is set, various makefiles (such as src/programs/Makefile) will invoke the utils/makemsgs.sh script to compile all the .mo files in the applicable language subdirectory, and put them into the corresponding place in the build tree.

fosforito wrote:
Another question - sorry... - how I install gettext and is this everything I need?
sudo apt-get install gettext
And maybe
sudo apt-get poedit

That looks about right to me, assuming the repository has the packages under those names (I haven't used apt for a couple of years) :mrgreen:


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Fri Nov 01, 2013 1:45 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 459
andymc wrote:
The .pot files for the programs are already generated, and in the source tree with the corresponding .c file.

Correction/clarification: a bunch of them are already generated, from when we were doing that original German translation. But not all.

If you wanted to translate other programs, then they'd have to have those macros and calls that you see in (for example) cmdwin.c, and you'd have to run xgettext to generate additional .pot files


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Fri Nov 01, 2013 1:48 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 459
Also, it should be noted that not every string needs to be translated, such as debugging/error messages. In most cases, we'd be fine with just the main strings that the user sees. The other ones, I believe you can just leave them empty and the library will default to using the original English.


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Fri Nov 01, 2013 3:25 pm 
Offline
User avatar

Joined: Mon Sep 09, 2013 12:16 am
Posts: 58
Location: Paraguay
Ok. Thank you. I'll do it over the weekend. :D

_________________
My Homepage: http://www.fosforito.net/ :)


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Mon Nov 04, 2013 4:44 pm 
Offline
User avatar

Joined: Tue Jan 25, 2011 7:58 pm
Posts: 54
Location: Toledo, Spain
Here a Spanish translator! I can work with fosforito, as he's from Bolivia and I'm from Spain, we can do together a standard translation, then he can put it together in BO (or MX or something like that!), and I can do the ES one.

P. S.: Long time no see!

_________________
espectalll123, making dreams work!


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Tue Nov 05, 2013 12:28 pm 
Offline
User avatar

Joined: Mon Sep 09, 2013 12:16 am
Posts: 58
Location: Paraguay
espectalll123 wrote:
Here a Spanish translator! I can work with fosforito, as he's from Bolivia and I'm from Spain, we can do together a standard translation, then he can put it together in BO (or MX or something like that!), and I can do the ES one.

P. S.: Long time no see!


Hello Espectalll,

I'm German and I live in Paraguay - not Bolivia.... :D

Ok. I have now generated all the pot files of the programs directory and I can send you the files who need to be translated into spanish and I will translate the same files into german. ;)

The files attached in Andys post in this topic I already translated to spanish.

In 10 hours I will attach the others here.

Saludos,

Jens Wagner

_________________
My Homepage: http://www.fosforito.net/ :)


Top
 Profile  
 
 Post subject: Re: Translating Visopsys OS
PostPosted: Wed Nov 06, 2013 1:45 am 
Offline
User avatar

Joined: Tue Feb 14, 2012 12:40 am
Posts: 103
Fosforito! Can you split it in half and send me one half for english/spanish translation???

I can help with plain text translation but i don't have Linux to compile the files.

_________________
Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 133 posts ]  Go to page 1, 2, 3, 4, 5 ... 14  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group