Created
March 14, 2013 17:59
-
-
Save stereoket/5163607 to your computer and use it in GitHub Desktop.
i18n solution if cross platform apps required
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
// 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