Commit 18a4afc5 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Add code review remarks

parent 8472fa08
...@@ -170,16 +170,11 @@ module Gitlab ...@@ -170,16 +170,11 @@ module Gitlab
end end
def translate_plural(entry) def translate_plural(entry)
used_plural_variables = entry.plural_id.scan(VARIABLE_REGEX)
plural_variables = fill_in_variables(used_plural_variables)
used_singular_variables = entry.msgid.scan(VARIABLE_REGEX)
singular_variables = fill_in_variables(used_singular_variables)
numbers_covering_all_plurals.map do |number| numbers_covering_all_plurals.map do |number|
translation = FastGettext::Translation.n_(entry.msgid, entry.plural_id, number) translation = FastGettext::Translation.n_(entry.msgid, entry.plural_id, number)
index = index_for_pluralization(number) index = index_for_pluralization(number)
variables = index == 0 ? singular_variables : plural_variables used_variables = index == 0 ? entry.msgid.scan(VARIABLE_REGEX) : entry.plural_id.scan(VARIABLE_REGEX)
variables = fill_in_variables(used_variables)
translation % variables if variables.any? translation % variables if variables.any?
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment