Author Topic: Translation-relevant info/commands  (Read 7848 times)

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Translation-relevant info/commands
« on: May 15, 2009, 04:43:06 AM »
Maybe we can use this post to collect/update/amend any useful translation-relevant info/hints/tools/tricks, etc. More info on any command listed below can be found from the konsole using 'man <command>' (where <command> can be rpm, msgfmt, etc.) and of course there is also Google...

Assume we look at the application 'synaptic' (the same is true for any other application) and are interested in the locale 'fr' ('fr' being French or in general this is a 2-letter abbreviation like 'de' for German 'it' for Italian, etc., say generically '<yy>').  The language-relevant information inside a rpm-package is contained in the so-called 'mo'-files which are usually stored under /usr/share/locale/<yy>/LC_MESSAGES/.  The mo-files are the compiled version of the editable so-called 'po'-files, so the po-files are the ones where the actual translation takes place.  Once you finished translating the po-file and converted it into a mo-file, this mo-file should be submitted for inclusion into an updated rpm-package for the given application to the PCLOS packagers.


Howto translate/edit po-files
=======================
Use Synaptic to install the application 'poedit', which is a great tool to translate. Under the option 'Catalog' is even an entry to 'automatically translate' but I never tried that. Make sure to look into: Catalog -> Settings -> Project Info tab: you must specify a valid project name and version, otherwise you can not save your translation work. Please also set the other fields, especially 'Charset: iso-8859-15' and 'Source code charset: utf-8'.
 

Howto convert mo- <-> po-files
=========================
 To convert a mo-file to an editable po-file use the command:
Code: [Select]
msgunfmt synaptic.mo -o synaptic.poand to do the reverse, meaning converting a po-file to a mo-file use:
Code: [Select]
msgfmt synaptic.po -o synaptic.mo

Howto list/extract mo-files
=====================
a) from rpm/deb packages
- to see which language files are already available inside a rpm:
Code: [Select]
rpm -qlp <full path to>/synaptic-0.57.2-20pclos2007.i586.rpm |grep synaptic.mo or use the same command without "|grep synaptic.mo" to simply list the content of the rpm archive.
Other useful info can be obtained with
Code: [Select]
rpm -qip <full path to>/synaptic-0.57.2-20pclos2007.i586.rpm
- to extract the files from an archive, copy the archive into a new empty folder, then in the new folder use the command:
Code: [Select]
rpm2cpio synaptic-0.57.2-20pclos2007.i586.rpm | cpio -idmvIn case you find something interesting inside a deb-archive use the command:
Code: [Select]
ar xv <something>.deb
b) - from bash scripts
example from the script 'update-notifier' (replace update-notifier with the name of the script you want to translate), go in your home-directory (command: cd ~) and enter:
Code: [Select]
bash --dump-po-strings /usr/bin/update-notifier | xgettext -L PO -o ~/update-notifier.pot -next enter:
Code: [Select]
msginit -l fr -i ~/update-notifier.pot -o ~/fr.pothis example was for extracting the French language info (fr), change fr to the locale you work on. Additional info: Localizing Bash scripts

Note: you must insert the Dollar-sign ($) in front of each text entry in your bash-script in order to make the 'bash --dump-po-strings' command above recognize such a string for translation, for example:
Code: [Select]
zenity --error --text=$"Please run this script as root.\n\nExiting..."
Edit a po-file: (example for GetOpenOffice)
Open the po-file with poedit, goto Catalog -> Settings, Project info Tab: in the field 'Project name and version' insert: GetOpenOffice 0.6, insert your language and country and under 'Source code charset': utf-8. You must insert these fields or you can not save the edited file!


Localization info on the web
=======================
Translation: mypclinuxos, Ubuntu-Launchpad, firefox-addon, the 'KlipOQuery'-panelapplet can be installed via Synaptic and will transfer clipboard content to the selected translation service.
KDE/Gnome: kde-l10n, gnome-i18n, kde-i18n, KDE-Localization
Locales: Locales, ISO_639

If you know of any other useful tools, applications, links, magical tricks, whatever, then please let us know so we can add this here.
 
hope this helps, good luck,
-pinoc

« Last Edit: July 16, 2009, 08:44:16 AM by pinoc »

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Translation-relevant info/commands
« Reply #1 on: May 15, 2009, 05:58:29 PM »
Hello,

