Översättning med gettext

(Difference between revisions)
Jump to: navigation, search
(Backup save during translation. ~~~~)
 
(Backup save during translation. ~~~~)
Line 1: Line 1:
==Introduction==
+
==Introduktion==
If you speak a non-english language, please consider contributing to the development of Stellarium! It is quite easy, and thousands of people will have a chance to enjoy your work.
+
Om du talar ett annan språk än engelska får du mer än gärna bidra till Stellariums utveckling genom att översätta programmet! Det är ganska enkelt och tusentals människor kommer att kunna få glädje av ditt arbete.
  
==How to==
+
==Att översätta Stellarium==
From version 0.8.0, Stellarium fully supports translation into other languages. The translation is performed using gettext. All the strings used in the program are translated and saved in special .po files. These .po files can be edited using a text editor or special programs such as Kbabel or POedit.  
+
Från och med version 0.8.0 har Stellarium fullt stöd för översättning till andra språk. Översättningen utförs m.h.a. gettext. Alla strängar som används i programmet översätts och sparas i särskilda PO-filer ([http://www.gnu.org/software/gettext/manual/gettext.html#Files], [http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files]). PO-filerna kan redigeras i ett textredigeringsprogram, t.ex. Notepad++, eller specialprogram såsom Lokalize eller Poedit.  
  
 
Once your .po file is ready, you can compile it into a ".mo" file and test it in the program to check that everything is correct. For example, if you are French and work on "fr.po", save your compiled file "fr.mo" as "stellarium.mo" and copy it into the directory "..../stellarium/data/locale/fr/LC_MESSAGES/".
 
Once your .po file is ready, you can compile it into a ".mo" file and test it in the program to check that everything is correct. For example, if you are French and work on "fr.po", save your compiled file "fr.mo" as "stellarium.mo" and copy it into the directory "..../stellarium/data/locale/fr/LC_MESSAGES/".
Line 18: Line 18:
 
{| cellpadding="8"
 
{| cellpadding="8"
 
| bgcolor=#ff5a00 | '''WARNING'''
 
| bgcolor=#ff5a00 | '''WARNING'''
If you work with an external editor like POedit or Kbabel, don't forget to remain synchronized with the online Rosetta version of your .po file. If not you may destroy the modifcations made by other contributors. To keep in sync, always restart work from the latest online version of the .po file, and always upload your modifications when you stop working on it. If you are not sure, it is safer to work only online in Rosetta.
+
If you work with an external editor like Poedit or Lokalize, don't forget to remain synchronized with the online Rosetta version of your .po file. If not you may destroy the modifcations made by other contributors. To keep in sync, always restart work from the latest online version of the .po file, and always upload your modifications when you stop working on it. If you are not sure, it is safer to work only online in Rosetta.
 
|}
 
|}
  
==Software for translating Stellarium==
+
==Programvara för översättning av Stellarium==
*[http://www.poedit.net/ POedit] po-file editor for Linux and Windows.
+
*[http://www.poedit.net/ Poedit] po-file editor for Linux and Windows.
*[http://kbabel.kde.org/ KBabel] po-file editor for KDE environments
+
*[http://kde.org/applications/development/lokalize/ Lokalize] po-file editor for KDE environments
 +
*[http://notepad-plus-plus.org/ Notepad++] – textredigeringsprogram för i stort sett alla textfilformat
  
==Further reading==
+
==Vidare läsning==
 
*[http://www.gnu.org/software/gettext/ gettext homepage]
 
*[http://www.gnu.org/software/gettext/ gettext homepage]
 
*[https://launchpad.net/rosetta Rosetta homepage]
 
*[https://launchpad.net/rosetta Rosetta homepage]
  
 
[[Category:Development]][[Category:Translation]][[Category:Helping Stellarium]]
 
[[Category:Development]][[Category:Translation]][[Category:Helping Stellarium]]

Revision as of 20:00, 3 April 2013

Contents

Introduktion

Om du talar ett annan språk än engelska får du mer än gärna bidra till Stellariums utveckling genom att översätta programmet! Det är ganska enkelt och tusentals människor kommer att kunna få glädje av ditt arbete.

Att översätta Stellarium

Från och med version 0.8.0 har Stellarium fullt stöd för översättning till andra språk. Översättningen utförs m.h.a. gettext. Alla strängar som används i programmet översätts och sparas i särskilda PO-filer ([1], [2]). PO-filerna kan redigeras i ett textredigeringsprogram, t.ex. Notepad++, eller specialprogram såsom Lokalize eller Poedit.

Once your .po file is ready, you can compile it into a ".mo" file and test it in the program to check that everything is correct. For example, if you are French and work on "fr.po", save your compiled file "fr.mo" as "stellarium.mo" and copy it into the directory "..../stellarium/data/locale/fr/LC_MESSAGES/".

Re-run stellarium, select your language, and there you are!

An easier way (but less efficient) is to use the Rosetta facility which allows to translate Stellarium online, via a website:

WARNING

If you work with an external editor like Poedit or Lokalize, don't forget to remain synchronized with the online Rosetta version of your .po file. If not you may destroy the modifcations made by other contributors. To keep in sync, always restart work from the latest online version of the .po file, and always upload your modifications when you stop working on it. If you are not sure, it is safer to work only online in Rosetta.

Programvara för översättning av Stellarium

  • Poedit – po-file editor for Linux and Windows.
  • Lokalize – po-file editor for KDE environments
  • Notepad++ – textredigeringsprogram för i stort sett alla textfilformat

Vidare läsning

Personal tools
Namespaces
Variants
Actions
in this wiki
other languages
Toolbox