diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /config/initializers/gettext_rails_i18n_patch.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'config/initializers/gettext_rails_i18n_patch.rb')
-rw-r--r-- | config/initializers/gettext_rails_i18n_patch.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index c23049e93c9..3c994516b2d 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -1,30 +1,8 @@ # frozen_string_literal: true -require 'gettext_i18n_rails/haml_parser' require 'gettext_i18n_rails_js/parser/javascript' require 'json' -VUE_TRANSLATE_REGEX = /((%[\w.-]+)(?:\s))?{{ (N|n|s)?__\((.*)\) }}/.freeze - -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') }}" - # in a HAML file we convert it to "= _('Stage')", that way - # it can be processed by the "rake gettext:find" script. - # - # Overwrites: https://github.com/grosser/gettext_i18n_rails/blob/8396387a431e0f8ead72fc1cd425cad2fa4992f2/lib/gettext_i18n_rails/haml_parser.rb#L9 - def self.convert_to_code(text) - text.gsub!(VUE_TRANSLATE_REGEX, "\\2= \\3_(\\4)") - - old_convert_to_code(text) - end - end -end - module GettextI18nRailsJs module Parser module Javascript |