语言

Menu
Sites
Language
Multilanguage Support

So, I am developing a web app that displays the date/time in text. Since it gets the local date and time from the system, I don't really need to worry about translating. Unfortunately, certain languages like French and Italian make the entire screen show up completely blank. I have a hunch it is because the character sets are not supported by my app, but I've done everything I can to make sure it is encoded with UTF-8, so it should be supported. Also, I think it is worth pointing out that languages like Russian and Greek are working fine. I can't be the only person with with problem, but a million Google searches have come up with no similar problems. Am I just doing something simple wrong? Does anyone have any insight on this?

响应

8 回复
Marco Buettner

Who do you use integrate multilanguage support?

pius lee

French and Italiano is fine on web application with text from http://it.lipsum.com/ and http://fr.lipsum.com/ when I test it.

I think this problem can appear from fonts or unsupported Date methods.

Current tizen 2.3 webkit does not support Date.toLocaleString(), Date.toLocaleDateString(), Date.toLocaleTimeString().

Please check the font and methods.

Jean Yang

Hi,

I am not so clear for you mentioned "Current tizen 2.3 webkit does not support Date.toLocaleString(), Date.toLocaleDateString(), Date.toLocaleTimeString()"

I run these two code segment and result show below

//test
var dateCur = tizen.time.getCurrentDateTime();
var testDate = new Date(2013,6,21,13,12,59,231);
//dateCur.toLocaleString(): Tuesday, 4 August 2015 3:18:09
//dateCur.toLocaleDateString(): Tuesday, 4 August 2015
//dateCur.toLocaleTimeString(): 3:18:09
	
//testDate.toLocaleString(): 21 July 2013 13:12:59 GMT+8
//testDate.toLocaleDateString(): 21 July 2013
//testDate.toLocaleTimeString(): 13:12:59 GMT+8

 

pius lee

If you want only english string, just use toString(), toDateString(), toTimeString()

Locale methods are needed for multi langual strings.

for example.

new Date().toLocaleString('ko-KR');
new Date().toLocaleDateString('it-IT');
new Date().toLocaleTimeString('fr-FR');

Output of upper source is same as toString(), toDateString(), toTimeString().

Why use toLocaleXXXString()? If output is exactly same as toXXXString().

 

Marco Buettner

Why do you use toLocaleString(locale)?

It isnt required to setup the locale manual. If you setup the region of the device it outputs the correct toLocale*String ;)

I use always new Date().toLocaleString() etc and havent see any problems ;)

pius lee

Oops, I could not know about locale function value changed by global setup.

Its my mistake. Locale functions are useful also.

Marco Buettner

Date.toLocale* works fine in Tizen 2.3 o0

Jean Yang

Hi,

I try to found which the different between toDateString() and toLocaleString() and result below.

var testDate = new Date(2013,6,21).toDateString('ko-KR');
//Output: Sun Jul 21 2013

var testDate = new Date(2013,6,21).toLocaleDateString('ko-KR');
//Output: 21 July 2013