< Marble
Revision as of 14:04, 11 November 2011 by Frinring (Talk | contribs) (Direction terms)

Jump to: navigation, search

Translating GeoDataCoordinates

Starting with version 1.3 Marble has improved support for parsing coordinates from text strings of all kind of (non-western) languages. This is done by using 7 entries in the translation catalog for marble-qt which all are from the context "GeoDataCoordinates", have a "*" as text and as disambiguation a description what they are about (+ a link here).

You can use the entries to extend the items which are used for parsing strings. The default items are based on the English language, so coordinates in English can be always parsed, whatever you add here. If you do not need to add anything, just leave the entry without a translation or translate with a "*" again.

If there are multiple items for a entry, you list them by separating the items with the "|" char (U+007C, VERTICAL LINE) without any spaces added, e.g. "A|B|C".

Direction terms

There are 4 entries for the directions:

  • North direction terms, ...
  • South direction terms, ...
  • East direction terms, ...
  • West direction terms, ...

Here give the shortform(s) of each direction which is used in coordinates, which is e.g. "N" for North in English. If there are variants with and without a dot, list both, e.g. "Pn.|Pn" for North in Polish. If there is a space, make sure it is just one space, e.g. with "с. ш." for North in Bulgarian.

If you add localized direction terms, you need to do it for all four directions. The number of terms per direction can be different, e.g. "O" for West and "E|L" for East in Portuguese.

Coordinate symbols

There are 3 entries for the symbols:

  • Degree symbol terms, ...
  • Minutes symbol terms, ...
  • Seconds symbol terms, ...

Per default the parser accepts also quite a range of characters which only look similar to the actual symbol. Cmp. this listing in the code:

   // x00B0: ° DEGREE SIGN
   // x00BA: º MASCULINE ORDINAL INDICATOR (found used as degree sign)
   // x2032: ′ PRIME (minutes)
   // x00B4: ´ ACUTE ACCENT (found as minutes sign)
   // x2033: ″ DOUBLE PRIME (seconds)

Additionally all single ticks listed here are accepted as Seconds symbol if doubled, e.g. "´´". So hopefully no need to add the typical workaround due to the keyboard's layout in your language.

Typically Asian languages might need to set the symbols here, like "도" for Degree in Korean.


Take a look at the examples used for testing, in the method "TestGeoDataCoordinates::testFromLocaleString_data()" in the file

Or see the the blog post and the examples given here:

Be aware that some missed what was asked for with the directions: not the full, normal term was asked, but the short form like it is used in a coordinate, cmp. the section about Direction terms above.


If you need help or have other suggestions, please contact or the Marble mailinglist.

Content is available under Creative Commons License SA 4.0 unless otherwise noted.