How to translate/localize the default UDK GFX Main Menu

After a lot of headaches and watching some action scripts tutorials on youtube, I think I am on the right way.

I found that swf inside upk packages can read variables from ini files using the LoadVars class, however, the ini file must have an absolute path, not a relative one.

So I made this test flash file just to see if I can change the png menus labels by reading the ini files.

This is a simple flash file with 3 elements. The first dynamic text box will print the Language= variable value from the ini file. By the way I made new ini file just for this menu, and since my custom game launcher can edit many ini files at once, so I dont need to use the UDKEngine.ini files, since it has tons of variables and action script may hang trying to read all of these.

I made a new ini file called ScaleformLanguage.ini and placed it in my game’s engine folder D:\AnaIrhabiGame

Inside the flash file, I added the menu labels. For this test I made only one button, Play Game, as a movie clip.

I placed inside this movie clip all 4 versions of the play game button, which are EN, BR, AR and CN, one on each frame.

And on this flash file, in the root level I added this action script which reads the variable of the new custom ini file I created, and it changes the button label image according the value of this ini file variable

var myLV:LoadVars;
myLV = new LoadVars();

myLV.onLoad = function(p_success:Boolean):Void  {
	if (p_success) {

		txt_info.text = myLV.Language;

		if (myLV.Language == "SLO") {
			txt_language.text = "ARABIC";
			btn_play_game_MC.gotoAndStop(1);
		}

		if (myLV.Language == "PTB") {
			txt_language.text = "PORTUGUESE";
			btn_play_game_MC.gotoAndStop(2);
		}

		if (myLV.Language == "CHN") {
			txt_language.text = "CHINESE";
			btn_play_game_MC.gotoAndStop(3);
		}

		if (myLV.Language == "INT") {
			txt_language.text = "INTERNATIONAL";
			btn_play_game_MC.gotoAndStop(4);
		}

	} else {
		txt_info.text = "Error loading file!";
	}
};

myLV.load("D:\\AnaIrhabiGame\\ScaleformLanguage.ini");

And for my surprise, it is working in game :grin:

Each time I change the language value on the ini file, and reload the map, the menu label changes correctly, according the language selected!!!

Now next step will be copy this action script and menus labels to udk assets.fla, which controls the game’s main menu.