Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5660] MobileWeb: Ti.Locale.getString() method works incorrect.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-06-28T06:36:15.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.2
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeAndrew Kulinich
Created2011-06-28T03:44:21.000+0000
Updated2017-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';
});

Comments

  1. Lee Morris 2017-03-03

    Closing ticket as MobileWeb is no longer supported.

JSON Source