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
538104bd
Commit
538104bd
authored
Aug 31, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch all translation keys using a regex
parent
abe19872
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
lib/gitlab/i18n/translation_entry.rb
lib/gitlab/i18n/translation_entry.rb
+1
-5
spec/lib/gitlab/i18n/po_linter_spec.rb
spec/lib/gitlab/i18n/po_linter_spec.rb
+1
-1
No files found.
lib/gitlab/i18n/translation_entry.rb
View file @
538104bd
...
@@ -67,11 +67,7 @@ module Gitlab
...
@@ -67,11 +67,7 @@ module Gitlab
private
private
def
translation_keys
def
translation_keys
@translation_keys
||=
if
has_plural?
@translation_keys
||=
entry_data
.
keys
.
select
{
|
key
|
key
.
to_s
=~
/\Amsgstr(\[\d+\])?\z/
}
entry_data
.
keys
.
select
{
|
key
|
key
=~
/msgstr\[\d+\]/
}
else
[
:msgstr
]
end
end
end
end
end
end
end
...
...
spec/lib/gitlab/i18n/po_linter_spec.rb
View file @
538104bd
...
@@ -106,7 +106,7 @@ describe Gitlab::I18n::PoLinter do
...
@@ -106,7 +106,7 @@ describe Gitlab::I18n::PoLinter do
context
'with multiple plurals'
do
context
'with multiple plurals'
do
let
(
:po_path
)
{
'spec/fixtures/multiple_plurals.po'
}
let
(
:po_path
)
{
'spec/fixtures/multiple_plurals.po'
}
it
'has
no
errors'
do
it
'has errors'
do
is_expected
.
not_to
be_empty
is_expected
.
not_to
be_empty
end
end
end
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