Permalink
Browse files

Added i18n support and german translation

  • Loading branch information...
zahlenhelfer committed Feb 7, 2012
1 parent 96c9d08 commit d3061ca09d3888e75622ae6ccdd1ed04a3bf17a2
View
@@ -1 +1,3 @@
tmp
+
+build/*
View
@@ -18,7 +18,7 @@ var windowDrink = Ti.UI.createWindow({
top : 0,
left : 0,
backgroundColor : 'black',
- title : 'BeerShift',
+ title : L('winDrink'),
barImage : 'images/navbar.png'
});
@@ -44,7 +44,7 @@ var labelBeerName = Titanium.UI.createLabel({
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- text : 'Beer Name: '
+ text : L('lblBeerName')
});
// Add our search label to the view we created above
view.add(labelBeerName);
@@ -62,7 +62,7 @@ var tfBeerName = Ti.UI.createTextField({
fontWeight : 'bold'
},
returnKeyType : Ti.UI.RETURNKEY_DONE,
- hintText : 'What am I drinking?'
+ hintText : L('tfBeerName')
});
// Add an event listener so when the user enters return or done
@@ -80,7 +80,7 @@ windowDrink.add(view);
// Create our tabs and subwindows
var drinkTab = Ti.UI.createTab({
icon : 'images/icon-drink.png',
- title : 'Drink',
+ title : L('tabDrink'),
window : windowDrink
});
var windowDrank = Ti.UI.createWindow({
@@ -90,7 +90,7 @@ var windowDrank = Ti.UI.createWindow({
left : 0,
backgroundColor : "black",
url : 'drankWindow.js',
- title : 'Drank',
+ title : L('winDrank'),
barImage : 'images/navbar.png'
});
var windowFirehose = Ti.UI.createWindow({
@@ -100,12 +100,12 @@ var windowFirehose = Ti.UI.createWindow({
left : 0,
backgroundColor : "black",
url : 'firehoseWindow.js',
- title : 'Keg Stand',
+ title : L('winFirehose'),
barImage : 'images/navbar.png'
});
var drankTab = Ti.UI.createTab({
icon : 'images/icon-drank.png',
- title : 'Drank',
+ title : L('tabDrank'),
window : windowDrank
});
var windowSettings = Ti.UI.createWindow({
@@ -115,18 +115,18 @@ var windowSettings = Ti.UI.createWindow({
left : 0,
backgroundColor : "black",
url : 'settingsWindow.js',
- title : 'Settings',
+ title : L('winSettings'),
barImage : 'images/navbar.png',
mainTabGroup : tabGroup
});
var fireHouseTab = Ti.UI.createTab({
icon : 'images/icon-firehose.png',
- title : 'Keg Stand',
+ title : L('tabFireHouse'),
window : windowFirehose
});
var settingsTab = Ti.UI.createTab({
icon : 'images/icon-settings.png',
- title : 'Settings',
+ title : L('tabSettings'),
window : windowSettings
});
@@ -5,7 +5,7 @@ function createDetailWindow(e) {
top : 0,
left : 0,
backgroundColor : 'black',
- title : 'Beer Details',
+ title : L('winBeerDetails'),
barImage : 'images/navbar.png'
});
@@ -82,7 +82,7 @@ function createDetailWindow(e) {
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- text : 'Drink It!'
+ text : L('lblDrinkTheBeer')
});
labelDrinkTheBeer.addEventListener('click', function(e) {
@@ -10,7 +10,7 @@ function populateTableWithBeer(windowType) {
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- text : 'Loading......'
+ text : L('lblLoading')
});
view.add(labelLoading);
@@ -53,7 +53,7 @@ view.add(labelLoading);
_title: response[i].beer
});
//title label
- var titleLabelText = response[i].username + " drank " + response[i].beer;
+ var titleLabelText = response[i].username + L(titleLabelText) + response[i].beer;
if (windowType == 'drank') {
titleLabelText = response[i].beer;
}
@@ -50,7 +50,7 @@ var labelUsername = Titanium.UI.createLabel({
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- text : 'Username: '
+ text : L('lblUsername')
});
view.add(labelUsername);
@@ -67,7 +67,7 @@ var tfUsername = Ti.UI.createTextField({
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- hintText : 'BeerShift Username'
+ hintText : L('tfUsernameHintText')
});
// fill the username textfield with the existing username
@@ -88,7 +88,7 @@ var labelPassword = Titanium.UI.createLabel({
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- text : 'Password: '
+ text : L('lblPassword')
});
view.add(labelPassword);
@@ -105,7 +105,7 @@ var tfPassword = Ti.UI.createTextField({
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- hintText : 'password'
+ hintText : L('tfPasswordHintText')
});
view.add(tfUsername);
@@ -143,7 +143,7 @@ function loginUser(e) {
fontFamily : 'Helvetica',
fontWeight : 'bold'
},
- text : 'Authenticating'
+ text : L('lblAuthenticating')
});
view.add(labelAuthenticating);
@@ -198,8 +198,8 @@ function loginUser(e) {
labelAuthenticating.visible = false;
// Show an alert telling the user the password is not correct
var alertDialog = Titanium.UI.createAlertDialog({
- title : 'Bad Password',
- message : 'Password is not correct for this user'
+ title : L('alrtDialogTitle'),
+ message : L('alrtDialogMsg')
});
alertDialog.show();
buttonLogin.visible = true;
View
@@ -5,7 +5,7 @@ function createDrankDetailWindow(e) {
top : 0,
left : 0,
backgroundColor : 'black',
- title : 'Beer Details',
+ title : L('winBeerDetails'),
barImage : 'images/navbar.png'
});
View
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+ <string name="lblBeerName">Bier Name: </string>
+ <string name="tfBeerName">Was trinke ich gerade?</string>
+ <string name="tabDrink">Trinken</string>
+ <string name="winDrank">Getrunken</string>
+ <string name="winFirehose">Bier Reihe</string>
+ <string name="tabDrank">Getrunken</string>
+ <string name="winSettings">Einstellungen</string>
+ <string name="tabFireHouse">Bier Reihe</string>
+ <string name="tabSettings">Einstellungen</string>
+ <string name="winDrink">BeerShift</string>
+ <string name="winBeerDetails">Bier Details</string>
+ <string name="lblDrinkTheBeer">Trinken!</string>
+ <string name="lblLoading">Lade......</string>
+ <string name="titleLabelText"> trank </string>
+ <string name="lblUsername">Benutzername: </string>
+ <string name="tfUsernameHintText">BeerShift Benutzername</string>
+ <string name="lblPassword">Passwort: </string>
+ <string name="tfPasswordHintText">Passwort</string>
+ <string name="lblAuthenticating">Authenticating</string>
+ <string name="alrtDialogTitle">Falsches Passwort</string>
+ <string name="alrtDialogMsg">Das Passwort für diesen Benutzer ist nicht korrekt</string>
+ <string name="winBeerDetails">Bier Details</string>
+</resources>
View
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+ <string name="lblBeerName">Beer Name: </string>
+ <string name="tfBeerName">What am I drinking?</string>
+ <string name="tabDrink">Drink</string>
+ <string name="winDrank">Drank</string>
+ <string name="winFirehose">Keg Stand</string>
+ <string name="tabDrank">Drank</string>
+ <string name="winSettings">Settings</string>
+ <string name="tabFireHouse">Keg Stand</string>
+ <string name="tabSettings">Settings</string>
+ <string name="winDrink">BeerShift</string>
+ <string name="winBeerDetails">Beer Details</string>
+ <string name="lblDrinkTheBeer">Drink It!</string>
+ <string name="lblLoading">Loading......</string>
+ <string name="titleLabelText"> drank </string>
+ <string name="lblUsername">Username: </string>
+ <string name="tfUsernameHintText">BeerShift Username</string>
+ <string name="lblPassword">Password: </string>
+ <string name="tfPasswordHintText">password</string>
+ <string name="lblAuthenticating">Authenticating</string>
+ <string name="alrtDialogTitle">Bad Password</string>
+ <string name="alrtDialogMsg">Password is not correct for this user</string>
+ <string name="winBeerDetails">Beer Details</string>
+</resources>
View
@@ -8,7 +8,7 @@
<target device="android">true</target>
<target device="blackberry">false</target>
</deployment-targets>
- <sdk-version>1.8.0.1</sdk-version>
+ <sdk-version>1.8.1</sdk-version>
<id>com.onopenshift.beershift</id>
<name>BeerShift</name>
<version>1.0</version>

0 comments on commit d3061ca

Please sign in to comment.