From 939469cda3aa66e5cc68b6780f6ee8a8d6152d0f Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Wed, 18 Oct 2017 10:29:18 +0200 Subject: 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. --- spec/helpers/application_helper_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec') 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 -- cgit v1.2.1