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:

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.

Apply the Untranslated non-calculated filter via the Filters 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:

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.

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.

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.

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.

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. 

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