On the startup of my application I would like to localize the loadingDialog string for different languages. My application uses Phonegap/Cordova and uses the loadingDialog preference in config.xml to show an loader on startup. (Documentation here.)
Config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.app.app" version="1" xmlns="http://ift.tt/18Fk3Vk" xmlns:cdv="http://ift.tt/1cHnIYX">
<preference name="loglevel" value="DEBUG" />
<preference name="AndroidLaunchMode" value="singleTop" />
<preference name="LoadingDialog" value="Loading"/>
<preference name="backgroundColor" value="0x00000000" />
[...]
<name>App name</name>
<description></description>
<author email="author@mail.com" href="http://www.website.com">Author</author>
<content src="index.html" />
<access origin="*" />
</widget>
In the /res/ directory I have added 10 languages, including /values/, /values-de/ and /values/fr/ and each folder contains a strings.xml document with the following information.
Strings.xml (multiple files)
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">App name</string>
<string name="loading">Loading</string>
</resources>
Now I would like to localize the "Loading" string in config.xml for all languages. I have tried to use the code below, but it simply display's "@string/app_name" as the loading message. Is it possible to localize this string on startup, and if so how?
<preference name="LoadingDialog" value="@string/loading"/>
Loading message with this setting:
Any help would be greatly appreciated. Thank you.
No comments:
Post a Comment