Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Automatic Localization

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
JM Software



Joined: 18 Oct 2008
Posts: 1
Location: France

PostPosted: Sat Oct 18, 2008 1:03 pm    Post subject: Automatic Localization Reply with quote

I need to display the dialog boxes and licensing messages in French or English depending on user's cultureInfo.
In other words, I need to tell my application to use License.resources.fr when the user's culture is French and use License.resources in all other cases.
I want to compile a single installation package for both languages (not two).
Is there is simple way to do this by adding a couple of lines ?
Which ones?
Thanks,

Jean-Marie
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Oct 18, 2008 10:36 pm    Post subject: Reply with quote

Quote:
I want to compile a single installation package for both languages (not two). Is there is simple way to do this by adding a couple of lines ?


If you are including the licensing classes in your own application then this is the same process as for localizing the rest of your application. Add the required. For forms you can use the Visual Studio designer to add (and edit the language required. For the string resources you add the LicenseResources.fr.resx to your project as an embedded resource.

Then all you need to do is to set the Thread UICulture to the current Culture in your main program before forms are displayed. The resources will then be loaded in the most appropriate culture eg

Code:
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;


If you are localizing your application then you should consider our Globalizer.NET product as this makes localizing much easier then using Visual Studio alone. We are looking for a French translator for this product at the moment. If you are interested you could receive a free license for Globalizer.NET. Email us at support@infralution.com if you are interested.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
CADbloke



Joined: 07 Jan 2016
Posts: 25
Location: Sydney

PostPosted: Sat Oct 13, 2018 9:28 am    Post subject: Reply with quote

10 years later I found an edge case problem with this...

I use ILS in an AutoCAD plugin, I'm in Australia so my system culture is en-au. AutoCAD (v2017) doesn't have an en-au resource set so it sets its culture to en-us. If my plugin sets it back to en-au I get exceptions from AutoCAD like
Code:
System.IO.FileNotFoundException: Could not load file or assembly 'AcCustomize.resources, Culture=en-AU' or one of its dependencies. The system cannot find the file specified.

so watch out for that one, just in case you're running inside a host application that doesn't understand there is a whole world out there that speaks better English than they do.
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Oct 14, 2018 10:23 pm    Post subject: Reply with quote

Is the AcCustomize.resources part of your code or Autocad?

Are you setting the CurrentUICulture to the CurrentCulture as described previously in this topic?

It looks like Autocad (or perhaps you) is doing something slightly unusual and are loading files directly based on the CurrentUICulture without handling the possibility that this could be set to values that you don't have resources for.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group