[Maposmatic-dev] [bug #36647] Add Portuguese (pt-PT) translation and localization for portuguese speaking countries

2015-06-09 Thread Rui
Follow-up Comment #3, bug #36647 (project maposmatic):

All strings in Transifex are now translated. Now it's only missing changes in
language specific code in ocitysmap and maposmatic. Can someone change the
following 2 files in Git? Thanks.



http://git.savannah.gnu.org/cgit/maposmatic.git/tree/www/settings.py



# coding: utf-8

# maposmatic, the web front-end of the MapOSMatic city map generation system
# Copyright (C) 2009  David Decotigny
# Copyright (C) 2009  Frédéric Lehobey
# Copyright (C) 2009  David Mentré
# Copyright (C) 2009  Maxime Petazzoni
# Copyright (C) 2009  Thomas Petazzoni
# Copyright (C) 2009  Gaël Utard

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see http://www.gnu.org/licenses/.

# Django settings for www project.

import logging
import os.path

from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
from django.utils.translation import ugettext_lazy as _

from settings_local import *
import logconfig

PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))

TEMPLATE_DEBUG = DEBUG

MANAGERS = ADMINS

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Paris'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: /home/media/media.lawrence.com/
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: http://media.lawrence.com;, http://example.com/media/;
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use
a
# trailing slash.
# Examples: http://foo.com/media/;, /media/.
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'tm+wb)lp5q%br=p0d2tozkm_-w)cmcelv!7inons^v9(q!d2'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.load_template_source',
)


TEMPLATE_CONTEXT_PROCESSORS += (
 'django.core.context_processors.request',
 'www.maposmatic.context_processors.all',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)

ROOT_URLCONF = 'www.urls'

TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, 'templates'),
)

LOCAL_MEDIA_PATH = os.path.join(PROJECT_PATH, 'static')

INSTALLED_APPS = (
'django.contrib.sessions',
'www.maposmatic',
)

# Available website translations. Note that the language codes must be
# specified in Django i18n location (all lowercase, with the language and
# locale separated by a dash instead of an underscore: pt_BR - pt-br)
LANGUAGES = {
fr:uFrançais,
en:uEnglish,
de:uDeutsch,
it:uItaliano,
ca:uCatalà,
ru:uРусский,
ar:uالعربية,
pt:uPortuguês,
pt-br: uPortuguês do Brasil,
nb:uNorwegian Bokmål,
nl:uNederlands,
hr:uHrvatski,
pl:uPolski,
es:uEspañol,
id:uBahasa Indonesia,
tr:uTürkçe,
ja:u日本人,
el:uελληνικά,
be:uбеларуская,
uk:uукраїнська,
}

# Associate a Django language code with:
#  the language code used to select the Paypal button
#  the country code that allows to get the proper translation of the
#  PayPal payment page
# When no association is found, we automatically default to english
PAYPAL_LANGUAGES = {
fr: (fr_FR, FR),
de: (de_DE, DE),
it: (it_IT, IT),
pt: (pt_PT, PT),
pt-br: (pt_BR, BR),
nl: (nl_NL, NL),
pl: (pl_PL, PL),
es: (es_ES, ES),
el: (el_GR, GR),
}

# Languages must be ordered by country (in xx_YY, YY is the country
# code), and then ordered with the most 

[Maposmatic-dev] [bug #36647] Add Portuguese (pt-PT) translation and localization for portuguese speaking countries

2012-09-05 Thread David Mentré
Update of bug #36647 (project maposmatic):

 Assigned to:None = mpetazzoni 


___

Reply to this item at:

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

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




[Maposmatic-dev] [bug #36647] Add Portuguese (pt-PT) translation and localization for portuguese speaking countries

2012-06-13 Thread RPome
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

[Maposmatic-dev] [bug #36647] Add Portuguese (pt-PT) translation and localization for portuguese speaking countries

2012-06-13 Thread RPome
Follow-up Comment #1, bug #36647 (project maposmatic):

I forgot to tell about sorting order (I think it has something to do with
those python files). At this moment if I render a map in MapOSMatic with
Brazilian portuguese language selected I get the following index sort:

* D. Francisco Manuel de Melo (Rua)
* Diario de Noticias (Rua do)
* D. João de Castro (Rua)

but it should be:
* D. Francisco Manuel de Melo (Rua)
* D. João de Castro (Rua)
* Diario de Noticias (Rua do)



although the following sort order is correct (extracted from an actual
MapOSMatic map index):
Dr. Alfredo Bensaúde (Avenida)
Dr Alfredo da Costa (Rua)
Dr. António Granjo (R.)

this one in the middle (Dr Alfredo da Costa) has a typing error since period
(.) is missing and should be fixed in OpenStreetMap, but this happens a lot so
would be better to keep this sorting order in this last example.

If this is a lot of work, just ignore. All those abbreviations should be
cleaned in OpenStreetMap (Dr.  Doutor; D.  Dom; etc.)

___

Reply to this item at:

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

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