From 42c8bf63670403d3f5cd23091bb56edde7e187c6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 9 Nov 2020 18:09:11 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/development/i18n/externalization.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/development/i18n') diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md index abdaa681230..78caac0d6d5 100644 --- a/doc/development/i18n/externalization.md +++ b/doc/development/i18n/externalization.md @@ -480,6 +480,21 @@ This makes use of [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/do ## Best practices +### Minimize translation updates + +Updates can result in the loss of the translations for this string. To minimize risks, +avoid changes to strings, unless they: + +- Add value to the user. +- Include extra context for translators. + +For example, we should avoid changes like this: + +```diff +- _('Number of things: %{count}') % { count: 10 } ++ n_('Number of things: %d', 10) +``` + ### Keep translations dynamic There are cases when it makes sense to keep translations together within an array or a hash. -- cgit v1.2.1