From 9a71edda6ade439679c38d20bd24ecf2b1f69725 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Fri, 6 Dec 2019 22:56:00 -0500 Subject: [PATCH] docs: translating --> internationlization --- docs/latest/SUMMARY.md | 2 +- .../internationalization.md} | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) rename docs/latest/{essentials/translating.md => viewer/internationalization.md} (98%) diff --git a/docs/latest/SUMMARY.md b/docs/latest/SUMMARY.md index 1009abab0..343ea1f6c 100644 --- a/docs/latest/SUMMARY.md +++ b/docs/latest/SUMMARY.md @@ -6,7 +6,6 @@ - [Installation](essentials/installation.md) - [Data Source](essentials/data-source.md) - [Configuration](essentials/configuration.md) - - [Translating](essentials/translating.md) - [Contributing](contributing/index.md) - [Continuous Integration](continous-integration.md) @@ -16,6 +15,7 @@ - [Viewer](viewer/index.md) - [Configuration](viewer/configuration.md) - [Themeing](viewer/themeing.md) + - [Internationalization](viewer/internationalization.md) - [Extensions](extensions/index.md) - [Registering](extensions/index.md#registering-an-extension) - [Lifecycle Hooks](extensions/index.md#lifecycle-hooks) diff --git a/docs/latest/essentials/translating.md b/docs/latest/viewer/internationalization.md similarity index 98% rename from docs/latest/essentials/translating.md rename to docs/latest/viewer/internationalization.md index e4e9ac9a9..0a665e917 100644 --- a/docs/latest/essentials/translating.md +++ b/docs/latest/viewer/internationalization.md @@ -1,4 +1,4 @@ -# Translating +# Internationalization OHIF supports internationalization using [i18next](https://www.i18next.com/) through the npm package [@ohif/i18n](https://www.npmjs.com/package/@ohif/i18n), @@ -15,7 +15,7 @@ where is the main instance of i18n containing several languages and tools. -### Installing +## Installing ```bash yarn add @ohif/i18n @@ -25,7 +25,7 @@ yarn add @ohif/i18n npm install --save @ohif/i18n ``` -### How it works +## How it works After installing `@ohif/i18n` npm package, the translation function [t](https://www.i18next.com/overview/api#t) can be used [with](#with-react) or @@ -57,13 +57,13 @@ If the translation.json file contains a key that matches the HTML content e.g. --- -#### With React +### With React This section will introduce you to [react-i18next](https://react.i18next.com/) basics and show how to implement the [t](https://www.i18next.com/overview/api#t) function easily. -##### Using HOCs +#### Using HOCs In most cases we used [High Order Components](https://react.i18next.com/latest/withtranslation-hoc) to @@ -86,13 +86,13 @@ export default withTranslation('MyNameSpace')(MyComponent); > [I18nextProvider](#using-outside-of-ohif-viewer) section, `withTranslation` > HOC doesnt works without a I18nextProvider -##### Using Hooks +#### Using Hooks Also, it's possible to get the `t` tool using [React Hooks](https://react.i18next.com/latest/usetranslation-hook), but it requires at least React > 16.8 😉 -#### Using outside of OHIF viewer +### Using outside of OHIF viewer OHIF Viewer already sets a main [I18nextProvider](https://react.i18next.com/latest/i18nextprovider) connected to @@ -119,7 +119,7 @@ usage. --- -#### Without React +### Without React When needed, you can also use available translations _without React_.