Theses are very important informations as I see them. Could this post be pinned by someone in charge ? :)

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Translation-relevant info/commands
« Reply #2 on: July 09, 2009, 01:36:45 PM »
@ pinoc
Can You it translate in german, please ?


L-de
Kannst Du es bitte ins deutsche Übersetzen ?

Thanks

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Re: Translation-relevant info/commands
« Reply #3 on: July 12, 2009, 03:31:17 AM »
Brief German translation of the initial post...

Hier ein paar Uebersetzungs-relevante Information. Weitere info gibt es auch in der Konsole mit 'man <command>' (<command> kann sein rpm, msgfmt, etc.) und natuerlich auch ueber Google...

Angenommen wir betrachten die Anwendung 'synaptic' (das Gleiche gilt fuer alle anderen Programme) und wir interessieren uns fuer die Lokale 'fr' ('fr' steht fuer Franzoesisch oder allgemein ist dies ein Abkuerzung bestehend aus 2 Buchstaben, zB. 'de' fuer Deutsch, 'it' fuer Italienisch, etc., allgemein '<yy>').  Die Sprach-relevante Info innerhalb eines rpm-Pakets befindet sich in der sogenannten 'mo'-Datei, welche normalerweise in /usr/share/locale/<yy>/LC_MESSAGES/ liegt.  Die mo-Datei ist die kompilierte Version der editierbaren sogenannten 'po'-Datei, also die Uebersetzung findet in der po-Datei statt.  Nachdem die po-Datei uebersetzt und in die mo-Datei konvertiert wurde, sollte diese mo-Datei hier fuer die Paketb^acker zum Einbau in das upzudatende RPM-Paket eingereicht werden.


Uebersetzen/editieren von po-files
=======================

Installiere via Synaptic das Programm 'poedit' zum Uebersetzen. Unter der Option 'Catalog' gibt es sogar einen Eintrag namens 'automatically translate' aber das habe ich noch nicht getestet. Folgendes sicherstellen: Catalog -> Settings -> Project Info tab: hier muss ein gueltiger Projektname und Version eingetragen werden, sonst kann man seine Arbeit nicht speichern. Bitte auch die andere Felder eintragen, insbesondere 'Charset: iso-8859-15' und 'Source code charset: utf-8'.
 

Konvertieren: mo- <-> po-files
========================
=
Kommando zum konvertieren von mo-Datei zu editierbarer po-Datei:
Code: [Select]
msgunfmt synaptic.mo -o synaptic.pound von po-Datei zu mo-Datei:
Code: [Select]
msgfmt synaptic.po -o synaptic.mo

Anzeigen/extrahieren von mo-Dateien
=====================

a) rpm/deb Pakete
- Anzeigen der bereits vorhandenen Sprachdateien:
Code: [Select]
rpm -qlp <full path to>/synaptic-0.57.2-20pclos2007.i586.rpm |grep synaptic.mooder verwende den gleichen Befehl ohne "|grep synaptic.mo" zur Anzeige des RPM-Inhaltes.
Weitere interessante Info kann man erhalten ueber
Code: [Select]
rpm -qip <full path to>/synaptic-0.57.2-20pclos2007.i586.rpm
- Zum Extrahieren der Dateien aus dem Archiv, kopiere zuerst das Archiv in einen neuen leeren Ordner, und gebe dann in diesem Ordner diesen Befehl ein:
Code: [Select]
rpm2cpio synaptic-0.57.2-20pclos2007.i586.rpm | cpio -idmvFuer ein deb-Archiv gilt dieser Befehl:
Code: [Select]
ar xv <something>.deb
b) - bash Scripte
Beispiel aus dem Script 'update-notifier' (update-notifier steht hier stellvertretend fuer das zu uebersetzende Skript), gehe ins home-Verzeichnis (Befehl: cd ~) und gib ein:
Code: [Select]
bash --dump-po-strings /usr/bin/update-notifier | xgettext -L PO -o ~/update-notifier.pot -und dann:
Code: [Select]
msginit -l fr -i ~/update-notifier.pot -o ~/fr.pohier fuer Franzoesisch (fr), zu Ersetzen mit dem gewuenschten Lokalisierungcode. Weitere Info: Lokalisierung von Bash Skripten

