# ParaView Internationalization

**URL:** https://discourse.paraview.org/t/paraview-internationalization/10399
**Category:** Development
**Tags:** proposal
**Created:** [September 23, 2022, 1:33pm UTC](https://discourse.paraview.org/t/paraview-internationalization/10399 "2022-09-23T13:33:49Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Nicolas\_Boganski](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas_boganski/32/9846_2.png) [@Nicolas\_Boganski](https://discourse.paraview.org/u/Nicolas_Boganski)
#### Post date: [September 23, 2022, 1:33pm UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/1 "2022-09-23T13:33:49Z")

</div>

Hello everyone,

I am currently working on making the ParaView UI translatable. As such, this thread is meant to be a progress update and a forum for your advice!

## Objectives

The scope of this internationalization is to make all translatable strings visible in the base ParaView UI, and let developers translate their plugins and make an easy-to-use community translation workflow. Translations will be made from an online crowd-translation CMS, but we have yet to decide which one to use.

Non-romance languages should, of course, be available, as I will use the most the tools Qt5 has to offer, from build-in method to [translation manager utilities](https://doc.qt.io/qt-5/linguist-manager.html).

Debug messages and logs will not be translated for now.

## String refactoring

I have done a long (and I hope exhaustive) refactoring of strings in the ParaView sources, framing every relevant string inside the tr() method so that Qt searches for a translation in the user language.

### New string good practices

The new proposed good practices would be:

- Strings to be translated should be translated at declaration ! There should not be any tr() around QString variables. Strings with .arg() are valid.

- When inside a QObject-derived class that has the Q\_OBJECT macro; literal strings should be placed inside the [tr()](https://doc.qt.io/qt-5/qobject.html#tr) static method.

- Otherwise strings should be in the [QCoreApplication::translate()](https://doc.qt.io/qt-5/qcoreapplication.html#translate), with the context argument being the containing class or the containing file if outside of any class.

## Implementation progress and concerns

I have used the handy CMake macros of Qt to make Qt generate translation source files (.ts) from source files, subsequently compiling them into a single binary, which I made ParaView load and use.

I have not yet seriously looked into the translations of PV XML files. One solution would be to extract relevant strings using a utility, add them in a cpp header and then let [Qt’s lupdate](https://doc.qt.io/qt-5/linguist-manager.html#using-lupdate) add them to translations.

It has not yet been determined if the translation will be directly included in the ParaView binary release.

### Open questions:

I don’t know if we should use the machine locale to translate at PV startup or leave PV in English at first, and if we should have a rollout menu with available languages or ask users for a translation file with a File Dialog?

Should the .ts translation file be put inside ParaView source or in another repository (like Slicer does)?

And if they are outside of PV sources, should I create a CMAKE variable specifying the ts’ path?

I would love to have your opinions on it!

## Conclusion

If you would like to get involved, you can check my [string refactoring MR](https://gitlab.kitware.com/paraview/paraview/-/merge_requests/5919) and my [CMake translation file generation MR](https://gitlab.kitware.com/paraview/paraview/-/merge_requests/5925) - combining both gives a mostly translatable UI!

For any questions or comments, feel free to reply!

Kind regards,

Nicolas

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [September 24, 2022, 1:40am UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/2 "2022-09-24T01:40:44Z")

</div>

Good effort!

> [@Nicolas\_Boganski](#):
>
> I don’t know if we should use the machine locale to translate at PV startup or leave PV in English at first, and if we should have a rollout menu with available languages or ask users for a translation file with a File Dialog?

I would suggest leaving the UI in English and letting the user select from a drop-down list containing country flag images, so that it is clear which language translations are available and that a country/language combination can be picked.

---

<div class="post-metadata">

### Author: ![Nicolas\_Boganski](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas_boganski/32/9846_2.png) [@Nicolas\_Boganski](https://discourse.paraview.org/u/Nicolas_Boganski)
#### Post date: [September 28, 2022, 7:46am UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/3 "2022-09-28T07:46:05Z")

</div>

I just [merged my string refactor](https://gitlab.kitware.com/paraview/paraview/-/merge_requests/5919) into master !

---

<div class="post-metadata">

### Author: ![timothee.chabat](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee.chabat/32/5729_2.png) [@timothee.chabat](https://discourse.paraview.org/u/timothee.chabat)
#### Post date: [September 28, 2022, 10:13am UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/4 "2022-09-28T10:13:10Z")

</div>

> [@todoooo](#):
>
> I would suggest leaving the UI in English and letting the user select from a drop-down list containing country flag images, so that it is clear which language translations are available and that a country/language combination can be picked.

I agree with this too. As long as we don’t have a wizard installer where one can choose the language this seems the more appropriate solution, though it may slightly increase the size of the release.

> [@Nicolas\_Boganski](#):
>
> I have not yet seriously looked into the translations of PV XML files.

If you have some update on that please let us know ! I think what would be very cool to have is the translation of the help for each filters/readers (this help is generated using the XML file).

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [September 28, 2022, 1:01pm UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/5 "2022-09-28T13:01:06Z")

</div>

> [@todoooo](#):
>
> letting the user select from a drop-down list containing country flag images

Countries are not languages and flags are _bad_ for that. For example, what language does the Indian flag represent? There are 22 languages officially recognized across the country. I suggest just having a list like:

- Français (fr-FR; French)
- Nederland (nl-NL; Dutch)
- American English (en-US; English)
- British English (en-UK; English)
- हिन्दी (hi-IN; Hindi)

with some common formatting in the list.

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [September 28, 2022, 11:38pm UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/6 "2022-09-28T23:38:07Z")

</div>

@ben.boeckel I should have been more specific.

I meant that a flag icon should be shown next to the language name (text) and listed alphabetically as opposed to writing (fr-Fr), (fr-Ca) etc. I thought the “country/language combination” comment would make that clear.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 29, 2022, 1:33am UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/7 "2022-09-29T01:33:14Z")

</div>

> [@timothee.chabat](#):
>
> As long as we don’t have a wizard installer where one can choose the language this seems the more appropriate solution, though it may slightly increase the size of the release.

This may be possible.

---

<div class="post-metadata">

### Author: ![Nicolas\_Boganski](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas_boganski/32/9846_2.png) [@Nicolas\_Boganski](https://discourse.paraview.org/u/Nicolas_Boganski)
#### Post date: [September 29, 2022, 7:30am UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/8 "2022-09-29T07:30:07Z")

</div>

@timothee.chabat I have [an experimental python utility](https://gitlab.kitware.com/nicolas.boganski/paraview-localization) that parses XML labels - or create label from names the same way PV does; and from that generates a C++ header file that [lupdate](https://doc.qt.io/qt-5/linguist-manager.html#using-lupdate) can parse.

I could then tr-ify the `GetXMLLabel()` calls in PV code in order to find the label translations

---

<div class="post-metadata">

### Author: ![Nicolas\_Boganski](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas_boganski/32/9846_2.png) [@Nicolas\_Boganski](https://discourse.paraview.org/u/Nicolas_Boganski)
#### Post date: [October 11, 2022, 9:38am UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/9 "2022-10-11T09:38:01Z")

</div>

I am working on the [CMake integration system](https://gitlab.kitware.com/paraview/paraview/-/merge_requests/5925)

I will also have to do refactor in the Qt folder of ParaView and in the XRInterface plugin because [some conditions uses text labels](https://gitlab.kitware.com/paraview/paraview/-/issues/21583). If you find occurences of this and you don’t want to fix it yourself, please add it at the end of the issue.

---

<div class="post-metadata">

### Author: ![Nicolas\_Boganski](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas_boganski/32/9846_2.png) [@Nicolas\_Boganski](https://discourse.paraview.org/u/Nicolas_Boganski)
#### Post date: [December 20, 2022, 1:22pm UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/10 "2022-12-20T13:22:11Z")

</div>

Hello there,

All MRs have been merged, you can now generate translations source files with the ParaView build system, and load translations binary files from the ParaView settings.

This is completed with [paraview-translations](https://gitlab.kitware.com/paraview/paraview-translations), the official ParaView translations repository, containing the template ts files and soon translations in other languages.

All of the translations process and good practices are documented at [this page](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Utilities/Doxygen/pages/LocalizationHowto.md) and will be available later [in the nightly documentation](https://kitware.github.io/paraview-docs/nightly/cxx/LocalizationHowto.html).

Kind regards,

Nicolas

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [December 20, 2022, 9:39pm UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/11 "2022-12-20T21:39:22Z")

</div>

Well done!

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [December 22, 2022, 9:39pm UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/12 "2022-12-22T21:39:05Z")

</div>

That’s fantastic Nicolas! I put a lot of effort into adapting VTK and Paraview to use utf-8 everywhere, across all platforms, as a prerequisite to internationalisation (note the “s”) 🙂 but I didn’t have time to work on the implementation so I’m glad someone took the initiative.

I wonder if anyone at Kitware will be tracking the number of downloads from countries where English is not the first language as more translation files are added.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 22, 2024, 7:42am UTC](https://discourse.paraview.org/t/paraview-internationalization/10399/13 "2024-04-22T07:42:48Z")

</div>

Discourse anouncement: [Help translate ParaView into your language!](https://discourse.paraview.org/t/help-translate-paraview-into-your-language/12467)

Blog: [https://www.kitware.com/help-translate-paraview-into-your-language/](https://www.kitware.com/help-translate-paraview-into-your-language/)
