7 posts / 0 new
Last post
anol
anol's picture
Offline
Mobile Wizard
Joined: 11 Dec 2009
Posts:
Unicode

I want to figure out how to handle localization and non-ascii-characters in MoSync. There might be some information somewhere, but in that case I cannot find it. Nothing on finding out the locale, nothing on UTF-8 or unicode, and nothing on localization of strings.

Lets say I want to make a simple one-screen MAUI application, with a label and some buttons. The label shows the text "Hello" in the language corresponding to the button that was pressed most recently.

So it would look something like this:
+-------+
|Hello |
+-------+
[English]
[Français]
[日本語]
[한국어]
[Русский]

What is the best way to do this with MoSync/MAUI today? Preferably I would want to use something similar to Java (not MIDP) .properites files, with one file for each language, or like the .strings-files on iPhone.

I saw something a little similar to this here: http://www.mosync.com/forum/viewtopic.php?f=18&t=17#p38
But the .string construction in resource files do not support anything else than ascii, do they?

Here are the strings, if someone would be interested in having a go at this:

English:
English
Hello

French:
Français
Bonjour

Japanese:
日本語
こんにちは

Korean:
한국어
안녕하세요

Russian:
Русский
привет

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hello,

MAUI fonts are (Niklas please correct me here if I'm wrong) 7-bit ANSI characters only. There is a more sophisticated string object supported in the API but (I'm pretty sure) still doesn't support multi-byte character sets, so a lot of those languages you want to support will be more difficult.

To do it, other than just with images for the options would (probably) mean having to create a new multi-byte String class which will handle UTF-8 and/or multi-endian UTF-16 data and provide the common operations on it. You'd then have to adapt the Font object to work with the new multi-byte string and produce the correct character. It's not impossible, but it will be fair bit of work.

Is this a big priority for you?

anol
anol's picture
Offline
Mobile Wizard
Joined: 11 Dec 2009
Posts:

Actually currently we only need european languages. I was just wondering if there was a recommended solution to solve localization. I guess there is not. When we need text that requires more than 256 characters we will need to figure something out.

foxybingo
foxybingo's picture
Offline
Joined: 20 Dec 2010
Posts:

Dear Sam
Is there any update on the SDK supported Unicode font?

Makis
Makis's picture
Offline
Mobile Conjurer
Joined: 1 Jun 2011
Posts:

Hello,

I am trying to localize some labels, in the following languages French, German and Greek. I used the instructions in the "Working with Fonts" guide, created a font for the Greek language and it seems to be working. However when i am trying to write a label in French or German i get the message:

"Save could not be completed. Some characters cannot be mapped using "Cp1253" character encoding. Either change the encoding or remove the characters which are not supported by the "Cp1253" encoding."

when i am trying to save the current .cpp file. Then i am prompted to save in UTF-8, doing so though i don't get the appropriate characters on screen.

In the "Font Setting", using the Bitmap Font Generator, choosing the OEM:ANSI, those special characters like à,ç,ö, are included but when using them in labels i get the above error.

Any solution for this problem or alternative method to include French, German and Greek languages in UI, and later into storages would be helpful.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi, what it sounds like you've got is an ANSI font for the languages you want to use, but not ANSI input text. It needs to be UTF-7 not UTF-8 I think. If you download Notepad++ you can paste your text into it, and select it to encode the characters as ANSI text with the correct codepage. You should be able to then copy and paste it into your source file.

Makis
Makis's picture
Offline
Mobile Conjurer
Joined: 1 Jun 2011
Posts:

Hello Sam,

Thanks for the tip, i will give it a try later today.