Viewers: 🎉Announcement: Internationalization for OHIF Viewer

Created on 2 Jul 2019  Â·  23Comments  Â·  Source: OHIF/Viewers

Quick note! If you use or find this repository helpful, please take the time to star it. It helps us show community adoption and obtain the required funding to keep the project going.

We have recently integrated i18next into the OHIF Viewer and hooked it up with Locize for translation management. Now we need your help to get the app translated into as many languages as possible, and ensure that we haven't missed pieces of the app that need translation. Locize has graciously offered to provide us with free usage of their product.

Once each crowd-sourcing project is completed, I can approve it and merge the changes into the main project. At that point, the language will be immediately available on https://viewer.ohif.org/ for testing, and can be used in any OHIF project. We will support usage through both the Locize CDN and by copying the language directly into the @ohif/i18n package, so that end users can serve the content from their own domains.

Here are a couple examples:

Spanish:
https://viewer.ohif.org/viewer/1.2.840.113619.2.5.1762583153.215519.978957063.78?lng=es

Chinese:
https://viewer.ohif.org/viewer/1.2.840.113619.2.5.1762583153.215519.978957063.78?lng=zh

Portugese:
https://viewer.ohif.org/viewer/1.2.840.113619.2.5.1762583153.215519.978957063.78?lng=pt-BR

Here are some links you can use to sign up to help translate. All you have to do is sign up, translate the strings, and click Save. On our side, we have a dashboard to see how many strings are translated and by whom.

This is a pretty random set of languages, so please post below if you'd like a new language link to be added:

Languages:

Soon we will add a Language Selector in the UI to make it more clear how users can switch languages. For now you have to use ?lng=es in the URL. To get back to English, use ?lng=en.

Thanks! Looking forward to seeing which languages get completed first.

Announcement

Most helpful comment

I corrected some Vietnameses and added Japanese

All 23 comments

Can you post the spanish invitation to Locize?. I want to do little corrections in those files.

Sure, added it above!

@christianvargasforero - Looks like you contributed to the Italian translation, but these words look like they are Spanish to me. Did you click the wrong link?

@christianvargasforero - Looks like you contributed to the Italian translation, but these words look like they are Spanish to me. Did you click the wrong link?

mmm if it was a mistake that I made, without wanting to make the translation into Spanish I did it in Italian by mistake, but I left that project.

I already did the spanish translation on locize. @christianvargasforero
https://github.com/christianvargasforero maybe you can check if that
translation is correct.

El lun., 8 jul. 2019 a las 11:39, Christian Vargas (<
[email protected]>) escribió:

@christianvargasforero https://github.com/christianvargasforero - Looks
like you contributed to the Italian translation, but these words look like
they are Spanish to me. Did you click the wrong link?

mmm if it was a mistake that I made, without wanting to make the
translation into Spanish I did it in Italian by mistake, but I left that
project.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/OHIF/Viewers/issues/618?email_source=notifications&email_token=AAJ5JMHO25CZXQS77DNGNYTP6NNUNA5CNFSM4H4ZYWU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZNPPAY#issuecomment-509278083,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJ5JMFAYCY76QBVJKQBDOTP6NNUNANCNFSM4H4ZYWUQ
.

--
Juan Fco. Del Solar M.

Please add a Vietnamese language link

@lam0620 - Added it above!

I would like to contribute to the portuguese language of brazil, could you add the invitation ??

@lucasmazevedo - Added it above!

I already did the Chinese translation on locize,you can check it now. And I want to add a Language Selector in UI, I just need the English and Chinese . How can I do it? Thanks!

Thanks @MarlonLiu1991! I've imported the Chinese translations into the project. It looks like there were a number of new keys added since the original links were posted, though, so I have had to add some more strings for translation (e.g. for the Study List). I've updated the link above (it's also here.

Thanks so much @lam0620 - I've imported your contributions into the main project, and now they are visible online: https://viewer.ohif.org/?lng=vi - Your site will get this automatically if window.config.i18n.USE_LOCIZE=true;. We will update the @ohif/i18n package so that Vietnamese and the latest Chinese translations are also available for cases where the Locize CDN is disabled.

Hi, I have done the other Chinese translation, and changed some translations exist, for I dont't have proper Chinese words for them, there are also some words haven't been translated

By the way, is there a way to switch Chinese an English display? My project need this function, and it is not convenient to add "?lng=en/zh" after the url

The plan is to add a language selection dropdown in the User Preferences modal, but that modal seems to have been removed during @dannyrb's changes to extensions.

@swederik you can create a task to add it back? Biggest issue is around changes needed to support updating hotkeys in new setup. You can simply remove those pages of the modal instead of the modal entirely?

@swederik Thanks for donging this, I can use some simple method by refreshing the page, and it works. But I have a problem now, for example, I changed the "Angle": "角度" to "Angle": "角" in Button.json, after reloading the page it still display"角度“ rather than "角". In other words, it can't change anything just change the Button.json file, do I need to modify other files or I did it in wrong way?Thanks!

So right now the @ohif/i18n package needs to be rebuilt and the main viewer
needs to use the updated version. It's kind of a pain right now but
@dannyrb is working on improving this so . You can use yarn link or yalc to
link the packages so it's a bit easier.

On Thu., Aug. 1, 2019, 11:25 a.m. MarlonLiu1991, notifications@github.com
wrote:

@swederik https://github.com/swederik Thanks for donging this, I can
use some simple method by refreshing the page, and it works. But I have a
problem now, for example, I changed the "Angle": "角度" to "Angle": "角" in
Button.json, after reloading the page it still display"角度“ rather than "角".
In other words, it can't change anything just change the Button.json file,
do I need to modify other files or I did it in wrong way?Thanks!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/OHIF/Viewers/issues/618?email_source=notifications&email_token=AAEUMMKVPATWMXX3AU2FNDLQCKTZTA5CNFSM4H4ZYWU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3J6V7Q#issuecomment-517204734,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEUMMJKABR3SBBAHI4V7PDQCKTZTANCNFSM4H4ZYWUQ
.

I corrected some Vietnameses and added Japanese

@swederik Thanks for your reply, but so far I don't know how to implement it in the details. I will correct some words' translation in future on the locize

@swederik I changed some translations of words , but when I rebuild the ohif/i18n package an error occurred: [!] (json plugin) SyntaxError: Unexpected token  in JSON at position 0
srclocaleszhCommon.json
SyntaxError:
Unexpected token  in JSON at position 0
at JSON.parse ()
at Object.transform (D:MRI_DISPLAYOHIFOHIF_NEW _testViewersextensionsohif-i18nnode_modulesrollup-plugin-jsonsrcindex.js:14:26)
at Promise.resolve.then (D:MRI_DISPLAYOHIFOHIF_NEW _testViewersextensionsohif-i18nnode_modulesrollupdistrollup.js:15429:25)

I'd like us to create more formal documentation for this, and then close this issue. Marking as triage so we can discuss requirements for docs.

This post will remain pinned, but I'm going to close it to take it off our "backlog". We've scoped some documentation tasks to help make consuming/contributing to translations in this issue:

https://github.com/OHIF/Viewers/issues/880

Was this page helpful?
0 / 5 - 0 ratings

Related issues

christianvargasforero picture christianvargasforero  Â·  3Comments

panzhengo1 picture panzhengo1  Â·  3Comments

ranasrule picture ranasrule  Â·  4Comments

ohif-bot picture ohif-bot  Â·  3Comments

pieper picture pieper  Â·  3Comments