[TIMOB-5660] MobileWeb: Ti.Locale.getString() method works incorrect.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-28T06:36:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.2 |
Components | MobileWeb |
Labels | n/a |
Reporter | Misha Vasko |
Assignee | Andrew Kulinich |
Created | 2011-06-28T03:44:21.000+0000 |
Updated | 2017-03-03T23:34:19.000+0000 |
Description
Ti.Locale.getString('key','hint') returns the string 'key'. It have to return localization string which corresponds to the key argument or return hint string if there is no such key in localization file([Ti.Locale.getString documentation](http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Locale.getString-method.html)).
var win = Titanium.UI.currentWindow;
win.backgroundColor = '#EEE';
var show = Ti.UI.createButton({
title: 'Show',
left: 90,
top: 10,
width: 140,
height: 45,
fontSize: 20
});
var close = Ti.UI.createButton({
title: 'Close',
left: 90,
top: 60,
width: 140,
height: 45,
fontSize: 20
});
var ta = Ti.UI.createTextArea({
top: 110,
left: 10,
width: 300,
height: 180,
backgroundColor: 'white',
fontSize: 18
});
win.add(show);
win.add(close);
win.add(ta);
close.addEventListener('click', function(){
Titanium.UI.currentWindow.close();
});
show.addEventListener('click',function(){
ta.value = 'Ti.Locale.getString: ' + Ti.Locale.getString('key argument','hint argument') + '\r\n';
// ta.value = ta.value + 'Current country: ' + Ti.Locale.currentCountry + '\r\n';
// ta.value = ta.value + 'Current Locale: ' + Ti.Locale.currentLocale + '\r\n';
});
Closing ticket as MobileWeb is no longer supported.