From 020e12a6ae99e9b9dfaa3cfbd640ecdf31d7424d Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Wed, 12 Apr 2017 23:24:29 -0500 Subject: Add missing initializer for FastGettext --- config/initializers/fast_gettext.rb | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 config/initializers/fast_gettext.rb (limited to 'config') diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb new file mode 100644 index 00000000000..cfc3427b5ae --- /dev/null +++ b/config/initializers/fast_gettext.rb @@ -0,0 +1,3 @@ +FastGettext.add_text_domain 'gitlab', path: 'locale', type: :po +FastGettext.default_available_locales = ['en', 'es','de'] +FastGettext.default_text_domain = 'gitlab' -- cgit v1.2.3 From 90ba69d224eb7ef3d91332f1b7944c68ad16affd Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Sat, 15 Apr 2017 16:07:31 +0100 Subject: Started internationalising cycyle analytics --- config/webpack.config.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index ffb16190093..df7b43cf053 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -52,6 +52,7 @@ var config = { vue_pipelines: './vue_pipelines_index/index.js', issue_show: './issue_show/index.js', group: './group.js', + locale: './locale/index.js', }, output: { @@ -82,6 +83,10 @@ var config = { exclude: /node_modules/, loader: 'file-loader', }, + { + test: /locale\/[a-z]+\/(.*)\.js$/, + loader: 'exports-loader?locales', + }, ] }, -- cgit v1.2.3 From 7963c2c25114e871eb42c0859b6d24fc37437a8a Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 18 Apr 2017 14:55:09 +0100 Subject: Added Vue filters & directives for translating --- config/webpack.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index df7b43cf053..92ecba45d6e 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -150,6 +150,14 @@ var config = { new webpack.optimize.CommonsChunkPlugin({ names: ['main', 'common', 'runtime'], }), + + // locale common library + new webpack.optimize.CommonsChunkPlugin({ + name: 'locale', + chunks: [ + 'cycle_analytics', + ], + }), ], resolve: { -- cgit v1.2.3 From a3506a228723d7e31fb37580dcd3b30245436f22 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 18 Apr 2017 17:00:44 +0100 Subject: Fixed missing text Fixed duplicated time in dropdown --- config/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 92ecba45d6e..f93f4d6cd5e 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -34,6 +34,7 @@ var config = { graphs: './graphs/graphs_bundle.js', groups_list: './groups_list.js', issuable: './issuable/issuable_bundle.js', + locale: './locale/index.js', merge_conflicts: './merge_conflicts/merge_conflicts_bundle.js', merge_request_widget: './merge_request_widget/ci_bundle.js', monitoring: './monitoring/monitoring_bundle.js', @@ -52,7 +53,6 @@ var config = { vue_pipelines: './vue_pipelines_index/index.js', issue_show: './issue_show/index.js', group: './group.js', - locale: './locale/index.js', }, output: { -- cgit v1.2.3 From 1de135bc0408a871e3bfa8b0ba5aa81a7936bd01 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Wed, 19 Apr 2017 23:19:24 -0500 Subject: Fix Rubocop complains plus some small refactor --- config/initializers/fast_gettext.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb index cfc3427b5ae..54b0049033b 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 = ['en', 'es','de'] +FastGettext.default_available_locales = Gitlab::I18n::AVAILABLE_LANGUAGES.keys FastGettext.default_text_domain = 'gitlab' -- cgit v1.2.3 From 4471d7b84fc783a08909473ef0243e6e07d2342a Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Thu, 20 Apr 2017 18:09:13 -0500 Subject: Some small fixes for the current I18n implementation --- config/initializers/fast_gettext.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') 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 -- cgit v1.2.3 From 6fbc6befa1768cc68471d17091ef08b2e73fec82 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Thu, 20 Apr 2017 22:47:31 -0500 Subject: Monkey patch gettext_i18n_rails so it can parse content in Mustache format --- config/initializers/gettext_rails_i18n_patch.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 config/initializers/gettext_rails_i18n_patch.rb (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb new file mode 100644 index 00000000000..0413330c608 --- /dev/null +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -0,0 +1,17 @@ +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 + -- cgit v1.2.3 From 4f31d5963f44b1803fa54d0732cae86b0ec45e06 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 21 Apr 2017 09:16:50 +0100 Subject: Revert line being commented out --- config/initializers/gettext_rails_i18n_patch.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index 744e983a094..c6b3795d0c4 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -1,16 +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 + 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 -- cgit v1.2.3 From 77d9e3f9b49821af3ec9b4fbac574c75b02d0351 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Mon, 24 Apr 2017 22:36:14 -0500 Subject: Monkey patch gettext_i18n_rails so it can parse content in Mustache format --- config/initializers/gettext_rails_i18n_patch.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 config/initializers/gettext_rails_i18n_patch.rb (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb new file mode 100644 index 00000000000..c6b841aacd6 --- /dev/null +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -0,0 +1,19 @@ +require 'gettext_i18n_rails/haml_parser' + +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 + -- cgit v1.2.3 From 80d7f4166fec5476c07ca7afe78e3e8a50071f2b Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Mon, 24 Apr 2017 23:03:38 -0500 Subject: Parse the translate-plural filter in HAML views --- config/initializers/gettext_rails_i18n_patch.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index a50be2ea279..3b50501c3da 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -10,8 +10,12 @@ module GettextI18nRails # 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) + # {{ 'Stage' | translate }} => = _('Stage') text.gsub!(/{{ (.*)( \| translate) }}/, "= _(\\1)") + # {{ 'user' | translate-plural('users', users.size) }} => = n_('user', 'users', users.size) + text.gsub!(/{{ (.*)( \| translate-plural\((.*), (.*)\)) }}/, "= n_(\\1, \\3, \\4)") + old_convert_to_code(text) end end -- cgit v1.2.3 From 422c48baa7eeaca025a423c4eb48256c786514ed Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Tue, 25 Apr 2017 00:01:59 -0500 Subject: Parse translate filters from JS files. --- config/initializers/gettext_rails_i18n_patch.rb | 31 +++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index 3b50501c3da..5570b7e31e9 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -1,4 +1,8 @@ require 'gettext_i18n_rails/haml_parser' +require 'gettext_i18n_rails_js/parser/javascript' + +VUE_TRANSLATE_REGEX = /{{ ([^{]*)( \| translate) }}/ +VUE_TRANSLATE_PLURAL_REGEX = /{{ ([^{]*)( \| translate-plural\((.*), (.*)\)) }}/ module GettextI18nRails class HamlParser @@ -9,14 +13,37 @@ module GettextI18nRails # 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. + # Overwrites: https://github.com/grosser/gettext_i18n_rails/blob/8396387a431e0f8ead72fc1cd425cad2fa4992f2/lib/gettext_i18n_rails/haml_parser.rb#L9 def self.convert_to_code(text) # {{ 'Stage' | translate }} => = _('Stage') - text.gsub!(/{{ (.*)( \| translate) }}/, "= _(\\1)") + text.gsub!(VUE_TRANSLATE_REGEX, "= _(\\1)") # {{ 'user' | translate-plural('users', users.size) }} => = n_('user', 'users', users.size) - text.gsub!(/{{ (.*)( \| translate-plural\((.*), (.*)\)) }}/, "= n_(\\1, \\3, \\4)") + text.gsub!(VUE_TRANSLATE_PLURAL_REGEX, "= n_(\\1, \\3, \\4)") old_convert_to_code(text) end end end + +module GettextI18nRailsJs + module Parser + module Javascript + protected + + # Overwrites: https://github.com/webhippie/gettext_i18n_rails_js/blob/46c58db6d2053a4f5f36a0eb024ea706ff5707cb/lib/gettext_i18n_rails_js/parser/javascript.rb#L46 + def collect_for(value) + ::File.open(value) do |f| + f.each_line.each_with_index.collect do |line, idx| + line.gsub!(VUE_TRANSLATE_REGEX, "__(\\1)") + line.gsub!(VUE_TRANSLATE_PLURAL_REGEX, "n__(\\1, \\3, \\4)") + + line.scan(invoke_regex).collect do |function, arguments| + yield(function, arguments, idx + 1) + end + end.inject([], :+).compact + end + end + end + end +end -- cgit v1.2.3 From d8f767445933f41a7629a7637ba962bdbc461c9a Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Tue, 25 Apr 2017 21:47:49 -0500 Subject: Add ability to parse *.vue files through the `ruby gettext:find` script --- config/initializers/gettext_rails_i18n_patch.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index 5570b7e31e9..d74c1f597fe 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -13,6 +13,7 @@ module GettextI18nRails # 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. + # # Overwrites: https://github.com/grosser/gettext_i18n_rails/blob/8396387a431e0f8ead72fc1cd425cad2fa4992f2/lib/gettext_i18n_rails/haml_parser.rb#L9 def self.convert_to_code(text) # {{ 'Stage' | translate }} => = _('Stage') @@ -29,6 +30,20 @@ end module GettextI18nRailsJs module Parser module Javascript + + # This is required to tell the `rake gettext:find` script to use the Javascript + # parser for *.vue files. + # + # Overwrites: https://github.com/webhippie/gettext_i18n_rails_js/blob/46c58db6d2053a4f5f36a0eb024ea706ff5707cb/lib/gettext_i18n_rails_js/parser/javascript.rb#L36 + def target?(file) + [ + ".js", + ".jsx", + ".coffee", + ".vue" + ].include? ::File.extname(file) + end + protected # Overwrites: https://github.com/webhippie/gettext_i18n_rails_js/blob/46c58db6d2053a4f5f36a0eb024ea706ff5707cb/lib/gettext_i18n_rails_js/parser/javascript.rb#L46 -- cgit v1.2.3 From 82e967bc3ebc6b884651ddcadff2142332c365a5 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Wed, 26 Apr 2017 13:02:07 -0500 Subject: Adjust the patch for the gettext_i18n_rails and gettext_i18n_rails_js gems. This is more simple now given we're using the recommended code to annotate content to be translated. --- config/initializers/gettext_rails_i18n_patch.rb | 27 +++---------------------- 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index d74c1f597fe..6785f361eda 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -1,8 +1,7 @@ require 'gettext_i18n_rails/haml_parser' require 'gettext_i18n_rails_js/parser/javascript' -VUE_TRANSLATE_REGEX = /{{ ([^{]*)( \| translate) }}/ -VUE_TRANSLATE_PLURAL_REGEX = /{{ ([^{]*)( \| translate-plural\((.*), (.*)\)) }}/ +VUE_TRANSLATE_REGEX = /{{ (N|n|s)?__\((.*)\) }}/ module GettextI18nRails class HamlParser @@ -10,17 +9,13 @@ module GettextI18nRails # 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 }}" + # 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) - # {{ 'Stage' | translate }} => = _('Stage') - text.gsub!(VUE_TRANSLATE_REGEX, "= _(\\1)") - - # {{ 'user' | translate-plural('users', users.size) }} => = n_('user', 'users', users.size) - text.gsub!(VUE_TRANSLATE_PLURAL_REGEX, "= n_(\\1, \\3, \\4)") + text.gsub!(VUE_TRANSLATE_REGEX, "= \\1_(\\2)") old_convert_to_code(text) end @@ -43,22 +38,6 @@ module GettextI18nRailsJs ".vue" ].include? ::File.extname(file) end - - protected - - # Overwrites: https://github.com/webhippie/gettext_i18n_rails_js/blob/46c58db6d2053a4f5f36a0eb024ea706ff5707cb/lib/gettext_i18n_rails_js/parser/javascript.rb#L46 - def collect_for(value) - ::File.open(value) do |f| - f.each_line.each_with_index.collect do |line, idx| - line.gsub!(VUE_TRANSLATE_REGEX, "__(\\1)") - line.gsub!(VUE_TRANSLATE_PLURAL_REGEX, "n__(\\1, \\3, \\4)") - - line.scan(invoke_regex).collect do |function, arguments| - yield(function, arguments, idx + 1) - end - end.inject([], :+).compact - end - end end end end -- cgit v1.2.3 From 0f1273fa44a9122bffbd5cecbaea99b1db781d7e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 14 Apr 2017 11:53:30 +1000 Subject: Add configurable timeout for git fetch and clone operations GitLab uses the import_project method in GitLab Shell, This method uses a timeout for the operation, hardcoded to 800 seconds. With this MR the timeout is now configurable in the gitlab_shell settings. --- config/gitlab.yml.example | 3 +++ config/initializers/1_settings.rb | 1 + 2 files changed, 4 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 06c9f734c2a..ce477001b6f 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -502,6 +502,9 @@ production: &base upload_pack: true receive_pack: true + # Git import/fetch timeout + # git_timeout: 800 + # If you use non-standard ssh port you need to specify it # ssh_port: 22 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 87bf48a3dcd..16bc08cf48f 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -386,6 +386,7 @@ Settings.gitlab_shell['ssh_port'] ||= 22 Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.__send__(:build_gitlab_shell_ssh_path_prefix) +Settings.gitlab_shell['git_timeout'] ||= 800 # # Repositories -- cgit v1.2.3 From 22ecf73e823f01e155b2db2cb072120f80b9d234 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Thu, 27 Apr 2017 11:51:04 -0500 Subject: Adjust regex used in order to parse inline content. e.g: %h4 {{ __('foo') }} Problem was it was being parsed as: %h4 = _('foo') And the correct content should be: %h4= _('foo') --- config/initializers/gettext_rails_i18n_patch.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index 6785f361eda..616f6c45b0a 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -1,7 +1,7 @@ require 'gettext_i18n_rails/haml_parser' require 'gettext_i18n_rails_js/parser/javascript' -VUE_TRANSLATE_REGEX = /{{ (N|n|s)?__\((.*)\) }}/ +VUE_TRANSLATE_REGEX = /((%[\w.-]+)(?:\s))?{{ (N|n|s)?__\((.*)\) }}/ module GettextI18nRails class HamlParser @@ -15,7 +15,7 @@ module GettextI18nRails # # 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, "= \\1_(\\2)") + text.gsub!(VUE_TRANSLATE_REGEX, "\\2= \\3_(\\4)") old_convert_to_code(text) end -- cgit v1.2.3 From e11a702afceee7f5edeb8c93a4192fa05209b091 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 28 Apr 2017 17:06:19 +0100 Subject: Re-wrote to match our docs - still not 100% sure but closer than it was --- config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index cb0a57a3a41..1721d275685 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -26,6 +26,7 @@ var config = { common_d3: ['d3'], cycle_analytics: './cycle_analytics/cycle_analytics_bundle.js', commit_pipelines: './commit/pipelines/pipelines_bundle.js', + deploy_keys: './deploy_keys/index.js', diff_notes: './diff_notes/diff_notes_bundle.js', environments: './environments/environments_bundle.js', environments_folder: './environments/folder/environments_folder_bundle.js', -- cgit v1.2.3 From 43ff7386411af0f538710f3627622f71e5e34472 Mon Sep 17 00:00:00 2001 From: Jarka Kadlecova Date: Mon, 1 May 2017 15:14:35 +0200 Subject: Support uploaders for personal snippets comments --- config/routes/uploads.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'config') diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index 2b22148a134..b315186b178 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -4,6 +4,11 @@ scope path: :uploads do to: "uploads#show", constraints: { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ } + # show uploads for models, snippets (notes) available for now + get ':model/:id/:secret/:filename', + to: 'uploads#show', + constraints: { model: /personal_snippet/, id: /\d+/, filename: /[^\/]+/ } + # Appearance get ":model/:mounted_as/:id/:filename", to: "uploads#show", @@ -13,6 +18,12 @@ scope path: :uploads do get ":namespace_id/:project_id/:secret/:filename", to: "projects/uploads#show", constraints: { namespace_id: /[a-zA-Z.0-9_\-]+/, project_id: /[a-zA-Z.0-9_\-]+/, filename: /[^\/]+/ } + + # create uploads for models, snippets (notes) available for now + post ':model/:id/', + to: 'uploads#create', + constraints: { model: /personal_snippet/, id: /\d+/ }, + as: 'upload' end # Redirect old note attachments path to new uploads path. -- cgit v1.2.3 From 3b82444eb7791e58e3e0ba2f08b8ccde48e3d4c6 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Tue, 2 May 2017 13:13:28 -0500 Subject: Fix Rubocop complains. --- config/initializers/gettext_rails_i18n_patch.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/initializers/gettext_rails_i18n_patch.rb b/config/initializers/gettext_rails_i18n_patch.rb index 616f6c45b0a..69118f464ca 100644 --- a/config/initializers/gettext_rails_i18n_patch.rb +++ b/config/initializers/gettext_rails_i18n_patch.rb @@ -25,7 +25,6 @@ end module GettextI18nRailsJs module Parser module Javascript - # This is required to tell the `rake gettext:find` script to use the Javascript # parser for *.vue files. # -- cgit v1.2.3 From 6d5364cfb0e39f49afac9b465f37bd19185c3755 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Tue, 2 May 2017 23:36:36 -0500 Subject: First round of updates from the code review. --- config/initializers/fast_gettext.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb index 10a3ee02b85..bea85b43b95 100644 --- a/config/initializers/fast_gettext.rb +++ b/config/initializers/fast_gettext.rb @@ -1,3 +1,5 @@ FastGettext.add_text_domain 'gitlab', path: 'locale', type: :po FastGettext.default_text_domain = 'gitlab' -FastGettext.default_available_locales = Gitlab::I18n::AVAILABLE_LANGUAGES.keys +FastGettext.default_available_locales = Gitlab::I18n.available_locales + +I18n.available_locales = Gitlab::I18n.available_locales -- cgit v1.2.3 From 628d641b067fd0c0ba16fc7f6d68bcd241a7a105 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Thu, 4 May 2017 01:58:57 -0500 Subject: Disable FastGettext from translating AR attrs. It isn't working fine when using POROs in forms like WikiPage, the following error is being raised: undefined method `abstract_class?' for Object:Class --- config/application.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index f2ecc4ce77c..32ad2393648 100644 --- a/config/application.rb +++ b/config/application.rb @@ -40,6 +40,9 @@ module Gitlab # config.i18n.default_locale = :de config.i18n.enforce_available_locales = false + # Translation for AR attrs is not working well for POROs like WikiPage + config.gettext_i18n_rails.use_for_active_record_attributes = false + # Configure the default encoding used in templates for Ruby 1.9. config.encoding = "utf-8" -- cgit v1.2.3 From 0f58eb6bde35009b69ef871534d9ff80fc38bbf7 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 2 May 2017 17:42:37 -0500 Subject: Add artifact file page that uses the blob viewer --- config/routes/project.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/routes/project.rb b/config/routes/project.rb index a15e365cc2f..5aba469b6e4 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -183,6 +183,7 @@ constraints(ProjectUrlConstrainer.new) do get :download get :browse, path: 'browse(/*path)', format: false get :file, path: 'file/*path', format: false + get :raw, path: 'raw/*path', format: false post :keep end end -- cgit v1.2.3 From 9904c12746e744c4e271fe454b04a54dfb9b668e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 4 May 2017 15:57:08 +0100 Subject: Updated webpack config --- config/webpack.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 742d22d0c1f..239bb5ec436 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -123,6 +123,7 @@ var config = { 'boards', 'commit_pipelines', 'cycle_analytics', + 'deploy_keys', 'diff_notes', 'environments', 'environments_folder', -- cgit v1.2.3 From f7b7a520920204d1a2864af6d911ef9dc8c2df6b Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Thu, 4 May 2017 17:05:14 -0500 Subject: More updates for translations plus small tweaks. --- config/locales/es.yml | 217 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 config/locales/es.yml (limited to 'config') diff --git a/config/locales/es.yml b/config/locales/es.yml new file mode 100644 index 00000000000..87e79beee74 --- /dev/null +++ b/config/locales/es.yml @@ -0,0 +1,217 @@ +--- +es: + activerecord: + errors: + messages: + record_invalid: "La validación falló: %{errors}" + restrict_dependent_destroy: + has_one: No se puede eliminar el registro porque existe un %{record} dependiente + has_many: No se puede eliminar el registro porque existen %{record} dependientes + date: + abbr_day_names: + - dom + - lun + - mar + - mié + - jue + - vie + - sáb + abbr_month_names: + - + - ene + - feb + - mar + - abr + - may + - jun + - jul + - ago + - sep + - oct + - nov + - dic + day_names: + - domingo + - lunes + - martes + - miércoles + - jueves + - viernes + - sábado + formats: + default: "%d/%m/%Y" + long: "%d de %B de %Y" + short: "%d de %b" + month_names: + - + - enero + - febrero + - marzo + - abril + - mayo + - junio + - julio + - agosto + - septiembre + - octubre + - noviembre + - diciembre + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: alrededor de 1 hora + other: alrededor de %{count} horas + about_x_months: + one: alrededor de 1 mes + other: alrededor de %{count} meses + about_x_years: + one: alrededor de 1 año + other: alrededor de %{count} años + almost_x_years: + one: casi 1 año + other: casi %{count} años + half_a_minute: medio minuto + less_than_x_minutes: + one: menos de 1 minuto + other: menos de %{count} minutos + less_than_x_seconds: + one: menos de 1 segundo + other: menos de %{count} segundos + over_x_years: + one: más de 1 año + other: más de %{count} años + x_days: + one: 1 día + other: "%{count} días" + x_minutes: + one: 1 minuto + other: "%{count} minutos" + x_months: + one: 1 mes + other: "%{count} meses" + x_years: + one: 1 año + other: "%{count} años" + x_seconds: + one: 1 segundo + other: "%{count} segundos" + prompts: + day: Día + hour: Hora + minute: Minutos + month: Mes + second: Segundos + year: Año + errors: + format: "%{attribute} %{message}" + messages: + accepted: debe ser aceptado + blank: no puede estar en blanco + present: debe estar en blanco + confirmation: no coincide + empty: no puede estar vacío + equal_to: debe ser igual a %{count} + even: debe ser par + exclusion: está reservado + greater_than: debe ser mayor que %{count} + greater_than_or_equal_to: debe ser mayor que o igual a %{count} + inclusion: no está incluido en la lista + invalid: no es válido + less_than: debe ser menor que %{count} + less_than_or_equal_to: debe ser menor que o igual a %{count} + model_invalid: "La validación falló: %{errors}" + not_a_number: no es un número + not_an_integer: debe ser un entero + odd: debe ser impar + required: debe existir + taken: ya está en uso + too_long: + one: "es demasiado largo (1 carácter máximo)" + other: "es demasiado largo (%{count} caracteres máximo)" + too_short: + one: "es demasiado corto (1 carácter mínimo)" + other: "es demasiado corto (%{count} caracteres mínimo)" + wrong_length: + one: "no tiene la longitud correcta (1 carácter exactos)" + other: "no tiene la longitud correcta (%{count} caracteres exactos)" + other_than: debe ser distinto de %{count} + template: + body: 'Se encontraron problemas con los siguientes campos:' + header: + one: No se pudo guardar este/a %{model} porque se encontró 1 error + other: No se pudo guardar este/a %{model} porque se encontraron %{count} errores + helpers: + select: + prompt: Por favor seleccione + submit: + create: Crear %{model} + submit: Guardar %{model} + update: Actualizar %{model} + number: + currency: + format: + delimiter: "." + format: "%n %u" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + unit: "€" + format: + delimiter: "." + precision: 3 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: mil millones + million: + one: millón + other: millones + quadrillion: mil billones + thousand: mil + trillion: + one: billón + other: billones + unit: '' + format: + delimiter: '' + precision: 1 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + format: "%n %" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: " y " + two_words_connector: " y " + words_connector: ", " + time: + am: am + formats: + default: "%A, %d de %B de %Y %H:%M:%S %z" + long: "%d de %B de %Y %H:%M" + short: "%d de %b %H:%M" + pm: pm -- cgit v1.2.3 From b396668ec55fb866ef578e5f0e60df8b13519613 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Thu, 4 May 2017 18:44:19 -0500 Subject: Add CHANGELOG entry, some specs and locale file for German. --- config/locales/de.yml | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 config/locales/de.yml (limited to 'config') diff --git a/config/locales/de.yml b/config/locales/de.yml new file mode 100644 index 00000000000..533663a2704 --- /dev/null +++ b/config/locales/de.yml @@ -0,0 +1,219 @@ +--- +de: + activerecord: + errors: + messages: + record_invalid: 'Gültigkeitsprüfung ist fehlgeschlagen: %{errors}' + restrict_dependent_destroy: + has_one: Datensatz kann nicht gelöscht werden, da ein abhängiger %{record}-Datensatz + existiert. + has_many: Datensatz kann nicht gelöscht werden, da abhängige %{record} existieren. + date: + abbr_day_names: + - So + - Mo + - Di + - Mi + - Do + - Fr + - Sa + abbr_month_names: + - + - Jan + - Feb + - Mär + - Apr + - Mai + - Jun + - Jul + - Aug + - Sep + - Okt + - Nov + - Dez + day_names: + - Sonntag + - Montag + - Dienstag + - Mittwoch + - Donnerstag + - Freitag + - Samstag + formats: + default: "%d.%m.%Y" + long: "%e. %B %Y" + short: "%e. %b" + month_names: + - + - Januar + - Februar + - März + - April + - Mai + - Juni + - Juli + - August + - September + - Oktober + - November + - Dezember + order: + - :day + - :month + - :year + datetime: + distance_in_words: + about_x_hours: + one: etwa eine Stunde + other: etwa %{count} Stunden + about_x_months: + one: etwa ein Monat + other: etwa %{count} Monate + about_x_years: + one: etwa ein Jahr + other: etwa %{count} Jahre + almost_x_years: + one: fast ein Jahr + other: fast %{count} Jahre + half_a_minute: eine halbe Minute + less_than_x_minutes: + one: weniger als eine Minute + other: weniger als %{count} Minuten + less_than_x_seconds: + one: weniger als eine Sekunde + other: weniger als %{count} Sekunden + over_x_years: + one: mehr als ein Jahr + other: mehr als %{count} Jahre + x_days: + one: ein Tag + other: "%{count} Tage" + x_minutes: + one: eine Minute + other: "%{count} Minuten" + x_months: + one: ein Monat + other: "%{count} Monate" + x_seconds: + one: eine Sekunde + other: "%{count} Sekunden" + prompts: + day: Tag + hour: Stunden + minute: Minute + month: Monat + second: Sekunde + year: Jahr + errors: + format: "%{attribute} %{message}" + messages: + accepted: muss akzeptiert werden + blank: muss ausgefüllt werden + present: darf nicht ausgefüllt werden + confirmation: stimmt nicht mit %{attribute} überein + empty: muss ausgefüllt werden + equal_to: muss genau %{count} sein + even: muss gerade sein + exclusion: ist nicht verfügbar + greater_than: muss größer als %{count} sein + greater_than_or_equal_to: muss größer oder gleich %{count} sein + inclusion: ist kein gültiger Wert + invalid: ist nicht gültig + less_than: muss kleiner als %{count} sein + less_than_or_equal_to: muss kleiner oder gleich %{count} sein + model_invalid: 'Gültigkeitsprüfung ist fehlgeschlagen: %{errors}' + not_a_number: ist keine Zahl + not_an_integer: muss ganzzahlig sein + odd: muss ungerade sein + required: muss ausgefüllt werden + taken: ist bereits vergeben + too_long: + one: ist zu lang (mehr als 1 Zeichen) + other: ist zu lang (mehr als %{count} Zeichen) + too_short: + one: ist zu kurz (weniger als 1 Zeichen) + other: ist zu kurz (weniger als %{count} Zeichen) + wrong_length: + one: hat die falsche Länge (muss genau 1 Zeichen haben) + other: hat die falsche Länge (muss genau %{count} Zeichen haben) + other_than: darf nicht gleich %{count} sein + template: + body: 'Bitte überprüfen Sie die folgenden Felder:' + header: + one: 'Konnte %{model} nicht speichern: ein Fehler.' + other: 'Konnte %{model} nicht speichern: %{count} Fehler.' + helpers: + select: + prompt: Bitte wählen + submit: + create: "%{model} erstellen" + submit: "%{model} speichern" + update: "%{model} aktualisieren" + number: + currency: + format: + delimiter: "." + format: "%n %u" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + unit: "€" + format: + delimiter: "." + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: + one: Milliarde + other: Milliarden + million: + one: Million + other: Millionen + quadrillion: + one: Billiarde + other: Billiarden + thousand: Tausend + trillion: + one: Billion + other: Billionen + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + format: "%n %" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: " und " + two_words_connector: " und " + words_connector: ", " + time: + am: vormittags + formats: + default: "%A, %d. %B %Y, %H:%M Uhr" + long: "%A, %d. %B %Y, %H:%M Uhr" + short: "%d. %B, %H:%M Uhr" + pm: nachmittags -- cgit v1.2.3