Could anyone please forward this to the development / maintanance team?
Here is the source code of a page configured as "Português (Portugal)" and then "Português (Brasil)".
Please pay attention to the variables "currentLanguage", which is used to send the translation request to Google Translate engine, and to which option has the attribute selected='selected' in footer_language_selector object in both cases.
Google Translate does not make distinction between pt_BR and pt_PT. So, whichever the footer_language_selector is either pt_BR or pt_PT, the variable currentLanguage must be set to just "pt" (as it's done for pt_PT, but not for pt_BR). Please, fix it. It's simple.
Português (Portugal): -- does work, "pt_PT" is rendered to "pt"
Code:
var currentLanguage = 'pt';
var translatedFromStr = 'Translated from %(language)s.';
var translateErrorStr = 'Translation was unsuccessful.';
// The following language map can be fetched from translate by
// http://translate.google.com/translate_a/l?client=X&hl=X&cb=1
// It would cost an additional http call, and it will not cover translations
// for some of Panoramio supported languages (e.g., ma, ast), so we just
// precompute it here.
var languageMap = { // Supported source languages by Google Translate.
'af': 'Afrikaans',
'sq': 'Albanian',
'ar': 'Árabe',
'be': 'Belarusian',
(...)
'fa': 'Persa',
'pl': 'Polonês',
'pt': 'Português',
'ro': 'Romeno',
'ru': 'Russo',
'sr': 'Sérvio',
(...)
'vi': 'Vietnamese',
'cy': 'Galês',
'yi': 'Yiddish'
};
(...)
<div class="footer_language_selector">
<form action="/lang" method="get" id="language_selection">
<label for="languages">Escolha a língua</label>
<select id="languages" name="l">
<option
dir='ltr'
value='ast_ES.utf8'
>
Asturian
</option>
(...)
<option
dir='ltr'
value='pl_PL.utf8'
>
Polski
</option>
<option
dir='ltr'
selected='selected'
value='pt_PT.utf8'
>
Português (Portugal)
</option>
<option
dir='ltr'
value='pt_BR.utf8'
>
Português (Brasil)
</option>
<option
dir='ltr'
value='ro_RO.utf8'
>
Română
</option>
<option
dir='ltr'
value='ru_RU.utf8'
>
Русский
</option>
(...)
<option
dir='ltr'
value='zh_TW.utf8'
>
中文 (繁體)
</option>
</select>
<input type="submit" value="Ir" />
</form>
</div>
</div>
Português (Brasil) -- will work if "pt_BR" is rendered to "pt"
Code:
var currentLanguage = 'pt_BR';
var translatedFromStr = 'Translated from %(language)s.';
var translateErrorStr = 'Translation was unsuccessful.';
// The following language map can be fetched from translate by
// http://translate.google.com/translate_a/l?client=X&hl=X&cb=1
// It would cost an additional http call, and it will not cover translations
// for some of Panoramio supported languages (e.g., ma, ast), so we just
// precompute it here.
var languageMap = { // Supported source languages by Google Translate.
'af': 'Afrikaans',
'sq': 'Albanian',
'ar': 'Árabe',
'be': 'Belarusian',
(...)
'fa': 'Persa',
'pl': 'Polonês',
'pt': 'Português',
'ro': 'Romeno',
'ru': 'Russo',
'sr': 'Sérvio',
(...)
'vi': 'Vietnamese',
'cy': 'Galês',
'yi': 'Yiddish'
};
(...)
<div class="footer_language_selector">
<form action="/lang" method="get" id="language_selection">
<label for="languages">Escolha a língua</label>
<select id="languages" name="l">
<option
dir='ltr'
value='ast_ES.utf8'
>
Asturian
</option>
(...)
<option
dir='ltr'
value='pl_PL.utf8'
>
Polski
</option>
<option
dir='ltr'
value='pt_PT.utf8'
>
Português (Portugal)
</option>
<option
dir='ltr'
selected='selected'
value='pt_BR.utf8'
>
Português (Brasil)
</option>
<option
dir='ltr'
value='ro_RO.utf8'
>
Română
</option>
<option
dir='ltr'
value='ru_RU.utf8'
>
Русский
</option>
(...)
<option
dir='ltr'
value='zh_TW.utf8'
>
中文 (繁體)
</option>
</select>
<input type="submit" value="Ir" />
</form>
</div>
</div>