Blogs

Gary's Blog

XAF – Module Localizations Stored in Satellite Assemblies (Coming in V2010 Vol 2)

     

In previous versions of XAF the support for localization was not perfect. The culture-specific resources of each module were stored in the module’s assembly, and it was impossible to localize them without rebuilding. As the default XAF modules are available only in English, you had to localize strings, supplied with the modules, in each new application. These included strings like: captions of classes and properties from the Business Class Library, captions of actions supplied with the System Module, validation messages, exceptions messages, etc. To put it bluntly, this was a PITA.

As we all know, the .NET Framework provides a common way of storing the culture-specific strings in satellite assemblies. The MSDN states that the satellite assembly is “A .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user elects to view the application in that language.

Previously, you could localize the DevExpress components, used in your XAF application, via the satellite assemblies. Now this approach is also available with XAF modules too!

To support the satellite assemblies in XAF modules, we made the following changes:

Firstly, the naming convention for the XML file storing the localization differences of the modules was changed. For instance, the Model.DesignedDiffs_de.xafml file is now called Model.DesignedDiffs.Localization.de.xafml. With this convention, Visual Studio places this resource in the satellite assembly automatically. Note the naming convention for user and application difference files remains the same.

Next the algorithm for obtaining the list of languages, available in the Model Editor, was changed. Now, the list can be retrieved from these sources:

1) The Languages key from the configuration file’s appSettings section:

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <appSettings>

    <!-- ... -->

    <add key="Languages" value="en;de;fr" />

    <!-- ... -->

  </appSettings>

The value of this key consists of available language codes, separated by the semicolon.

2) From the current project/application differences file names.

When the Model Editor is invoked as the Visual Studio designer, only the second source is available. At runtime, these sources are joined. So, if there are no differences for a certain language, but this language is added in the configuration file, then this language can be specified as preferred, and the values stored in the corresponding satellite assembly will be used in the UI.

Note, to load the localized property values from the satellite assembly, the Model Editor or the application must be restarted:

Languages Manager Restart Dialog

Some of our customers have kindly provided translations for ready-to-use satellite assemblies, you can find these assemblies attached to The collection of localized DevExpress assemblies KB article. At the moment there are no V10.2 satellite assemblies, but they will be there shortly after release. This means that you’ll be able to get satellite assemblies for XAF modules and DevExpress components, used in your application. After installing them, and adding the target language with the Model Editor, you’ll see the translated values, leaving you to translate only your custom strings with the Localization Tool.

Localization Tool

Of course, if you don’t like the supplied translations, you can modify them. Smile

If there are no ready-to-use XAF satellite assemblies for your language, you can create the translations with the Localization Tool. To reuse the translations in the future, you can export them to a CSV file. When localizing new applications, you can import the localization from this file. If you can send this CSV file to us, we’ll build satellite assemblies, based on your translations, and share them so that you and other customers will be able to use them in the future. How’s that for service, eh?

Note that when deploying your application, you should deploy the required satellite assemblies to the client’s machine too. When using the XCopy deployment approach, you should either put the satellite assemblies in the application folder’s subfolder (e.g. MainDemo/de), or register them in GAC.

The benefits of this new approach are:

  • Standard XAF modules can be localized simply by downloading and installing the satellite assemblies from the KB article mentioned above.
  • You can create the satellite assemblies for your custom XAF modules easily.
  • You can add new languages to the deployed application without the necessity to recompile and reinstall it.
  • You won’t experience any inconvenience due to these changes when migrating to a new XAF version, as the Project Converter will rename language-specific difference files and add the required languages to the configuration file.

Well that’s all for this post, until next time, happy XAF’ing. Open-mouthed smile

Published Sep 28 2010, 02:41 PM by Gary Short (DevExpress)
Filed under: ,
Technorati tags: v2010.2, XAF
Bookmark and Share

Comments

 

Nate Laff said:

awesome! my xaf app is going to potentially be translated into a few different languages in the near future, so this, plus the previous post about the translation tool will help a lot!

September 28, 2010 10:35 AM
 

daniel weisel said:

Great work guys and gals, definitely I will use it in the near future.

Gary, I can't wait for the next version to be released, especially after all your recent posts. But - I'm waiting for two major posts that didn't appear yet: the final release of the DC technology, and the property level security. Do you have any news regarding those two?

Thanks, and great posts!  :-)

September 28, 2010 11:40 AM
 

Gary Short (DevExpress) said:

@Daniel, I'll get in touch with the team and see what's happening.

September 28, 2010 11:50 AM
 

Nate Laff said:

Also, what happened to Workflow? :)

September 28, 2010 1:02 PM
 

Pietro Allegretti said:

And to instance level security?

September 28, 2010 2:33 PM
 

Pietro Allegretti said:

No news BAD news?

October 4, 2010 10:57 AM
 

Gary Short (DevExpress) said:

@Daniel, @Pietro, Field level security will not be shipped with 10.2, however work is being done on it and so it should be in a release probably in the 11.X timeframe.

With regard to DC technology, that shipped with 10.1 and there will be a new demo application in 10.2 which will showcase its use.

@Nate, WF will not be supported at 10.2 due to the fact that it requires .Net 4.0 and we wish to keep .Net 2.0+ support with XAF. However there will be a new State Machine Module available probably in the 11.X timeframe that should have some of the capability that you are looking for.

October 4, 2010 11:42 AM
 

Pietro Allegretti said:

It's all clear now.

I'm reading again the Roadmap 2010:

"For XPO, we recognize that it needs improvements in various areas. To support Silverlight applications in particular, we shall be adding a new data transport layer in the first half of the year, which will evolve to a middle tier in the second."

and than

"Instance and field-level security will be made available in the second half of the year, building on the implementation in XPO from the first half. Workflow support is another area we’ll be providing support for: a basic workflow engine in the first half and WF4 support in the second."

the n-tier support, the instance and field level security... only words?!

in the 2010.2 you will have released NOTHING was on the roadmap, (but you will release SP integration ... that wasn't on the roadmap).

I think every subscirber of your product should be a professional developer, companies who rely on their supplier to plan projects and new functions on their software.

Do you think you are working professionally and with the full respect of your customers who continue to subscribe to your products? particularly referring to XPO product?

Regards

Pietro

October 5, 2010 3:20 AM
 

Dennis (DevExpress Support) said:

Thanks for the feedback. I understand your frustration as a customer, but I can only ask you not to judge about the whole 10.2 release when there is a month or so left before the final release. There will be further announcements, blogs, etc. with regard to XPO and other products. Thanks for your patience.

P.S.

BTW, all the planned improvements with regard to XPO are already introduced in the product even starting from 10.1 (undocumented), and they were further polished in 10.2. The only missing part is the implementation (actually, rewriting of the existing security system) on the XAF side that will utilize these improvements. Gary already elaborated on this above.

October 5, 2010 7:06 AM
 

Randy Smith2 said:

Hey, this looks great! I've got a question about how using satellite assemblies will effect default language settings.

I would really like to put _all_ my localizable text into satellite assemblies, default language (English) or otherwise. Will there be some way of setting the default as the satellite assembly built from Model.DesignedDiffs.Localization.en.xafml, and then superimposing the user's language assembly (similar to how localizations are currently defaulted from Model.DesignedDiffs.xafml / Model.xafml, with Model.DesignedDiffs_de.xafml superimposed on top)?

Thanks!

- Andrew

November 4, 2010 6:02 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.