Blogs

Gary's Blog

XAF – New Localization Tool (coming in v2010 vol 2)

     

Localization of an XAF application is not fun. As a developer you have to look through the whole Application Model to find and translate all of the localizable values and, being human, you can only get that wrong by missing something. You could always get a professional translator to do it, but that’s not really practical, as he would have to have Visual Studio and XAF installed. Thankfully, things are going to get much better with the upcoming v2010 vol2 release. Now there will be a Localization action in the Model Editor Toolbar, this will invoke the Localization form. This form provides a grid editor with all of the localizable properties’ names, paths, and values. A toolbar with the set of actions is also provided:

Localization Form

So, what can you do within this form? Well pretty much everything you’d ever need to do to get your application localized:

  • Manually translate all the localizable values.
  • Export the localizable properties’ values to a CSV file and pass it to a professional translator. This file can be viewed and edited in any spreadsheet or plaintext editor.
  • Import the CSV file with the translations.
  • Reuse the CSV, file with common localizable values, in other XAF applications.
  • Perform an automatic translation using the Google Translate service.
  • Apply sorting and filters. There are several predefined filters, and you can specify a custom one.

Okay, let’s have a closer look at some of these features. Here, we assume that the target language aspect and localizable resources are already added to the Application Model (see the Localization help topic).

Manual Localization

To manually localize a value, via the form, do the following:

In the Localization form, select the target language via the Translation Language action.

Select Translation Language Action

Apply the Untranslated non-calculated filter via the Filters action.

Filter Action

This filter selects properties which have no localized values, except for those whose values are calculated based on other values. For instance, OwnMembers node’s Caption properties will be displayed, and Columns node’s Caption properties will be hidden.

Translate all the values in the Translated Value column. Pressing the ENTER key moves the focus to the next row. If there are several properties with the same Default Language value, the Copying dialog is displayed after pressing ENTER:

Copying Dialog

If you choose Yes, all these values will be translated at once, and the next value to be translated will be given the focused. The “Use always” checkbox allows you to skip this dialog for the next time. This setting will be in effect until you close the Localization form. Note that the Is Translated value is not changed instantly, this allows us to avoid applying the filter to values that have just been translated. Is Translated will be modified after saving changes.

When you have finished with the translation, click Save or press CTRL+S to pass the changes to the Model Editor. The translated properties’ Is Translated checkbox becomes checked after saving.

Localization Save

Now you can click Reload, to reload values from the model, and apply the Calculated filter to see if there are calculated values to be modified.

Localization Filter

After saving changes and closing the Localization form, you can see the localized values in the Model Editor. Don’t forget to save the changes in the Model Editor!

Import/Export the Localization

The Localization form provides Import and Export actions. These actions can be used in the following scenarios:

If you have hired a professional translator, you can use the Export action to create a CSV file containing the rows, currently selected in the Localization form. This file will include the same columns as you see in the Localization form, except for Is Translated and Is Calculated. You can pass the CSV file to the translator and ask him to edit the values, in the Translated Value column, using a spreadsheet or plaintext editor of his choice.

Localization Import/Export

The translated CSV file can be loaded back via the Import action. This action replaces the current, default and translated values with values found in the specified CSV file. Rows with invalid node path or property name are skipped.

Localization Form

XAF applications have a common localizable values set. You can create the basic localization to be reused in other XAF applications. To do this, create an empty XAF solution, and optionally, add frequently used modules and business classes. Localize this application, and export the localization to a CSV file. Later, you can import the basic localization from this file when localizing XAF applications.

Use the Google Translate Service

If you are not fluent in a target language, and you can’t afford the services of a professional translator, you can use the Google Translate service directly from the Localization form. First, select the values to be translated, then, click the Google Translate action, or press CTRL+G. In the dialog, select the original language and click Translate. The selected values will be passed to the Google Translate service. The values in the grid will be modified with the results from the service. If the translation is time-consuming, the progress bar will be displayed. Of course, an active internet connection is required. Don’t forget that an automatic translation is not perfect and requires manual reviewing. Winking smile

Using Google Translate From The Localization Form

That’s all for this post, until next time, happy XAF’ing! Smile

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

Comments

 

Bert Stomphorst said:

Wow, that's great news!

September 7, 2010 11:00 AM
 

Julien Ferraro said:

Yep, as Bert mentionned, that's a great news. Definitely !

But I guess that we'll not be able to translate the components using such a tool. I already asked for something like this maybe 3 years ago to translate the grid and other components. I did the translation already for the compos I use, but with every new version come new strings ... and I translate them when a customer calls me because he doesn't understand that new text !

I'm not anymore their hero, they know I paid to give them such a powerfull grid ...

September 7, 2010 12:36 PM
 

Joe Hendricks said:

Great feature!

September 7, 2010 4:19 PM
 

Dennis (DevExpress Support) said:

@All:

Thanks for your feedback. It's greatly appreciated!

@Julien:

I guess that you are already using satellite assemblies for localization. If so, then it's already possible to use a similar MissingResourceFinder tool from the A421 KB Article (www.devexpress.com/kb=A421). Please let me know whether this helps you.

September 8, 2010 4:08 AM
 

Julien Ferraro said:

Dennis,

I guess this will do it. I'll give it a try.

Many thanks

Julien

September 8, 2010 8:45 AM
 

Dennis (DevExpress Support) said:

Julien,

thanks for your feedback. Feel free to contact us in case of any further difficulty. We'll be glad to help you.

September 8, 2010 5:21 PM
 

Ralph Rutschmann said:

That looks really great - exactly what I need! :-)

DevEx rules! :-)

Best regards, Ralph

September 10, 2010 3:14 AM
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.