You Are Here:

Community: Wiki

This page was last modified on 8 November 2009, at 22:45.

Flash lite localisation

From Forum Nokia Wiki


THIS ARTICLE IS UNDER CONSTRUCTION

Contents

Basic information

The following is one way of localising texts at runtime. In order for it to work, the SWF needs to be packaged, since the localisation text files will be separate.

Set variables to Dynamic text fields

To be able to switch the texts at runtime, you need to define your texts as dynamic text fields and you need to set a variable for each of them.

  1. Add a dynamic text field (or change the text field to dynamic)
  2. In the field's Properties panel set the Variable field in the Options section to the desired value

Save the localisation data to an external text file

To be able to localise the text properly, the translator need some information. Please make sure you provide enough data for a correct translation to be possible. Also, it is very important to let the translator know how much room the text has on the screen.

You could format the string in the following manner, following the Symbian i18n guidelines.

//d: A descriptive text, describing the use of the text string and it's
//d: dependencies. Should be more than a few words and can extend to several
//d: lines. This must always preceed the actual string definition
//l: Information about the layout use one of the predefined values
&logical_name=The localisation string&

NOTE: all characters, also linebreaks and whitespace between the "equals" sign (=) and the next ampersand (&) will be returned as the value

Detecting the device language and loading the floc file

The following code uses first the fscommand "GetLanguage" to set the value of variable isoLang to the devices language. The returned value may vary a bit, but at least in the S60 5th edition devices the value is <ISO639‑1 language>-<ISO3166‑1 country>. for example en-GB

status = fscommand2("GetLanguage", "isoLang");
loadVariables(isoLang+".floc", _root);

The second line uses the language information to load the variable data to the dynamic text fields. In this example, the file is given an extension .loc but it is not an official file extension...

Example

The following example (Adobe Flash Professional CS4) uses the method described above.

media:FlashLocExample.zip

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fCS001256E5fE2dE5fE4caunchingE5fanE5finstalledE5fapplicationE5finE5fFlashE5fE4citeX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZflashQ qfnZtopicQUqfnTopicZflashE5fliteQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx5E2E0000X