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>2018-08-16 15:15:54 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-08-25 19:43:21 +0300
commit08c0a1b8527287457cb8db5f41c368af192c606b (patch)
tree2534ee8c44c34213d4d82cb8aad0d61fa326b78f /rubocop/rubocop.rb
parent842377ab3c5b80a3758ad8c36dc3358bd265bc10 (diff)
Reject ruby interpolation in externalized strings
When using ruby interpolation in externalized strings, they can't be detected. Which means they will never be presented to be translated. To mix variables into translations we need to use `sprintf` instead. Instead of: _("Hello #{subject}") Use: _("Hello %{subject}) % { subject: 'world' }
Diffstat (limited to 'rubocop/rubocop.rb')
-rw-r--r--rubocop/rubocop.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/rubocop/rubocop.rb b/rubocop/rubocop.rb
index 88c9bbf24f4..eaf421a7235 100644
--- a/rubocop/rubocop.rb
+++ b/rubocop/rubocop.rb
@@ -28,3 +28,4 @@ require_relative 'cop/rspec/env_assignment'
require_relative 'cop/rspec/factories_in_migration_specs'
require_relative 'cop/sidekiq_options_queue'
require_relative 'cop/destroy_all'
+require_relative 'cop/ruby_interpolation_in_translation'