maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [bug #36647] Add Portuguese (pt-PT) translation and loc


From: RPome
Subject: [Maposmatic-dev] [bug #36647] Add Portuguese (pt-PT) translation and localization for portuguese speaking countries
Date: Wed, 13 Jun 2012 14:23:00 +0000
User-agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0

URL:
  <http://savannah.nongnu.org/bugs/?36647>

                 Summary: Add Portuguese (pt-PT) translation and localization
for portuguese speaking countries
                 Project: MapOSMatic
            Submitted by: rpome
            Submitted on: Wed 13 Jun 2012 02:23:00 PM GMT
                Category: i18n
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None

    _______________________________________________________

Details:

Here it is the portuguese translation and localization for portuguese speaking
countries.

I don't know if Macao should be included in MAP_LANGUAGES since Portuguese and
Chinese are both official languages unless we use "Macau (PT)" and "澳門
(广州话 / 廣州話)" or something like that (I don't know cantonese, those
symbols were extracted from en.wikipedia). Since Macao is not a country, but a
special administrative region of China, and only a few people understand
portuguese in Macao, maybe shouldn't be included. Although we can see in
OpenStreetMap Macao has portuguese names in some streets. Equatorial Guinea is
another story, I don't know if they have portuguese street names and if
portuguese is now really a official language.

Note that all countries listed here should use portuguese interface (pt /
pt-PT / standard portuguese / international portuguese) except Brazil (pt-BR)

I don't have experience in Python and this is only the second time I translate
.po files. I only have experience translating some software (wikipedia and
openstreetmap related software/interfaces) via web based translation
tools/resources. So please check if the code is correct.



In http://git.savannah.gnu.org/cgit/maposmatic.git/tree/www/settings.py#n111
add the following code:


LANGUAGES =    ("pt", u"Português"),

PAYPAL_LANGUAGES = {
    "pt": ("pt_BR", "PT"),

MAP_LANGUAGES = [
    ("pt_PT.UTF-8", u"Portugal (PT)"),
    ("pt_PT.UTF-8", u"Cabo Verde (PT)"),
    ("pt_PT.UTF-8", u"Angola (PT)"),
    ("pt_PT.UTF-8", u"Moçambique (PT)"),
    ("pt_PT.UTF-8", u"São Tomé e Príncipe (PT)"),
    ("pt_PT.UTF-8", u"Guiné-Bissau (PT)"),
    ("pt_PT.UTF-8", u"Timor-Leste (PT)"),






http://git.savannah.gnu.org/cgit/maposmatic/ocitysmap.git/tree/ocitysmap/i18n.py

I didn't changed words in APPELLATIONS (Brazilian portuguese) although I don't
agree on some words like the first one "Aeroporto" (Airport), it shouldn't be
included. I could suggest another class for portuguese, but brazilian
portuguese is portuguese with only a few differences (ISO code is the same:
"pt") so I followed the example "class i18n_ca_generic(i18n)" in
http://git.savannah.gnu.org/cgit/maposmatic/ocitysmap.git/tree/ocitysmap/i18n.py
and annexed portuguese to brazilian portuguese

In
http://git.savannah.gnu.org/cgit/maposmatic/ocitysmap.git/tree/ocitysmap/i18n.py
add the following code ("Brazilian portuguese" is already in that page)


class i18n_pt_generic(i18n):        # (changed "i18n_pt_br_generic" to
"i18n_pt_generic", ISO code: "PT")

    APPELLATIONS = [ # Brazilian portuguese
                     u"Aeroporto", u"Aer.", u"Alameda", u"Al.",
u"Apartamento", u"Ap.", 
                     u"Área", u"Avenida", u"Av.", u"Beco", u"Bc.", u"Bloco",
u"Bl.", 
                     u"Caminho", u"Cam.", u"Campo", u"Chácara", u"Colônia",
                     u"Condomínio", u"Conjunto", u"Cj.", u"Distrito",
u"Esplanada", u"Espl.", 
                     u"Estação", u"Est.", u"Estrada", u"Estr.", u"Favela",
u"Fazenda",
                     u"Feira", u"Jardim", u"Jd.", u"Ladeira", u"Lago",
                     u"Lagoa", u"Largo", u"Loteamento", u"Morro", u"Núcleo",
                     u"Parque", u"Pq.", u"Passarela", u"Pátio", u"Praça",
u"Pç.", u"Quadra",
                     u"Recanto", u"Residencial", u"Resid.", u"Rua", u"R.", 
                     u"Setor", u"Sítio", u"Travessa", u"Tv.", u"Trecho",
u"Trevo",
                     u"Vale", u"Vereda", u"Via", u"V.", u"Viaduto", u"Viela",
                     u"Vila", u"Vl.",

                     # Portuguese (being distinct from Brazilian portuguese)
                     u"Avª",  u"Av.ª", u"Calçada", u"Esc.", u"Escadaria",
u"Escadas",
                     u"Escnh.", u"Escadinhas", u"Jrd.", u"Lg.", u"Part.",
                     u"Particular", u"Pr.", u"Pct.", u"Pctª", u"Praceta",
u"Rot.", u"Rotunda",
                     u"Trv.", u"Trav.",

                     # "Angola" (being distinct from Brazilian portuguese and
Portuguese)
                     u"Via Expressa"
                   ]


    DETERMINANTS = [ # Brazilian portuguese
                     u" do", u" da", u" dos", u" das",

                     # Portuguese (being distinct from Brazilian portuguese)
                     u" de", u""]



    # for IndexPageGenerator.upper_unaccent_string
    C_ACCENT = re.compile(ur"[ç]", re.IGNORECASE | re.UNICODE)


    def upper_unaccent_string(self, s):
        s = self.C_ACCENT.sub("c", s)


LANGUAGES =
             ("pt", u"Português"),


language_class_map = {
    'pt_BR.UTF-8': i18n_pt_generic,                     # (changed
"i18n_pt_br_generic" to "i18n_pt_generic", ISO code is "PT")
    'pt_PT.UTF-8': i18n_pt_generic,
    'pt_AO.UTF-8': i18n_pt_generic,
    'pt_GW.UTF-8': i18n_pt_generic,
    'pt_ST.UTF-8': i18n_pt_generic,
    'pt_MZ.UTF-8': i18n_pt_generic,
    'pt_CV.UTF-8': i18n_pt_generic,
    'pt_TL.UTF-8': i18n_pt_generic,



See also the attached files with translations. Note that I used brazilian
portuguese translation (since only a few things should be modified) although I
checked the English version. I found a few errors (and a few sentences not
translated) in Brazilian portuguese translation so I made modifications to
that file too.

P.S. it would be great to use launchpad.net or translatewiki.net (even better)
to create / update translations. Anyway thanks for this great tool.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 13 Jun 2012 02:23:00 PM GMT  Name: ocitysmap(portuguese_pt).po 
Size: 4kB   By: rpome

<http://savannah.nongnu.org/bugs/download.php?file_id=26014>
-------------------------------------------------------
Date: Wed 13 Jun 2012 02:23:00 PM GMT  Name: django(portuguese_pt).po  Size:
44kB   By: rpome

<http://savannah.nongnu.org/bugs/download.php?file_id=26015>
-------------------------------------------------------
Date: Wed 13 Jun 2012 02:23:00 PM GMT  Name:
django(brasilian_portuguese_pt-BR).po  Size: 44kB   By: rpome

<http://savannah.nongnu.org/bugs/download.php?file_id=26016>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?36647>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]