Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
18a4afc5
Commit
18a4afc5
authored
Sep 10, 2019
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add code review remarks
parent
8472fa08
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
lib/gitlab/i18n/po_linter.rb
lib/gitlab/i18n/po_linter.rb
+2
-7
No files found.
lib/gitlab/i18n/po_linter.rb
View file @
18a4afc5
...
...
@@ -170,16 +170,11 @@ module Gitlab
end
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
|
translation
=
FastGettext
::
Translation
.
n_
(
entry
.
msgid
,
entry
.
plural_id
,
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?
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment