diff options
author | Dennis Tang <dennis@dennistang.net> | 2018-06-12 08:43:46 +0000 |
---|---|---|
committer | Dennis Tang <dennis@dennistang.net> | 2018-06-12 08:43:46 +0000 |
commit | 991a9835ee069334667f6f28d6d7cc154f091d58 (patch) | |
tree | a30cfb9695fac782c1dee52d5445ab12c69e4554 /doc/development/i18n/externalization.md | |
parent | 279077921fd6938c5d0053be4c640c1cbb6afeb3 (diff) | |
download | gitlab-ce-991a9835ee069334667f6f28d6d7cc154f091d58.tar.gz |
Update externalization.md
Diffstat (limited to 'doc/development/i18n/externalization.md')
-rw-r--r-- | doc/development/i18n/externalization.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md index 17e75d996b9..c6d3ff0102e 100644 --- a/doc/development/i18n/externalization.md +++ b/doc/development/i18n/externalization.md @@ -253,17 +253,17 @@ This also applies when using links in between translated sentences, otherwise th Instead of: -```ruby +```haml - zones_link = link_to(s_('ClusterIntegration|zones'), 'https://cloud.google.com/compute/docs/regions-zones/regions-zones', target: '_blank', rel: 'noopener noreferrer') = s_('ClusterIntegration|Learn more about %{zones_link}').html_safe % { zones_link: zones_link } ``` Set the link starting and ending HTML fragments as variables like so: -```ruby +```haml - zones_link_url = 'https://cloud.google.com/compute/docs/regions-zones/regions-zones' - zones_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">' % { url: zones_link_url } -= s_('ClusterIntegration|Learn more about %{zones_link_start}zones%{zones_link_end}').html_safe % { zones_link_start: zones_link_start, zones_link_end: '</a>' } += s_('ClusterIntegration|Learn more about %{zones_link_start}zones%{zones_link_end}').html_safe % { zones_link_start: zones_link_start, zones_link_end: '</a>'.html_safe } ``` The reasoning behind this is that in some languages words change depending on context. For example in Japanese は is added to the subject of a sentence and を to the object. This is impossible to translate correctly if we extract individual words from the sentence. |