diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /doc/development/i18n/externalization.md | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'doc/development/i18n/externalization.md')
-rw-r--r-- | doc/development/i18n/externalization.md | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md index a81e656fc27..bdd372e90ed 100644 --- a/doc/development/i18n/externalization.md +++ b/doc/development/i18n/externalization.md @@ -260,8 +260,22 @@ n_("%{project_name}", "%d projects selected", count) % { project_name: 'GitLab' ### Namespaces -Sometimes you need to add some context to the text that you want to translate -(if the word occurs in a sentence and/or the word is ambiguous). +A namespace is a way to group translations that belong together. They provide context to our translators by adding a prefix followed by the bar symbol (`|`). For example: + +```ruby +'Namespace|Translated string' +``` + +A namespace provide the following benefits: + +- It addresses ambiguity in words, for example: `Promotions|Promote` vs `Epic|Promote` +- It allows translators to focus on translating externalized strings that belong to the same product area rather than arbitrary ones. +- It gives a linguistic context to help the translator. + +In some cases, namespaces don't make sense, for example, +for ubiquitous UI words and phrases such as "Cancel" or phrases like "Save changes" a namespace could +be counterproductive. + Namespaces should be PascalCase. - In Ruby/HAML: @@ -292,7 +306,7 @@ const dateFormat = createDateTimeFormat({ year: 'numeric', month: 'long', day: ' console.log(dateFormat.format(new Date('2063-04-05'))) // April 5, 2063 ``` -This makes use of [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat). +This makes use of [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat). - In Ruby/HAML, we have two ways of adding format to dates and times: |