Adnane Belmadiaf has proposed merging lp:~adnane002/loco-directory/fix.621167 
into lp:loco-directory.

Requested reviews:
  loco-directory-dev (loco-directory-dev)
Related bugs:
  #621167 The languages on the language selector should be in native names
  https://bugs.launchpad.net/bugs/621167

-- 
https://code.launchpad.net/~adnane002/loco-directory/fix.621167/+merge/33272
Your team loco-directory-dev is requested to review the proposed merge of 
lp:~adnane002/loco-directory/fix.621167 into lp:loco-directory.
=== modified file 'loco_directory/common/context_processors.py'
--- loco_directory/common/context_processors.py	2010-07-28 13:13:39 +0000
+++ loco_directory/common/context_processors.py	2010-08-20 23:28:48 +0000
@@ -3,6 +3,7 @@
 # to use this processor, add "common.context_processors.loco_version" to your variable TEMPLATE_CONTEXT_PROCESSORS in your settings file
 
 from django.conf import settings
+from languages import LANGUAGES
 
 def loco_version(request):
     """
@@ -32,3 +33,6 @@
 def url_base(request):
     url = request.get_full_path().split('/')
     return {'url_base': url[1]} 
+
+def languages(request):
+    return {'langues': LANGUAGES} 

=== added file 'loco_directory/common/languages.py'
--- loco_directory/common/languages.py	1970-01-01 00:00:00 +0000
+++ loco_directory/common/languages.py	2010-08-20 23:28:48 +0000
@@ -0,0 +1,54 @@
+# -*-: coding: utf-8 -*-
+
+
+LANGUAGES = {
+ 'ar': ['Arabic', u'العربية'],
+ 'bg': ['Bulgarian', u'български език'],
+ 'bn': ['Bengali', u'বাংলা'],
+ 'ca': ['Catalan', u'català'],
+ 'cs': ['Czech', u'česky'],
+ 'cy': ['Welsh', u'Cymraeg'],
+ 'da': ['Danish', u'dansk'],
+ 'de': ['German', u'Deutsch'],
+ 'el': ['Greek', u'Ελληνικά'],
+ 'en': ['English', u'English'],
+ 'es': ['Spanish', u'español'],
+ 'es_AR': ['Argentinean Spanish', u'Argentinean Spanish'],
+ 'et': ['Estonian', u'eesti keel'],
+ 'eu': ['Basque', u'euskara'],
+ 'fa': ['Persian', u'فارسی'],
+ 'fi': ['Finnish', u'suomi'],
+ 'fr': ['French', u'français'],
+ 'ga': ['Irish', u'Gaeilge'],
+ 'gl': ['Galician', u'Galego'],
+ 'he': ['Hebrew', u'עִבְרִית; עברית'],
+ 'hr': ['Croatian', u'hrvatski jezik'],
+ 'hu': ['Hungarian', u'magyar'],
+ 'is': ['Icelandic', u'íslenska'],
+ 'it': ['Italian', u'italiano'],
+ 'ja': ['Japanese', u'日本語 '],
+ 'ka': ['Georgian', u'ქართული ენა (kartuli ena)'],
+ 'km': ['Khmer', u'ភាសាខ្មែរ'],
+ 'kn': ['Kannada', u'ಕನ್ನಡ'],
+ 'ko': ['Korean', u'韓國語'],
+ 'lt': ['Lithuanian', u'lietuvių kalba'],
+ 'lv': ['Latvian', u'latviešu valoda'],
+ 'mk': ['Macedonian', u'македонски јазик'],
+ 'nl': ['Dutch', u'Nederlands'],
+ 'no': ['Norwegian', u'Norsk'],
+ 'pl': ['Polish', u'polski'],
+ 'pt': ['Portugese', u'português'],
+ 'pt_BR': ['Brazilian Portuguese', u'Brazilian Portuguese'],
+ 'ro': ['Romanian', u'română'],
+ 'ru': ['Russian', u'русский язык'],
+ 'sk': ['Slovak', u'slovenčina'],
+ 'sl': ['Slovenian', u'slovenščina'],
+ 'sr': ['Serbian', u'српски језик'],
+ 'sv': ['Swedish', u'Svenska'],
+ 'ta': ['Tamil', u'தமிழ்'],
+ 'te': ['Telugu', u'తెలుగు'],
+ 'tr': ['Turkish', u'Türkçe'],
+ 'uk': ['Ukrainian', u'українська мова'],
+ 'zh_CN': ['Simplified Chinese', u'中文'],
+ 'zh_TW': ['Traditional Chinese', u' 中文']
+}

=== modified file 'loco_directory/settings.py'
--- loco_directory/settings.py	2010-08-20 13:05:47 +0000
+++ loco_directory/settings.py	2010-08-20 23:28:48 +0000
@@ -86,6 +86,7 @@
     "common.context_processors.google_api_key",
     "common.context_processors.login_redirect",
     "common.context_processors.url_base",
+    "common.context_processors.languages",
 )
 
 ROOT_URLCONF = 'loco_directory.urls'

=== modified file 'loco_directory/templates/base.html'
--- loco_directory/templates/base.html	2010-08-20 13:05:47 +0000
+++ loco_directory/templates/base.html	2010-08-20 23:28:48 +0000
@@ -45,8 +45,8 @@
 		<form name="lang-switcher" style="text-align:right;" action="/language/" method="get">
 		<input name="next" type="hidden" value="{{ request.path }}" />
 		    <select name="lang" onchange="document.forms['lang-switcher'].submit()">
-			{% for lang in LANGUAGES %}
-			    <option value="{{ lang.0 }}"{% ifequal LANGUAGE_CODE lang.0 %} selected="selected"{% endifequal %}>{{ lang.1 }}</option>
+			{% for code, lang in langues.items %}
+			    <option value="{{ code }}"{% ifequal LANGUAGE_CODE code %} selected="selected"{% endifequal %}>{{ lang.1 }}</option>
 			{% endfor %}
 		    </select>
 		</form>

_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to