Skip to content

Instantly share code, notes, and snippets.

@stereoket
Created March 14, 2013 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stereoket/5163607 to your computer and use it in GitHub Desktop.
Save stereoket/5163607 to your computer and use it in GitHub Desktop.
i18n solution if cross platform apps required
// you could create a simple function to check the platform and deploy default lang otherwise use strings.xml
// Call the function with LS("key); instead of L("key");
// You will need to create a switch for each key in the function, but this is temporary
function LS(string) {"use strict";
var str;
if (Ti.Platform.name === 'blackberry') {
Ti.API.log('warn', 'Blackberry detected, string manipulation');
switch(string) {
case "myKey1" :
str = "A Title";
break;
case "mykey2" :
str = "Some Default Label Text";
break;
}
} else {
str = L(string);
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment