Download:

AIR Application:

Please upgrade your Flash Player This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.

Class File:

MLSP.as

Step 1:

step1

First click the “New Project” button. We are building a new project right?

Step 2:

step2

Add languages you will use in your Flex/AIR/Flash project.

Step 3 – 1:

step3

After you added the languages, start to add items.

Step 3 – 2:

step4

ID is very important. It is a unique name for your items. You will use it in your Flex/AIR/Flash projects to get items. (example: class.getItemByID(”home”);)

Step 4:

step5

Ok you added your items. Now save your language file. You will see .mlsp format has a green book icon.

Step 5:

step6

Move your language file to your source files of your project. Or save it to there directly. Now we are ready. With 5 steps we’ve created language file for our project. Now we need to use it in project.

First we need to import MLSP class and set some values:

import gaz.mlsp.MLSP;
var languages:MLSP = new MLSP("demolangfile.mlsp",onComplete);

MLSP has two parameters. First one is language file url(example: “langfile.mlsp”, “lang/langfile.mlsp”) and the second one is loaded function. When language file is loaded your loaded function is called. Let’s continue:

function onComplete():void {
trace("Language File Loaded");
setLanguage()
}
function setLanguage():void {
trace(languages.getItemByID("home","EN"));
trace(languages.getItemByID("home","TR"));
}

When language file is loaded setLanguage function is called. MLSP has only one method. It is getItemByID(). It has two parameters. First one is the id of your item and the second one is language you use.

This is it! Yeah I know this is so simple and not for a complex projects. Or maybe there is more powerful tools for this. Anyway I want to share :)

Also this a sample flex project which uses MLSP:
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)
Source Files

Multi-Language Supporter For Your Flash/AIR/Flex Projects

This AIR application is a simple language file editor. It has its own language file format(.mlsp). Rest of post is a tutorial for beginners.

10 Responses to “Multi-Language Supporter For Your Flash/AIR/Flex Projects”

  1. Lee:

    Thanks Yagiz. This is awesome project!

  2. Thank you Lee :)

  3. Kutlarım yağız sağlam proje =)

  4. Sagolasin Ozgun :)

  5. Mask:

    Yağız keşke “save as” yapsaydın nereye kaydediyor bulmak için epeyce tırmaladım yahu :D
    ama ellerine kollarına sağlık dostum

  6. Onumuzdeki gunlerde belki yeni versiyonunu cikaririm. Ozaman Save As secenegini de eklerim :)

  7. gökhan:

    teşekkürler gayet başarılı Yağız

  8. Tebrikler, güzel bir çalışma olmuş.

  9. @gökhan, @Berkay Ünal: Teşekkürler.

  10. Congratulations for you’ve been selected as an Iphone application developer. We hope to see you in higher ranks, flash master.