Hi
I am in the process of localising an iOS app I have made. I use the LocalisedStrings class for this.
I have made a method that returns a single string containing the localised versions of the rather few strings that needs to be translated:
String Settings::getLanguage (String language)
{
String r(String::empty);
if (language == "french")
{
r += ("\"preplay note\"=\"préjouer note\"\n");
r += ("\"language\"=\"langue\"\n");
r += ("\"metronome\"=\"métronome\"\n");
r += ("\"restore purchases\"=\"restaurer les achats\"\n");
r += ("\"colors\"=\"couleurs\"\n");
r += ("\"note names\"=\"nom des notes\"\n");
}
return r;
}
I set the current language like this:
translationsFrench = getLanguage("french");
LocalisedStrings* ls;
ls = new LocalisedStrings (translationsFrench,true);
LocalisedStrings::setCurrentMappings (ls);
The problem I run into is when I start adding chinese characters in the getLanguage method like this:
r += ("\"preplay note\"=\"调音\"\n");
Doing so will fail to create a valid string when running the code. I get an assertion in the String class that I am trying to create a string from 8-bit data that contains values greater than 127. I see that this is true, but I am not shure how to do this in and nice and elegant way (as I always expect is possible with Juce ;-))?
Help is highly appreciated
best regards
John Parbo Andersen