Commit f8ee861c authored by Mark Chao's avatar Mark Chao

Move N_ calls into separate files

These are dynamic translations, so has to be marked explicitly using `N_`,
but they are not used in runtime, so can exist in separate file.
https://github.com/grosser/gettext_i18n_rails#unfound-translations-with-rake-gettextfind
parent bf88e9af
...@@ -48,6 +48,8 @@ Naming/FileName: ...@@ -48,6 +48,8 @@ Naming/FileName:
- 'qa/bin/*' - 'qa/bin/*'
- 'config/**/*' - 'config/**/*'
- 'lib/generators/**/*' - 'lib/generators/**/*'
- 'locale/unfound_translations.rb'
- 'ee/locale/unfound_translations.rb'
- 'ee/lib/generators/**/*' - 'ee/lib/generators/**/*'
IgnoreExecutableScripts: true IgnoreExecutableScripts: true
AllowedAcronyms: AllowedAcronyms:
......
...@@ -88,16 +88,6 @@ module NotificationsHelper ...@@ -88,16 +88,6 @@ module NotificationsHelper
when :success_pipeline when :success_pipeline
s_('NotificationEvent|Successful pipeline') s_('NotificationEvent|Successful pipeline')
else else
N_('NotificationEvent|New note')
N_('NotificationEvent|New issue')
N_('NotificationEvent|Reopen issue')
N_('NotificationEvent|Close issue')
N_('NotificationEvent|Reassign issue')
N_('NotificationEvent|New merge request')
N_('NotificationEvent|Close merge request')
N_('NotificationEvent|Reassign merge request')
N_('NotificationEvent|Merge merge request')
N_('NotificationEvent|Failed pipeline')
s_(event.to_s.humanize) s_(event.to_s.humanize)
end end
end end
......
...@@ -45,6 +45,7 @@ class NotificationSetting < ActiveRecord::Base ...@@ -45,6 +45,7 @@ class NotificationSetting < ActiveRecord::Base
:success_pipeline :success_pipeline
].freeze ].freeze
# Update unfound_translations.rb when events are changed
def self.email_events(source = nil) def self.email_events(source = nil)
EMAIL_EVENTS EMAIL_EVENTS
end end
......
# frozen_string_literal: true
# Dynamic translations which needs to be marked by `N_` so they can be found by `rake gettext:find`, see:
# https://github.com/grosser/gettext_i18n_rails#unfound-translations-with-rake-gettextfind
# NotificationSetting.email_events
N_('NotificationEvent|New note')
N_('NotificationEvent|New issue')
N_('NotificationEvent|Reopen issue')
N_('NotificationEvent|Close issue')
N_('NotificationEvent|Reassign issue')
N_('NotificationEvent|New merge request')
N_('NotificationEvent|Close merge request')
N_('NotificationEvent|Reassign merge request')
N_('NotificationEvent|Merge merge request')
N_('NotificationEvent|Failed pipeline')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment