diff options
author | elijah <elijah@riseup.net> | 2015-04-30 00:32:33 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-04-30 00:32:33 -0700 |
commit | 63871baf6061668b162972193c55b5a8f7490797 (patch) | |
tree | ca8cd5fbab18cbe59b728a123f450140ed98f519 /engines/support/app/helpers | |
parent | c3b133cb6f02003ab934e5008e108f489ace4158 (diff) |
added support for email notifications of ticket changes
Diffstat (limited to 'engines/support/app/helpers')
-rw-r--r-- | engines/support/app/helpers/ticket_i18n_helper.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/support/app/helpers/ticket_i18n_helper.rb b/engines/support/app/helpers/ticket_i18n_helper.rb new file mode 100644 index 0000000..61b4cf2 --- /dev/null +++ b/engines/support/app/helpers/ticket_i18n_helper.rb @@ -0,0 +1,20 @@ +module TicketI18nHelper + + # + # outputs translations for all the possible translated strings. + # used in emails, sense we don't know the locale of the recipient. + # + def t_all_available(key) + default = I18n.t(key, locale: I18n.default_locale) + result = [] + result << "[#{I18n.default_locale}] #{default}" + I18n.available_locales.each do |locale| + text = I18n.t(key, locale: locale, default: default) + if text != default + result << "[#{locale}] #{text}" + end + end + result.join("\n") + end + +end |