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, uPortuguês),
PAYPAL_LANGUAGES = {
pt: (pt_BR, PT),
MAP_LANGUAGES = [
(pt_PT.UTF-8, uPortugal (PT)),
(pt_PT.UTF-8, uCabo Verde (PT)),
(pt_PT.UTF-8, uAngola (PT)),
(pt_PT.UTF-8, uMoçambique (PT)),
(pt_PT.UTF-8, uSão Tomé e Príncipe (PT)),
(pt_PT.UTF-8, uGuiné-Bissau (PT)),
(pt_PT.UTF-8, uTimor-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
uAeroporto, uAer., uAlameda, uAl.,
uApartamento, uAp.,
uÁrea, uAvenida, uAv., uBeco, uBc., uBloco,
uBl.,
uCaminho, uCam., uCampo, uChácara, uColônia,
uCondomínio, uConjunto, uCj., uDistrito,
uEsplanada, uEspl.,
uEstação, uEst., uEstrada, uEstr., uFavela,
uFazenda,
uFeira, uJardim, uJd., uLadeira, uLago,
uLagoa, uLargo, uLoteamento, uMorro, uNúcleo,
uParque, uPq., uPassarela, uPátio, uPraça,
uPç., uQuadra,
uRecanto, uResidencial, uResid., uRua, uR.,
uSetor, uSítio, uTravessa, uTv., uTrecho,
uTrevo,
uVale, uVereda, uVia, uV., uViaduto, uViela,
uVila, uVl.,
# Portuguese (being distinct from Brazilian portuguese)
uAvª, uAv.ª, uCalçada, uEsc., uEscadaria,
uEscadas,
uEscnh., uEscadinhas, uJrd., uLg., uPart.,
uParticular, uPr., uPct., uPctª, uPraceta,
uRot., uRotunda,
uTrv., uTrav.,
# Angola (being distinct from Brazilian portuguese and
Portuguese)
uVia 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, uPortuguês),
language_class_map = {
'pt_BR.UTF-8': i18n_pt_generic, # (changed