Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-04-21 11:16:05 +0300
committerPhil Hughes <me@iamphill.com>2017-04-21 11:16:05 +0300
commitdc5136a70d2481f214769a9e28cf82958f3ab124 (patch)
tree3dce4997d3a5181365d75697bdaa7ab6be4299cb /config
parentb7b5bd4a49a212f41f08be98997c25c0ce530f97 (diff)
parent6fbc6befa1768cc68471d17091ef08b2e73fec82 (diff)
Merge remote-tracking branch 'origin/28433-internationalise-cycle-analytics-page' into js-translations
Diffstat (limited to 'config')
-rw-r--r--config/initializers/fast_gettext.rb2
-rw-r--r--config/initializers/gettext_rails_i18n_patch.rb16
-rw-r--r--config/webpack.config.js1
3 files changed, 18 insertions, 1 deletions
diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb
index 54b0049033b..10a3ee02b85 100644
--- a/config/initializers/fast_gettext.rb
+++ b/config/initializers/fast_gettext.rb
@@ -1,3 +1,3 @@
FastGettext.add_text_domain 'gitlab', path: 'locale', type: :po
-FastGettext.default_available_locales = Gitlab::I18n::AVAILABLE_LANGUAGES.keys
FastGettext.default_text_domain = 'gitlab'
+FastGettext.default_available_locales = Gitlab::I18n::AVAILABLE_LANGUAGES.keys
diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb
new file mode 100644
index 00000000000..744e983a094
--- /dev/null
+++ b/config/initializers/gettext_rails_i18n_patch.rb
@@ -0,0 +1,16 @@
+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
+ end
+end
diff --git a/config/webpack.config.js b/config/webpack.config.js
index dc9c7786475..10df465faf6 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -36,6 +36,7 @@ var config = {
issuable: './issuable/issuable_bundle.js',
locale: './locale/index.js',
issue_show: './issue_show/index.js',
+ locale: './locale/index.js',
main: './main.js',
merge_conflicts: './merge_conflicts/merge_conflicts_bundle.js',
merge_request_widget: './merge_request_widget/ci_bundle.js',