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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
4f31d596
Commit
4f31d596
authored
Apr 21, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert line being commented out
parent
dc5136a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
config/initializers/gettext_rails_i18n_patch.rb
config/initializers/gettext_rails_i18n_patch.rb
+12
-12
No files found.
config/initializers/gettext_rails_i18n_patch.rb
View file @
4f31d596
module
GettextI18nRails
class
HamlParser
#
singleton_class.send(:alias_method, :old_convert_to_code, :convert_to_code)
#
#
#
We need to convert text in Mustache format
#
#
to a format that can be parsed by Gettext scripts.
#
#
If we found a content like "{{ 'Stage' | translate }}"
#
#
in a HAML file we convert it to "= _('Stage')", that way
#
#
it can be processed by the "rake gettext:find" script.
#
def self.convert_to_code(text)
#
text.gsub!(/{{ (.*)( \| translate) }}/, "= _(\\1)")
#
#
old_convert_to_code(text)
#
end
singleton_class
.
send
(
:alias_method
,
:old_convert_to_code
,
:convert_to_code
)
# We need to convert text in Mustache format
# to a format that can be parsed by Gettext scripts.
# If we found a content like "{{ 'Stage' | translate }}"
# in a HAML file we convert it to "= _('Stage')", that way
# it can be processed by the "rake gettext:find" script.
def
self
.
convert_to_code
(
text
)
text
.
gsub!
(
/{{ (.*)( \| translate) }}/
,
"= _(
\\
1)"
)
old_convert_to_code
(
text
)
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