Bitte beachten: in Bash-Skripten muss vor jeden Texteintrag ein Dollarzeichen ($) eingesetzt werden damit dieser Text vom obigen 'bash --dump-po-strings' Befehl als Uebersetzungstext erkannt werden kann, zB:
Code: [Select]
zenity --error --text=$"Please run this script as root.\n\nExiting..."
Editieren einer po-Datei: (Beispiel GetOpenOffice)
Die po-Datei mit poedit oeffnen, dann gehe zu Catalog -> Settings, Project info Tab: im Feld 'Project name and version' eintragen: GetOpenOffice 0.6, macht die Eintragungen unter language und country und unter 'Source code charset': utf-8. Diese Felder muessen ausgefuellt werden, wenn nicht, kann man die editierte Datei nicht speichern!

Lokalisierung im Web
======================

Uebersetzung: mypclinuxos, Ubuntu-Launchpad, firefox-addon, das 'KlipOQuery'-Applet kann ueber Synaptic installiert werden und zum Uebersetzen von Clipboard Inhalt genutzt werden.
KDE/Gnome: kde-l10n, gnome-i18n, kde-i18n, KDE-Localization
Locales: Lokalisierung, ISO_639

Bitte weitere nuetzliche Anwendungen, Links, Tricks, etc. hier melden damit diese hier zentral aufgefuehrt werden koennnen.
 
viel Glueck,
-pinoc
« Last Edit: July 16, 2009, 08:47:30 AM by pinoc »

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3739
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Translation-relevant info/commands
« Reply #4 on: July 12, 2009, 03:33:04 AM »
Meister Du bist der Beste  :)

Offline maik3531

  • Moderator
  • Full Member
  • *****
  • Posts: 129
Re: Translation-relevant info/commands
« Reply #5 on: July 12, 2009, 07:28:07 AM »
Quote
Bitte weitere nuetzliche Anwendungen, Links, Tricks, etc. hier melden damit diese hier zentral aufgefuehrt werden koennnen.

https://addons.mozilla.org/de/firefox/addon/5641 (qtl) Quick TransLation
https://addons.mozilla.org/de/firefox/addon/3922 Dictionary EN/DE (dict.tu-chemnitz.de)

MfG. maik3531
Please excuse my English

Offline angel02_de

  • Jr. Member
  • **
  • Posts: 41
Re: Translation-relevant info/commands
« Reply #6 on: July 12, 2009, 09:17:47 AM »
Nachdem ich „poedit“ gestartet habe, wollte ich mal das Paket Armagetron das bei mir installiert ist für eine Probe in eine .po-Datei wandeln, aber wo bekomme ich denn die armagetron.mo-Datei her, eine Suche ergab auf meinem Rechner nichts?
Ich lud mir das rpm-Paket herunter, entpackte es in einen separaten Ordner, aber immer noch keine .mo Datei.
Cu angel02


After started "poedit" I want to change the package Armagetron it's installed on my system, but where I can get from the armagetron.mo file to change in a .po-file? A search matched nothing on my computer?
I download the rpm package, unpack uncompressed it in a separate folder, but still no .mo file.
CU angel02

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Translation-relevant info/commands
« Reply #7 on: July 12, 2009, 09:35:24 AM »
but where I can get from the armagetron.mo file to change in a .po-file ?


Hi, I gave a try to the srpm package, no translation file either. You may want to go see upstream, at the Armagetron forum ?
http://forums3.armagetronad.net/viewforum.php?f=52

PS: as far as german is concerned there are some text files in the 'language' directory. (Under armagetronad-0.2.7.1 directory)

There are 2 other files which allow to understand how it goes. (one containing lines for includes, one "new.txt" as a template for other languages)







« Last Edit: July 12, 2009, 09:40:33 AM by melodie »
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline angel02_de

  • Jr. Member
  • **
  • Posts: 41
Re: Translation-relevant info/commands
« Reply #8 on: July 12, 2009, 10:53:59 AM »
Entschuldige, es geht mir nicht um das Armagetron-Paket im einzelnen.
Mein Bestreben ist das eindeutschen der Synaptic-Paketbeschreibungen, weiß denn jemand, wo die englischen Kurzbeschreibungen genau gespeichert sind und wie sie von Synaptic ausgelesen werden?
Cu angel02

Sorry, it is me not the Armagetron package in detail.
My concern is the localisation of the Synaptic package descriptions, anyone know where the English short descriptions are exactly stored and read by Synaptic for?
Cu angel02

Offline angel02_de

  • Jr. Member
  • **
  • Posts: 41
