From 47aac099cf3338ab883a3dc851a6ad8f58fd7311 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Oct 2023 20:31:52 +0200 Subject: [PATCH 1/6] feature/translations-contribution adding steps on how to contribute a translation --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45008bb7696..7c7ea6f54fe 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,18 @@ Before checking in commits, run `make ci`, which is similar to the `.gitlab-ci.y ### Translating -Help translate Focalboard! The plugin is already translated into several languages. We welcome corrections and new language translations submitted against the [appropriate language JSON file](https://github.com/mattermost/focalboard/tree/main/webapp/i18n) in this repository. +Help translate Focalboard! The plugin is already translated into several languages. We welcome corrections and new language translations submitted against the [appropriate language JSON file](https://github.com/mattermost/focalboard/tree/main/webapp/i18n) in this repository. To add a new language, follow the steps below: + +- Create a new file with the language code (I.E. `en.json`) +- Copy the contents of the en.json file into your newly created file +- Leave the keys in this file as they are and replace all the values with the translated strings +- Go to `webapp/src/constants.ts` and add an entry for the language you are translating into under the **languages** array +- This array needs to consist of three keys: the language code, the name of the language and the display name of the language +- Go to `webapp/src/i18n.tsx`: + - import the json of the language translation you have just added + - Add the language code to the `supportedLanguages` array + - Add another case to the switch case matching the language you added inside `getMessages` + ### Staying informed From f4790e0f1a703e15345d604c65a5a33d39f69cbd Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 29 Oct 2023 20:37:16 +0200 Subject: [PATCH 2/6] feature/translations-contribution added fruther detail of location of json file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c7ea6f54fe..8b8d2541b84 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ Before checking in commits, run `make ci`, which is similar to the `.gitlab-ci.y Help translate Focalboard! The plugin is already translated into several languages. We welcome corrections and new language translations submitted against the [appropriate language JSON file](https://github.com/mattermost/focalboard/tree/main/webapp/i18n) in this repository. To add a new language, follow the steps below: -- Create a new file with the language code (I.E. `en.json`) +- Create a new file with the language code (I.E. `en.json`) inside `webapp/i18n` directory - Copy the contents of the en.json file into your newly created file - Leave the keys in this file as they are and replace all the values with the translated strings - Go to `webapp/src/constants.ts` and add an entry for the language you are translating into under the **languages** array From b6efc1f98bb31f88173d8f3cc6e3f991adb261f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Oct 2023 08:45:52 +0200 Subject: [PATCH 3/6] feature/translations-contribution updating snapshots --- .../cardDetail/__snapshots__/comment.test.tsx.snap | 12 ++++++------ .../__snapshots__/updatedTime.test.tsx.snap | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap b/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap index d0867401345..689512b022a 100644 --- a/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap +++ b/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap @@ -19,7 +19,7 @@ exports[`components/cardDetail/comment return comment 1`] = `
- June 15, 2021, 4:22 PM + June 15, 2021 at 4:22 PM
`; From 43fb1b77c7e18f1cc8512d78d57877c814efc003 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Oct 2023 08:54:10 +0200 Subject: [PATCH 4/6] feature/translations-contribution adding step to run updating snapshot command --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8b8d2541b84..ec34c2ac76b 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ Help translate Focalboard! The plugin is already translated into several languag - import the json of the language translation you have just added - Add the language code to the `supportedLanguages` array - Add another case to the switch case matching the language you added inside `getMessages` +- Once you are done, you need to update the snapshot by using this command `npm run updatesnapshot` ### Staying informed From 612213447bde4640758c718c072b92e7e3676050 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Oct 2023 21:33:36 +0200 Subject: [PATCH 5/6] feature/translations-contribution reverting snapshot changes --- .../cardDetail/__snapshots__/comment.test.tsx.snap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap b/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap index 689512b022a..d0867401345 100644 --- a/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap +++ b/webapp/src/components/cardDetail/__snapshots__/comment.test.tsx.snap @@ -19,7 +19,7 @@ exports[`components/cardDetail/comment return comment 1`] = `
Date: Mon, 30 Oct 2023 21:35:56 +0200 Subject: [PATCH 6/6] feature/translations-contribution reverting snapshot changes --- .../updatedTime/__snapshots__/updatedTime.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/properties/updatedTime/__snapshots__/updatedTime.test.tsx.snap b/webapp/src/properties/updatedTime/__snapshots__/updatedTime.test.tsx.snap index d9bd5c6177f..49d21208032 100644 --- a/webapp/src/properties/updatedTime/__snapshots__/updatedTime.test.tsx.snap +++ b/webapp/src/properties/updatedTime/__snapshots__/updatedTime.test.tsx.snap @@ -5,7 +5,7 @@ exports[`properties/updatedTime should match snapshot 1`] = `
- June 15, 2021 at 4:22 PM + June 15, 2021, 4:22 PM
`;