Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
locaforum  
#1 Posted : Sunday, May 9, 2010 5:09:21 PM(UTC)
locaforum

Rank: Newbie

Groups: Member
Joined: 4/3/2008(UTC)
Posts: 1

Hello,

I use the php library to add imageUploader to a page.
I'd like to use the iuembed.Localization_xx.js file to change language but I did not manage to do it with php.

Do you know how it can be done ?
Thanks in advance for your help
andreym  
#2 Posted : Monday, May 10, 2010 1:17:33 PM(UTC)
andreym

Rank: Advanced Member

Groups:
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hello!

At first you need to register localization file(s) you needed:
Code:
// PHP server code
$iu->registerClientScripts(array('iuembed.js'
			, 'iuembed.Localization_en.js', 'iuembed.Localization_cs.js'
			, 'iuembed.Localization_de.js', 'iuembed.Localization_fr.js'));


Register client event handler for InitWriter event:
Code:
 // PHP server code
$iu->addClientInitWriter('ImageUploader1_InitWriter');


Add client javascript function ImageUploader1_InitWriter:
Code:
// Client javascript code
function ImageUploader1_InitWriter(writer) {
	//Get the language to apply localization for.
	//In this sample we take lang value from query string
	var lang = window.location.search;
	if (lang.length > 0 && lang.charAt(0) == "?") {
		lang = lang.substr(1);
	}
	switch (lang) {
		case "cs":
			cs_resources.addParams(writer);
			break;
		case "de":
			de_resources.addParams(writer);
			break;
		case "fr":
			fr_resources.addParams(writer);
			break;
		default:
			lang = "en";
			en_resources.addParams(writer);
			break;
	}
}


You can find the whole working sample in the Samples/PHP_Library/Localization/ directory of the Image Uploader installation package.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.