https://www.gramps-project.org/wiki/api.php?action=feedcontributions&user=Bccomm&feedformat=atomGramps - User contributions [en]2024-03-29T09:05:57ZUser contributionsMediaWiki 1.31.3https://www.gramps-project.org/wiki/index.php?title=Translating_Gramps&diff=1724Translating Gramps2007-03-26T23:26:18Z<p>Bccomm: /* LDS Terminology */ Expand</p>
<hr />
<div>Tips for translators of the GRAMPS program.<br />
[[Category:Developers/Localization]]<br />
<br />
==Tips for translators==<br />
===Getting started===<br />
Translating GRAMPS into a new language means translating English strings used in the GRAMPS interface. To put it shortly, this amounts to<br />
# obtaining the gramps.pot file with the strings to be translated,<br />
# translating the strings in the template, and<br />
# getting the translated file uploaded into gramps SVN repository.<br />
Another avenue of translation is translating the documentation. This is a different and lengthy process and it is decribed in our [[Translating the manual]] page. Here we will concentrate on the interface translation only.<br />
<br />
===Obtaining gramps.pot===<br />
* Download <code>gramps.pot</code> from GRAMPS SVN repository, see [[Brief_introduction_to_SVN| the introduction to SVN]].<br />
* Look for <code>gramps.pot</code> in the directory <code>gramps2/po</code>.<br />
<br />
===Translating messages===<br />
* Copy <code>gramps.pot</code> to the file named <code>lang.po</code>, according to the language you are translating into (<code>fr.po</code> for French, <code>ru.po</code> for Russian, etc.)<br />
* Use [http://www.gtranslator.org GTtranslator], [http://kbabel.kde.org/ KBabel], Emacs po-mode, or any similar tool designed for translating <code>.po</code> files. If you do not like any of these tools, you can use any text editor to translate messages.<br />
* Even though GRAMPS uses UNICODE (UTF-8) for its character set, you may use your native character set for your translation. Just make sure you specify the character set you are using in the <code>Content-Type</code> line in the <code>.po</code> file. GRAMPS will handle the conversion to UNICODE.<br />
<br />
===Formatting (compiling) <code>.po</code> file===<br />
* Currently, formatting is performed during build time, so you should not have to worry about it. The translated <code>.po</code> file is the product of your work. Check it into SVN if you obtained the permission to do so, or email it to [[Contact|Don Allingham or Alex Roitman]] otherwise.<br />
<br />
<br />
==Hard to Translate Phrases==<br />
Some things are just hard to translate. Below are a few of the more difficult items, along with some suggestions on how to handle them.<br />
===LDS Terminology===<br />
The Church of Jesus Christ of Latter Day Saints (a.k.a. Mormons) maintains a lot of genealogy data. In the United States, they are probably the non-government organization with the most detailed records available. Genealogical research is important to the Mormon church. They are responsible for defining the [[GEDCOM]] format.<br />
<br />
The LDS Church has some specific terminology that can present difficulty in translating. There are two approaches to handling the information.<br />
# If the LDS Church has a presence in your country, contact the LDS Temple in your area and ask them what the correct terminology is in your native language<br />
# If the LDS Church does not have a presence in your country, it would probably be safe to simply not translate the phrases.<br />
These terms include:<br />
# LDS Ordinance names:<br />
#* Sealed to Parents<br />
#* Sealed to Spouse<br />
#* LDS Baptism<br />
#* Endowment<br />
# LDS Status names for Ordinances:<br />
#* Child<br />
#* Cleared<br />
#* Completed<br />
#* Infant<br />
#* Pre-1970<br />
#* Qualified<br />
#* Stillborn<br />
#* Submitted<br />
#* Uncleared<br />
#* BIC (Born In the Covenant)<br />
#* DNS (Do Not Submit)<br />
#* Canceled<br />
#* DNS/CAN (Do Not Submit/Previous sealing cancelled)<br />
<br />
==Updating your translation==<br />
If you have submitted a translation, changes are that after some weeks/months, new strings are added to GRAMPS, implying you need to update your translation file. <br />
<br />
Assuming you have obtained originally the GRAMPS source tree as explained in [[Brief introduction to SVN]]. Now:<br />
* Update your gramps tree from SVN. This can be done by executing the command <pre>svn up</pre> from the root GRAMPS svn directory. This will download an updated <code>gramps.pot</code> file.<br />
* Use your outdated translation to translate the strings that did not change:<pre>msgmerge --no-wrap lang.po template.po -o newlang.po</pre> where <code>lang</code> is your language code. The <code>--no-wrap</code> option will prevent changes due to automatic word wrapping. You need it only if want more readable SVN diffs.<br />
* Translate all untranslated messages in <code>newlang.po</code>. When you are sure everything is right, rename <code>newlang.po</code> as <code>lang.po</code> and check it into SVN as you did with the original file.<br />
* If command <code>msgmerge</code> is not available on your system, you have to install the <code>}gettext</code> package.<br />
<br />
There is also the make target that does the following:<br />
* Create new <code>gramps.pot</code> template from the source code files<br />
* Updates each <code>po</code> file in the source tree<br />
It may be an overkill for you, but if you feel like using it, you can run:<br />
make update-po<br />
in the <code>po</code> directory. This assumes that you have already succesfully configured the source.<br />
<br />
==Advanced issues==<br />
===Format line parameters===<br />
Format line parameters such as <nowiki>%s</nowiki> and <nowiki>%d</nowiki> '''should not''' be translated. The order of these parameters '''should not''' be changed. Examples:<br />
<br />
English:<br />
Long widowhood: %s was a widow %d years.<br />
<br />
Translation (using Backward English as an example :-):<br />
Gnol doohwodiw: %s saw a wodiw %d sraey.<br />
<br />
Named format line parameters such as <nowiki>%(something)s and %(something)d</nowiki> also '''should not''' be translated. Feel free to change the order of named parameters to correctly phrase the message in your language. Also, use hints provided by the names. Examples:<br />
<br />
English:<br />
Baptized before birth: %(male_name)s<br />
born %(byear)d, baptized %(bapyear)d.<br />
<br />
Translation into Backward English:<br />
Dezitpab erofeb htrib: %(byear)d<br />
nrob %(male_name)s, dezitpab %(bapyear)d.<br />
<br />
In the above example, the verb "born" should be in masculine form (if verbs in your language have gender, that is), since the person born is apparently a male.<br />
<br />
===Translation context===<br />
In some cases, two different concepts can be expressed by the same word in English and yet require different translations. For example, the '''title of the book''' and the nobility ''title of the person''' are expressed by the same '''Title''' word. However, in other languages different words are needed to describe the book title and the person's title.<br />
<br />
To mitigate such problems, a context can be added to the translation string. A context-enabled string has a vertical line separating the context from the string:<br />
book|Title<br />
person|Title<br />
The correct translation '''should not''' include either the context or the separator. The context is to give the translator idea of what the string means. However, '''both the context and the separator must not be in the translated string''', so in backward english the above is translated into<br />
Eltitkoob<br />
Eltitnosrep<br />
<br />
===Translating relationships===<br />
Translating relationships is not done within the <code>.po</code> files, except for occasional <code>father</code> and <code>mother</code> strings here and there in the interfaces and reports. Complete translation of all relationships for the language/culture is done inside a relationship calculator plugin.<br />
<br />
In short, the need for a plugin comes from the impossibility to translate "first cousin twice removed" in languages such as, e.g., German or Russian. See the [[Relationship Calculator]] page for details on why and how to create such a plugin.</div>Bccomm