Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-18 11:29:18 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-18 14:10:35 +0300
commit939469cda3aa66e5cc68b6780f6ee8a8d6152d0f (patch)
treefb3639c1f23922bf073479f591ad3c52ecdba206 /spec/helpers/application_helper_spec.rb
parentf69b54682fc1770a73c528032b1a86f3e7d547a1 (diff)
Build the locale path with an `_` instead of a `-`
The locale code is turned into an asset path with an underscore instead of a dash. The language codes are transformed by `I18n.locale` into a code with a dash. But the resources for translating are always stored in a path using a `_` separating the language and the region code.
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r--spec/helpers/application_helper_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 87ae1fa5660..66785cf32da 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -309,4 +309,12 @@ describe ApplicationHelper do
end
end
end
+
+ describe '#locale_path' do
+ it 'returns the locale path with an `_`' do
+ Gitlab::I18n.locale = 'pt-BR'
+
+ expect(helper.locale_path).to include('assets/locale/pt_BR/app')
+ end
+ end
end