visopsys.org
http://visopsys.org/forums/

Translating Visopsys OS
http://visopsys.org/forums/viewtopic.php?f=3&t=199
Page 1 of 14

Author:  fosforito [ Sun Oct 27, 2013 12:12 am ]
Post subject:  Translating Visopsys OS

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:

Author:  andymc [ Mon Oct 28, 2013 8:14 pm ]
Post subject:  Re: Translating Visopsys OS

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 620 times

Author:  fosforito [ Tue Oct 29, 2013 9:24 am ]
Post subject:  Re: Translating Visopsys OS

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

Author:  andymc [ Fri Nov 01, 2013 1:39 am ]
Post subject:  Re: Translating Visopsys OS

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:

Author:  andymc [ Fri Nov 01, 2013 1:45 am ]
Post subject:  Re: Translating Visopsys OS

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

Author:  andymc [ Fri Nov 01, 2013 1:48 am ]
Post subject:  Re: Translating Visopsys OS

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.

Author:  fosforito [ Fri Nov 01, 2013 3:25 pm ]
Post subject:  Re: Translating Visopsys OS

Ok. Thank you. I'll do it over the weekend. :D

Author:  espectalll123 [ Mon Nov 04, 2013 4:44 pm ]
Post subject:  Re: Translating Visopsys OS

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!

Author:  fosforito [ Tue Nov 05, 2013 12:28 pm ]
Post subject:  Re: Translating Visopsys OS

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

Author:  ap0r [ Wed Nov 06, 2013 1:45 am ]
Post subject:  Re: Translating Visopsys OS

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.

Page 1 of 14 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/