added more translations + fix translations for dynamic content

This commit is contained in:
sanj 2010-11-15 06:53:23 +05:30
parent 2005aee1ed
commit d3d5b69a84
3 changed files with 37 additions and 20 deletions

View File

@ -1,3 +1,5 @@
#coding=utf-8
# Create your views here. # Create your views here.
from django.shortcuts import render_to_response from django.shortcuts import render_to_response
from django.http import HttpResponse from django.http import HttpResponse
@ -7,9 +9,18 @@ from django.core.mail import send_mail
from models import * from models import *
QUESTIONS = { QUESTIONS = {
'1problems': 'What problems do flyover and skywalk projects create?', '1problems': {
'2like': 'What do you like about these projects?', 'en': u'What problems do flyover and skywalk projects create?',
'3stories': 'Do you have any stories about flyovers or skywalks in Mumbai or elsewhere?' 'hi': u'हवाई पुल और स्क्य्वाल्क्स योजनाओ से किस प्रकार की मुश्किले होती हैं?'
},
'2like': {
'en': u'What do you like about these projects?',
'hi': u'इन योजनाओ मे आपको क्या पसंद आया?'
},
'3stories': {
'en': u'Do you have any stories about flyovers or skywalks in Mumbai or elsewhere?',
'hi': u'क्या आपके पास मुंबई या कहीं और के हवाई पुल या स्क्य्वाल्क्स से संबंधित अपना कोई अनुभव है? '
}
} }
def geojson(request): def geojson(request):

View File

