Gnome 2 Hindi translations -------------------------- What is all this about? Ever wanted to use an application with the interface ( menus, dialogs, help etc) in you own language ? If yes, this is exactly doing that. Here we are providing local language interface for applications, by translating the user interface - menus, dialogs , help etc to user language. Here we are focussing on Gnome 2 applications. What needs to be done? Translations, translations, translations....... testing, review, testing, review.... There is a large volume of translations to do. About 30,000 string for UI text & much more for documentation. UI text is mainly stored in message catalogs, which are translated. When an application runs in particular language environment, it looks for translated message catalog for that language and uses it if it finds one. How can I volunteer/help? If you are have a good vocabulary in your language, or are a linguist or professional translator then you can help a lot 2) How ? How is it all done! 3) How to translate What is translation? How the gettext mech works? Pre-requisites for translation. POT , PO files Translating Testing Installation of translations Submitting POT/PO file basics ------------------ The Header ----------- Using the tools --------------- Since all translations have to be in UTF-8, we need editors supporting Unicode &Indic rendering. Below few Using Gnome2 ------------ More on Installing Gnome 2 Setting it up for Hindi. Using yudit ----------- Yudit is a simple Unicode editor, has Opentype font support for Devanagari, Malayalam & other indic languages. Inscript & phonetic keymaps are available for typing in Indic. You can download the latest versions from http://www.yudit.org/ Binary RPMs and Windows version is available at http://www.yudit.org/download/binary/ To type in any indian language, you need to only install the font and set the keymap. Yudit only works with Unicode or Opentype fonts. You can get a devanagari Opentype font from http://rohini.ncst.ernet.in/indix/download/font/ A Malayalam OTF is at http://malayalamlinux.sourceforge.net/downloads/fonts/MalOtf.ttf Bengali OTF - http://www.nongnu.org/freebangfont/ A shareware Unicode font - code2000.ttf is available from http://home.att.net/~jameskass/ To install the font, either copy it into ~/.yudit/fonts in your home directory.or globally in /usr/share/yudit/fonts. You dont need to do any ttmkfdir/mkfontdir stuff. Yudit configuration is stored in ~/.yudit/yudit.properties. Global one is in /usr/share/yudit/config/yudit.properties In yudit.properties look for yudit.font.TrueType= yudit.editor.inputs=straight,unicode,Dev-Inscript,Gurmukhi,Gujarati,Kannada,Tel-Inscript,Mnemonic,Esperanto,Telugu,x-utf-8:hu_HU,OldHung Using Gtranslator ----------------- A Gnome 2 port of gtranslator is available at http://www.gtranslator.org. This is currently in development ( CVS only , no releases yet ). Stable version till 0.43 are based on Gtk1.2 & gnome 1.4 so its not possible to use them for Indic translations. Using Kbabel ------------ KDE (Qt) does not support Indian language rendering. Work is on in this direction. Once ready Kbabel can be used for translation. Using Poedit ------------ Poedit ( http://poedit.sourceforge.net/ ) is a po editing tool "poEdit is cross-platform gettext catalogs (.po files) editor. It is built with wxWindows toolkit and can run on any platform supported by it (although it was only tested on Unix with GTK+ and Windows). It aims to provide more convenient approach to editing catalogs than launching vi and editing the file by hand." Gtk2 port is in development. Stable version does not support typing in Indic. Windows version can be used under Windows 2000/XP to type in Indic. Using Emacs ----------- Emacs has a built in PO mode to edit PO(T) files. Some basic Indic support is available Any other --------- Below is sample header from untranslated po file. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2002-05-28 09:28+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" - Remove the #, fuzzy line - Modify the following fields Once you are finished translating the po, change the line "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" to reflect current date and time eg. "PO-Revision-Date: 20002-06-06 18:26+5:30\n" - Add your name , and email address "Last-Translator: FULL NAME \n" eg. "Last-Translator: Amit Verma \n" - The languangge & team mailing list "Language-Team: LANGUAGE \n" this should be say "Language-Team: Gnome Hindi Team\n" - Character set, set CHARSET to UTF-8 "Content-Type: text/plain; charset=CHARSET\n" change to "Content-Type: text/plain; charset=UTF-8\n" Below is sample how it should actually look like. # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2002-04-04 10:07-0500\n" "PO-Revision-Date: 2002-05-10 15:50+5:30\n" "Last-Translator: Anurag Seetha \n" "Language-Team: Hindi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" Gettext utilities ----------------- msgfmt compile message catalog to binary format msgfmt [OPTION] filename.po ... -o, --output-file=FILE write output to specified file --statistics print statistics about translations msgunfmt uncompile message catalog from binary format, ie get a .po file from .mo msgunfmt [OPTION] [FILE]... -o, --output-file=FILE write output to specified file -s, --sort-output generate sorted output msgcat combines several message catalogs. This tool is used to build a PO compendium, a po file containing all translations extracted from a set of po files. This PO compendium can then be used to fill in translations in empty pot files. This is done using msgmerge utility ( see below ). msgcat [OPTION] [INPUTFILE]... -o, --output-file=FILE write output to specified file --use-first use first available translation for each message, don't merge several translations -<, --less-than=NUMBER print messages with less than this many defini- tions, defaults to infinite if not set ->, --more-than=NUMBER print messages with more than this many defini- tions, defaults to 0 if not set -u, --unique shorthand for --less-than=2, requests that only unique messages be printed --no-location do not write '#: filename:line' lines -s, --sort-output generate sorted output -F, --sort-by-file sort output by file location msgmerge merge message catalog and template msgmerge [OPTION] def.po ref.pot Merge two .po files together. def.po is existing PO file containing translations ( this could be PO Compendium ). ref.pot is last created PO file with uptodate source references but old translations or a POT file. Any translation in the file will be discarded -s, --sort-output generate sorted output -F, --sort-by-file sort output by file location --no-location suppress '#: filename:line' lines --add-location preserve '#: filename:line' lines (default) eg. msgmerge -s --no-location allstrings.po package.po For more do a 'info gettext' or read (Insert web link to gnu gettext online docs) Testing the translated po ------------------------- - Check for errors in translated po by msgfmt command $ msgfmt --statistics sample.hi.po eg. [goofy@cartoon TranslatedPO]$ msgfmt --statistics gtk+.HEAD.hi.po 804 translated messages, 210 untranslated messages. Another example: $ msgfmt --statistics libgnomeprintui.hinew.po 76 translated messages, 20 fuzzy translations, 14 untranslated messages. Common Errors ------------- TODO: Put some info on the common errors (usually typos) comitted while translating. - Always read the comments above msgid (If there is one apart from source references). - A common typo is missing \n entries. If a msgid has a \n at end FAQ --- How to handle Hotkeys / Keyb accelerators ? Many translatable strings, esp menu entries, labels, button labels have keyboard acclerators associated with them. They I don't think this message will appear in GUI ! Should I translate it ? My translations are too old, lot has changed how do I update ? Whats a fuzzy string ? Compiling the translations -------------------------- A translated .po is to be compiled in to a machine object (.mo) , this step converts it into a binary format. Installing the translations --------------------------- Translated po's are installed in following location /usr/share/locale/LANG/LC_MESSAGES where LANG is the language code eg. for Hindi code is hi so /usr/share/locale/hi/LC_MESSAGES A sample: [goofy@cartoon TranslatedPO]$ ls /usr/share/locale/hi/LC_MESSAGES/ bonobo-activation.mo gnome-session-2.0.mo libgnomeprint-2.0.mo eel-2.0.mo gnome-vfs-2.0.mo libgnomeprintui.mo gconf-editor.mo libbonoboui-2.0.mo libgnomeui-2.0.mo gedit-2.0.mo libgnome-2.0.mo gnome-desktop-2.0.mo libgnomecanvas-2.0.mo Using Translation Compendia A "compendium" is a special PO file containing a set of translations recurring in many different packages. The translator can use gettext tools to build a new compendium, to add entries to her compendium, and to initialize untranslated entries, or to update already translated entries, from translations kept in the compendium. To concatenate several valid PO files into one compendium file you can use `msgcomm' or `msgcat' (the latter preferred): msgcat -o compendium.po file1.po file2.po Extract a Message Subset from a PO File ....................................... Nobody wants to translate the same messages again and again; thus you may wish to have a compendium file containing `getopt.c' messages. To extract a message subset (e.g., all `getopt.c' messages) from an existing PO file into one compendium file you can use `msggrep': msggrep --location src/getopt.c -o compendium.po file.po