From 1e3a12ceb5b3bb570e96066073f65bb27931421a Mon Sep 17 00:00:00 2001 From: Roie Natan Date: Thu, 13 Aug 2020 14:09:45 +0300 Subject: [PATCH 1/4] updated documentation regarding i18next --- docs/4devs.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/4devs.md b/docs/4devs.md index bd92c356a..df859505d 100644 --- a/docs/4devs.md +++ b/docs/4devs.md @@ -30,3 +30,8 @@ For _very_ rough statistics, open devTools -> Network and look at the line that ## Subscriptions and queries For the performance of the app, it is important that we limit the amount of queries and subscriptions that alchemy creates when loading a page. + +## Coding conventions + +- As an ongoing process of adopting language localization, any new static text should be added to a translation file and used via `i18next` internationalization-framework. +Translation files location is under `src/assets/locales/`. \ No newline at end of file From aae7e2376c19f38a2526e59d6c5bd6cbc8856497 Mon Sep 17 00:00:00 2001 From: Roie Natan Date: Sat, 15 Aug 2020 10:37:48 +0300 Subject: [PATCH 2/4] updated with global variables for styling --- docs/4devs.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/4devs.md b/docs/4devs.md index df859505d..aa8c829ad 100644 --- a/docs/4devs.md +++ b/docs/4devs.md @@ -34,4 +34,7 @@ For the performance of the app, it is important that we limit the amount of quer ## Coding conventions - As an ongoing process of adopting language localization, any new static text should be added to a translation file and used via `i18next` internationalization-framework. -Translation files location is under `src/assets/locales/`. \ No newline at end of file +Translation files location is under `src/assets/locales/`. + +- Use global variables for styling. See `src/assets/styles/global-variables.scss`. +We aim to stick to a uniform color palette so add a new color only if it's necessary. \ No newline at end of file From 2a181fe9549eb0c251bf969460bac2e2a34d202e Mon Sep 17 00:00:00 2001 From: Roie Natan Date: Sat, 15 Aug 2020 13:22:22 +0300 Subject: [PATCH 3/4] example added --- docs/4devs.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/4devs.md b/docs/4devs.md index aa8c829ad..eabf43db1 100644 --- a/docs/4devs.md +++ b/docs/4devs.md @@ -34,7 +34,13 @@ For the performance of the app, it is important that we limit the amount of quer ## Coding conventions - As an ongoing process of adopting language localization, any new static text should be added to a translation file and used via `i18next` internationalization-framework. -Translation files location is under `src/assets/locales/`. +Translation files location is under `src/assets/locales/`. After adding your text just import `i18next` and use the translation function: + + ``` + import i18next from "i18next"; + + i18next.t("YOUR TEXT FROM THE TRANSLATION FILE")} + ``` - Use global variables for styling. See `src/assets/styles/global-variables.scss`. -We aim to stick to a uniform color palette so add a new color only if it's necessary. \ No newline at end of file +We aim to stick to a uniform variables palette so add a new one only if it's necessary. \ No newline at end of file From 18375cdb240aacd92e737475cd60194490f172b1 Mon Sep 17 00:00:00 2001 From: Roie Natan Date: Sat, 15 Aug 2020 13:33:17 +0300 Subject: [PATCH 4/4] better example --- docs/4devs.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/4devs.md b/docs/4devs.md index eabf43db1..b6833e1fb 100644 --- a/docs/4devs.md +++ b/docs/4devs.md @@ -36,11 +36,20 @@ For the performance of the app, it is important that we limit the amount of quer - As an ongoing process of adopting language localization, any new static text should be added to a translation file and used via `i18next` internationalization-framework. Translation files location is under `src/assets/locales/`. After adding your text just import `i18next` and use the translation function: + `src/assets/locales/en/translation.json` + + ``` + { + "My text key" : "Lorem ipsum dolor sit amet" + } ``` - import i18next from "i18next"; - i18next.t("YOUR TEXT FROM THE TRANSLATION FILE")} + Your code: + ``` + import i18next from "i18next"; + i18next.t("My text key"")} + ``` - Use global variables for styling. See `src/assets/styles/global-variables.scss`. We aim to stick to a uniform variables palette so add a new one only if it's necessary. \ No newline at end of file