@ -225,8 +225,11 @@ $(function() {
}); });
}); });
function translatePage(lang) { function translatePage(lang, filter) {
$('.translatable td, .trans').each(function() { if (filter === undefined) {
var filter = '.translatable td, .trans';
}
$(filter).each(function() {
var t = $(this); var t = $(this);
var currentData = "lang_" + CURRENT_LANGUAGE; var currentData = "lang_" + CURRENT_LANGUAGE;
var newData = "lang_" + lang; var newData = "lang_" + lang;
@ -249,6 +252,8 @@ $(function() {
// var html = $('#' + $(this).attr("data-target")).html(); // var html = $('#' + $(this).attr("data-target")).html();
var html = tmpl('tmpl_' + $(this).attr('data-target'), {}); var html = tmpl('tmpl_' + $(this).attr('data-target'), {});
$('#media').html(html); $('#media').html(html);
var filter = '#media .trans';
translatePage(CURRENT_LANGUAGE, filter);
}); });
$('.langButton').click(function() { $('.langButton').click(function() {

View File

@ -58,20 +58,21 @@
<div class="navContent" id="about"> <div class="navContent" id="about">
<div class="contentWrapper about"> <div class="contentWrapper about">
<p>This site maps the landscapes of elevated road highways flyovers and <p class="trans" data-lang_hi="यह साईट भारत के पश्चिमी महानगर मुंबई के उन्नत राजमार्ग, हवाई पुल, स्क्य्वाल्क्स, उन्नत पैदल रास्तों और प्रकृति छवि का एक नक्षा है. हवाई पुल और स्क्य्वाल्क्स मुंबई के तेजी से बढते हुए शहरीकरण की प्रत्यक्ष विशेषता बन गए हैं.">This site maps the landscapes of elevated road highways flyovers and
elevated pedestrian walkways skywalks across the Mumbai Metropolitan elevated pedestrian walkways skywalks across the Mumbai Metropolitan
Region in Western India. Region in Western India.</p>
<p>Both flyovers and skywalks have become a highly visible feature of Mumbais <p class="trans" data-lang_hi="हवाई पुलों की संख्या १९९७ में १३ से २००९ में ६० तक बढ़ गयी है, उस अवधि में यहाँ के पहले स्क्य्वाल्क्स २००८ में बनें. इसके अलावा अनेक योजनायें अविरत और प्रस्तावित भी हैं. यह साईट फोटोग्राफों, विडियो, और श्रव्य क्लिप को कोडांतरण और वर्गीकृत करके आप तक एक नये और विभिन्न प्रकार का नगरीय जगत पेश करता है. सभी जानकारी अप्रैल २००९ से जनवरी २०१० के बीच में अनद्रू हरिस द्वारा और सावित्री मेधातुल के सहयोग से एकत्र की गयी है.">Both flyovers and skywalks have become a highly visible feature of Mumbais
recent rapid urbanisation. The number of flyovers increased from 13 in 1997 recent rapid urbanisation. The number of flyovers increased from 13 in 1997
to over 60 by 2009, while the first skywalks were constructed in 2008. Many to over 60 by 2009, while the first skywalks were constructed in 2008. Many
more projects are ongoing and proposed. more projects are ongoing and proposed.</p>
<p>By assembling and categorising photographs, videos, audio-clips and text,
<p class="trans" data-lang_hi="यह वेबसाइट अनद्रू हरिस का यत्न और संजय भांगर का निर्माण है.">By assembling and categorising photographs, videos, audio-clips and text,
this site allows users to explore some of the new and diverse urban worlds this site allows users to explore some of the new and diverse urban worlds
created through flyover and skywalk construction. created through flyover and skywalk construction.</p>
<p>All material was collected between April 2009 and January 2010 by Andrew <p class="trans" data-lang_hi="अनुसंधान का मूलधन यूके की इकोनोमिक एंड सोशल रिसर्च कौंसिल तथा अर्बन लाबरातोरी ऑफ यूनिवर्सिटी कॉलेज, लन्दन ने प्रस्तुत किया है.">All material was collected between April 2009 and January 2010 by Andrew
Harris with the assistance of Savitri Medhatul. The website was devised by Harris with the assistance of Savitri Medhatul. The website was devised by
Andrew Harris and created by Sanjay Bhangar.The research was funded by Andrew Harris and created by Sanjay Bhangar.The research was funded by
the UKs Economic and Social Research Council and the Urban Laboratory of the UKs Economic and Social Research Council and the Urban Laboratory of
@ -91,8 +92,8 @@ University College London.</p>
<div class="contentWrapper questions"> <div class="contentWrapper questions">
{% for key, value in questions.items %} {% for key, value in questions.items %}
<div class="questionWrapper"> <div class="questionWrapper">
<div class="question"> <div class="question trans" data-lang_hi="{{ value.hi }}">
{{ value }} {{ value.en }}
</div> </div>
<div class="answer"> <div class="answer">
<textarea id="{{ key }}"></textarea> <textarea id="{{ key }}"></textarea>
@ -101,11 +102,11 @@ University College London.</p>
{% endfor %} {% endfor %}
<div class="questionWrapper"> <div class="questionWrapper">
Name (optional): <input type="text" id="name" /><br /> <span class="trans" data-lang_hi="नाम (वैकल्पिक)">Name (optional):</span> <input type="text" id="name" /><br />
E-Mail (optional): <input type="text" id="email" /><br /> <span class="trans" data-lang_hi="इ-मेल - (वैकल्पिक)" E-Mail (optional): <input type="text" id="email" /><br />
</div> </div>
<div class="questionWrapper"> <div class="questionWrapper">
<button id="submitQuestions">Submit</button> <button id="submitQuestions" class="trans" data-lang_hi="भेजें">Submit</button>
</div> </div>
</div> </div>
</script> </script>
@ -156,8 +157,8 @@ University College London.</p>
</div> </div>
<div id="buttons"> <div id="buttons">
<span class="navButtons"> <span class="navButtons">
<a class="navButton" href="Javascript:$.noop()" data-target="about" id="aboutBtn">About</a> <a class="navButton trans" href="Javascript:$.noop()" data-target="about" data-lang_hi="विषय" id="aboutBtn">About</a>
<a class="navButton" href="Javascript:$.noop()" data-target="questions" id="questionsBtn">Experiences</a> <a class="navButton trans" href="Javascript:$.noop()" data-target="questions" data-lang_hi="अनुभवें" id="questionsBtn">Experiences</a>
</span> </span>
</div> </div>