This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'app_heading' : 'Hello', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildAllLanguages(){ // Takes the language files & builds them into an object | |
var ret = new Object(); | |
for (var i=0; i<languages.length; i++){ | |
var clIndex = languages[i]; // Current language index: Language identifier string, e.g. "en_gb" | |
var clValue = this[clIndex]; // Current language value. Look for a global by the name clIndex, e.g. this["en_gb"] | |
ret[clIndex] = clValue; // Append this to our return object with the clIndex as the array key, e.g. ret[en_gb] = clValue; | |
} | |
return ret; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lang; | |
var languages = ["en_gb", "en_us", "en_ie", "fr"]; | |
var def = "en_gb"; // default language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var en_gb = { | |
// Welcome strings | |
'app_heading' : 'Welcome', | |
'app_introduction' : 'This tutorial shows how we can easily create a multi-lingual application.' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<h1 id=”app_heading”></h1> | |
<p id=”app_introduction”></p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Language scripts --> | |
<script type="text/javascript" src="js/utils_lang.js"></script> | |
<script type="text/javascript" src="js/lang/en_gb.js"></script> | |
<script type="text/javascript" src="js/lang/en_ie.js"></script> | |
<script type="text/javascript" src="js/lang/en_us.js"></script> | |
<script type="text/javascript" src="js/lang/fr.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bind the callback for when the map page is shown | |
$("#map").live( "pageshow", function(event, ui){ | |
//Let the maps_div fill the full area available | |
var mpageHeight = $("#map").height(); | |
var mHeaderHeight = $("#map .ui-header").height(); | |
var mapH = mpageHeight - mHeaderHeight | |
$("#maps_div").css("height", mapH + "px"); | |
$("#maps_div").css("width", "100%"); | |
// Show the map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- jQuery Mobile Styles --> | |
<link type="text/css" rel="stylesheet" href="resources/css/jquery.mobile.1.0a4.1.css"/> | |
<!-- Main page --> | |
<div id="main" data-nobackbtn="true" data-role="page"> | |
<div data-role="header"> | |
<h1>Mapping Example</h1> | |
</div> | |
<div data-role="content"> | |
<a href="#map" data-role="button">Show Placemarks</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var menu = [ | |
{ | |
title: 'Placemarks', | |
items: [ | |
{ | |
text: 'Show Placemarks', | |
ui_type: 'button', | |
handler: 'map.show' | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Required Sencha files --> | |
<link type="text/css" rel="stylesheet" href="resources/css/sencha-touch.css"/> | |
<script type="text/javascript" src="resources/sencha-touch.js"></script> | |
<!-- App Files --> | |
<script type="text/javascript" src="script/map.js"></script> | |
<!-- UI Definition --> | |
<script type="text/javascript" src="script/ui_definition.js"></script> | |