Multi language support ( French, Hindi, Chinese, .. )


#1

I am doing code for multi language support. It’s working for German, French and English. but when ever i trying same code for Hindi and Chinese then it’s not working.
my sample code.

 LocalisedStrings * localisedStr;
if(languageSelector->getText().compare(T("English")) == 0)
{
	LocalisedStrings::setCurrentMappings(0);
}
else if(languageSelector->getText().compare(T("Chinese")) == 0)
{
        String filePath = File::getCurrentWorkingDirectory()
       .getChildFile("chi.txt").getFullPathName(); 
		
        File languageFile(filePath);		
	localisedStr = new LocalisedStrings(languageFile);		
	LocalisedStrings::setCurrentMappings(localisedStr);
		
}

My chi.txt file contains
language: Chinese
countries: chi
"User name" = “用戶名”
“Password” = “密碼”

Instead of displaying it in Chinese it displays only squares …

Regards,
Kiran


#2

Is this stuff in a unicode text file? If not, it’ll lose the encoding when it loads it. A good idea would be to do some tracing, to find out at what stage between reading the file and drawing the text it’s going wrong. E.g. could it just be that your font doesn’t actually contain those characters?


#3

Hey,

I am having same issue when i try to load chinese or korean language .... It is showing squares ..

I set mapping text file's encoding as UNICODE .... But still problem continues .. Shall I need to change fonts for such language ?

Can any one put focus on Localization If I want to use Asian languages like Chinese or Korean ? How shall correctly use Localization in application ?

 

Thanks for the help.

 


#4

It's unlikely that you're having any problems with file or string encodings, but you'll need to use a font that actually contains these characters if you want to display them!


#5