Re: Translation-relevant info/commands
« Reply #9 on: July 15, 2009, 05:06:18 AM »
Synaptic package descriptions are in the spec files, to locate it for other languages one row for the language area must be specified in the spec file:
%description-l de (for Germany) followed by the description in the language.
Exists a central storage service where translations into other languages are stored so that the package baker can insert this localization?
If not, is it not useful, to set up a place?

Die Paketbeschreibungen von Synaptic liegen in den spec-Dateien, um sie für andere Sprachen zu lokalisieren muß in der spec-Datei eine Zeile für die Sprachregion eingegeben werden:
%description -l de (für Deutschland)
gefolgt von der Beschreibung in der Landessprache.
Existiert denn eine zentrale Ablagestelle, wo die Übersetzungen in anderen Sprachen gespeichert werden, sodaß die Paketbäcker diese Lokalisierung einfügen können?
Falls nicht, wäre es nicht sinnvoll so eine Stelle einzurichten?
Cu angel02

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Translation-relevant info/commands
« Reply #10 on: July 15, 2009, 05:42:55 AM »
Hi,

There is not central place for translations, but it is possible to establish a list of places fit for translations. (Upstream places, such as Ubuntu's, Mandriva's, Gnome, etc...)

As far as games are concerned, and it will be same for many applications, you should go to the Armagetronad development team, and ask for participating in the translation of the files.

Here :
https://launchpad.net/armagetronad/
https://translations.launchpad.net/armagetronad

Quote
Otherwise, you might want to talk with Armagetron Advanced Developers, the project registrant, about using Launchpad for translations.


I found starting here:
http://armagetronad.net/downloads.php

end of that page:
Quote
Live development code is available on LaunchPad via the BZR version control system. Experienced users only!


Have fun and let us know how the developers see the question ? :)

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline angel02_de

  • Jr. Member
  • **
  • Posts: 41
Re: Translation-relevant info/commands
« Reply #11 on: July 17, 2009, 05:49:06 PM »
The German package descriptions are located under:
http://maik3531.de/ - Übersicht – RPM-i18n-DE
If you further could forward this to the right place, would be really super :)
cu angel02


Die deutschen Paketbeschreibungen befinden sich unter:
http://maik3531.de/ - Übersicht – RPM-i18n-DE
wenn du dies an die richtige Stelle weiter leiten könntest, wäre echt super :)
cu angel02

Offline kizito

  • Full Member
  • ***
  • Posts: 202
Re: Translation-relevant info/commands
« Reply #12 on: November 17, 2009, 04:19:30 PM »
I find kwrite quite useful in editing/ populating .po files. It has syntax highlighting and I find it easy to search for text in reference documents.

I use these commands to build a compendium of translated messages:
Code: [Select]
msgcat --sort-by-file --use-first -o compendium-raw.po program.lg.po compendium.lg.po
msgattrib --translated --no-fuzzy -o compendium-$(date +%F:%T).lg.po compendium-raw.po

Where lg is my language code.

I like doing it this way because all the files are plain text, giving me the choice of using other programs to process them if I so choose or need to.

Kizito
PCLinuxOS... Tough on Windows, tough on the causes of Windows

Offline kizito

  • Full Member
  • ***
  • Posts: 202
Re: Translation-relevant info/commands
« Reply #13 on: November 17, 2009, 04:25:55 PM »
The central place for many base system translations is:

http://translationproject.org
PCLinuxOS... Tough on Windows, tough on the causes of Windows

Offline maik3531

  • Moderator
  • Full Member
  • *****
  • Posts: 129
Re: Translation-relevant info/commands
« Reply #14 on: September 11, 2010, 03:31:19 PM »
The German package descriptions are located under:
http://maik3531.de/ - Übersicht – RPM-i18n-DE
If you further could forward this to the right place, would be really super :)
cu angel02


Die deutschen Paketbeschreibungen befinden sich unter:
http://maik3531.de/ - Übersicht – RPM-i18n-DE
wenn du dies an die richtige Stelle weiter leiten könntest, wäre echt super :)
cu angel02


The maik3531.de page no longer exists. Leiche has created a backup.
-L DE
Die Seite maik3531.de existiert nicht mehr. Leiche hat ein Backup angelegt.

http://kellerleiche.bplaced.net/pclos/doku.php?id=RPM-i18n-de
Please excuse my English