Orthanc Multilanguage Menu

Hello!
I have been using Orthanc Server since 2017 and really appreciate how it had improved the radiology services in my location.
Following Sebastian’s idea of giving back, and willing to help worldwide Orthanc adoption, a Multilingual Orthanc Explorer, using Angular Translate, was created.

A small drop-down select with a blue world icon was added to the rightmost extreme of the first page (Lookup) navigation bar.

Available languages are:

English,
Chinese (中文),
Hindi (हिन्दी भाषा),
Spanish (Castellano),
French (Français),
Bengali (বাংলা ভাষা),
Russian (Русский),
Portuguese (Português),

Indonesian (Bahasa),
German (Deutsche),
Japanese (日本語),
Swahili (Kiswahili),
Italian (Italiano) and
Dutch (Nederlandse)

Once a language is selected, the user can close the browser and the system will “remember” the user selection. All different views of the Explorer are instantly refreshed to display the selected language. However, a drawback is that I could not figure out how to show the translations in jQuery dialog and alert boxes, so they both will still appear in English.

The translations were originally done with gettetx and POEDIT. Then a “filter” that looks like this: {{ “Text” | translate }}, was placed in the corresponding fields of the original explorer.html. explorer.js, and query-retrieve.js files (as the filter tags are required by Angular Translate). Plus, two sets of folders were added to the Explorer, one is “libs/angular” and the other one is “languages”, respectively containing the required scripts and the json files used for the translations. Another new file, the angular.translate.app.js, was added to libs.

POEDIT uses Microsoft translate, and to avoid some literal translations, all the words and sentences were carefully reviewed in Google Translate. This is my first approach to web page translations and I had a very fun time doing it, but it was not a professional job, so please do not hesitate to point out any error both in grammar or design.

This is the link to the GitHub repo: https://github.com/Terabuck/OrthancMirror/tree/master/OrthancServer/OrthancExplorer

The languages used are Left to Right. If somebody wants to help in Right to Left languages, and knows how to dynamically switch the .css, any help will always be well received.

Thank you all in advance!

Ludwig
PS: (after some unsuccessful attempts to submit it in Mercurial as indicated in https://book.orthanc-server.com/developers/repositories.html#hg-bundle, I had to go this way)

Some screen captures:

Lookup in Swahili:

Query/retrieve in Chinese:

Upload in Russian:

Instance details in Japanese:

Dear Ludwig,

This is excellent news, thanks for this important contribution!

We can’t directly include your contribution into the source code of Orthanc, as Orthanc Explorer is our low-level interface for development, as explained in the Orthanc Book:
https://book.orthanc-server.com/faq/improving-interface.html

It would however be extremely useful if you could package your version of Orthanc Explorer as an Orthanc plugin:
https://book.orthanc-server.com/developers/creating-plugins.html

Indeed, plugins are precisely designed to fully uncouple third-party contributions from the core of the Orthanc server, allowing independent release cycles. If you don’t master C++, you could use the Python plugin:
https://book.orthanc-server.com/plugins/python.html

In your case, the trick would be to replace the “/app” folder served by Orthanc, by your folder (https://github.com/Terabuck/OrthancMirror/tree/master/OrthancServer/OrthancExplorer). This can be done using the “OrthancPluginRegisterRestCallback()” function in C++, or the equivalent “orthanc.RegisterRestCallback()” in Python:
https://sdk.orthanc-server.com/group__Callbacks.html#ga56dc0abd631bc93cb8e8ee7adea513b6

https://book.orthanc-server.com/plugins/python.html#extending-the-rest-api

You can find examples of C++ plugins in the samples that are part of the Orthanc source distribution:
https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Plugins/Samples/ServeFolders

https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Plugins/Samples/WebSkeleton

If you don’t feel comfortable with creating new plugins, you could also ship your HTML/JS/CSS files using the “ServerFolders” plugin:
https://book.orthanc-server.com/plugins/serve-folders.html

Kind Regards,
Sébastien-

Hi, I am in Taiwan .

and I really need the Chinese in zh_TW

I could prepare for the json file .

but could you give me a hint how to install with this version you modified.

i have read the git data you showed . and use the original docker now. thanks

s.jo...@gmail.com 在 2020年7月9日 星期四上午12:19:01 [UTC+8] 的信中寫道: