Support forum of the software localization tool Sisulizer


.NET, Delphi, ... - Sisulizer Localization Tool Support Home

Get in contact with the makers of Sisulizer.
Our forum is open for all questions around Sisulizer from customers and prospects.
Don't hesitate to register and ask. The Sisulizer team will answer ASAP.

Search     Help Home Sisulizer Website Download
Search by username
Not logged in - Login | Register 

 Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius
New Topic Reply Printer Friendly
Silverlight 4 : how to switch language - Bugs and Quirks in Sisulizer - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support
AuthorPost
 Posted: Fri Sep 10th, 2010 03:12 pm
PM Private Upload Quote Reply
polyright
Member
 

Joined: Fri Sep 10th, 2010
Location:  
Posts: 5
Status: 
Offline
Hello,

I'm trying Sisulizer with a VisualStudio 2010 Silverlight 4 project.

Sisulizer generate dll and xap in a separate folder for each language. Preview is perfect (except DateTimePicker in XAML).

1. How can I change language in the app?

I try :
  Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture;

in the app constructor.

but that do not change the language.

2. Can I change language by runtime?


Is it possible to generate a xap with all language (and not many xap).

Thanks

Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 10th, 2010 03:17 pm
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2115
Status: 
Offline
Hi,

Sorry, there is no way to change the language in Silverlight at runtime. This is a limitation of Silverlight and not Sisulizer.

All you can do is to change the language outside your code (e.g. using JavaScript) and force your Silverlight app to reload in the new language.

We are trying to find a way to overcome this limitation. Right now we do not have a workaround that is working reliable.

Sorry for not having better news

Markus



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 10th, 2010 03:27 pm
PM Private Upload Quote Reply
polyright
Member
 

Joined: Fri Sep 10th, 2010
Location:  
Posts: 5
Status: 
Offline
Hi,

This is a limitation of Silverlight and not Sisulizer.
This is more because Sisulizer generate separate DLL, come on ! :cool:

But you didn't answer my first question, how to simply switch to a language at startup? That silverlight auto-select the good DLL and XAP depending by culture? What the best switch method?



Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 10th, 2010 03:43 pm
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2115
Status: 
Offline
Sisulizer follows the Silverlight standards. The old Windows resources could be multi-language. But in .NET and Silverlight each language gets its own language DLL. Sorry, but we really can not overcome that limitation. In Silverlight all these languages will be placed in the same XAP file. You can change the XAP extention to ZIP and look into it. You will see that there are sub-folders with the language files in it. The same structure a .NET standalone app will use.

To switch the language at start-up you can use this JavaScript in your HTML

// Language switch script for Silverlight function CultureChange (culture) { document.getElementById("sl1").settings.culture = culture; document.getElementById("sl1").settings.uiculture = culture; // Reloads the control with the new settings document.getElementById("sl1").Source = document.getElementById("sl1").Source; }
 


The last line might look odd. But it is needed to actually re-load the element.

You then call that e.g. from a combo box and a button

<form name="cc_f1"> <select name="cc_s1"> <!-- Preselected language --> <option selected value="fi">Finnish</option> <!-- Other languages to switch from --> <option value="de">German</option> </select> <!-- Call to JavaScript function --> <input type="button" name="change" value="Change" onClick="CultureChange(document.cc_f1.cc_s1.options[document.cc_f1.cc_s1.selectedIndex].value)"> </form>


After the Silverlight app is started it made the choice which DLL to use and initialized everything using the strings in that DLL.

We don't know the reason why Microsoft did not implement a way to switch the languages at runtime in Silverlight. It is an often requested feature...

If you find a way how to switch the language - reliable and using MS standards - at runtime in Silverlight don't forget to contact us. We would try to return some favor to you :-)

Markus



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 10th, 2010 03:58 pm
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2115
Status: 
Offline
Hi,

I send you a PM with a download link to a simple sample of language switch.

Markus



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Fri Sep 10th, 2010 04:03 pm
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2115
Status: 
Offline
And last but not least...

Don't forget to check:

Project - Edit Source - <your source> - File - Multilingual file.

This will create one XAP with all the languages you have. The language switch has to be done with the sample code I send you from the surrounding HTML.

Markus



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Mon Sep 13th, 2010 08:47 am
PM Private Upload Quote Reply
polyright
Member
 

Joined: Fri Sep 10th, 2010
Location:  
Posts: 5
Status: 
Offline
that's rock!

Back To Top PM Private Upload Quote Reply

Current time is 08:20 am  
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > Silverlight 4 : how to switch language



WowUltra modified by Sisulizer Copyright © 2007-09 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Sisulizer software localization tool - Three simple steps to localize