Translating Visopsys OS

General discussion about Visopsys.
Post Reply
fosforito

Translating Visopsys OS

Post by fosforito »

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:
User avatar
andymc
Posts: 590
Joined: Tue Nov 16, 2010 7:20 pm

Re: Translating Visopsys OS

Post by andymc »

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 2634 times
fosforito

Re: Translating Visopsys OS

Post by fosforito »

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
User avatar
andymc
Posts: 590
Joined: Tue Nov 16, 2010 7:20 pm

Re: Translating Visopsys OS

Post by andymc »

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: Select all

#: 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:
User avatar
andymc
Posts: 590
Joined: Tue Nov 16, 2010 7:20 pm

Re: Translating Visopsys OS

Post by andymc »

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
User avatar
andymc
Posts: 590
Joined: Tue Nov 16, 2010 7:20 pm

Re: Translating Visopsys OS

Post by andymc »

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.
fosforito

Re: Translating Visopsys OS

Post by fosforito »

Ok. Thank you. I'll do it over the weekend. :D
User avatar
espectalll123
Posts: 54
Joined: Tue Jan 25, 2011 7:58 pm
Location: Toledo, Spain
Contact:

Re: Translating Visopsys OS

Post by espectalll123 »

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!
fosforito

Re: Translating Visopsys OS

Post by fosforito »

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
User avatar
ap0r
Posts: 105
Joined: Tue Feb 14, 2012 12:40 am

Re: Translating Visopsys OS

Post by ap0r »

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
Post Reply