Skip to content

Commit

Permalink
Localise macro errors visible to end-user
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Coles <[email protected]>
  • Loading branch information
myabc committed Jul 10, 2014
1 parent f99450b commit 8eb1322
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,9 @@ de:
label_keyboard_shortcut_focus_previous_item: "Fokussiere vorheriges Listenelement (nur bei einigen Listen)"
label_keyboard_shortcut_focus_next_item: "Fokussiere nächstes Listenelement (nur bei einigen Listen)"

macro_execution_error: "Das Makro %{macro_name} konnte nicht ausgeführt werden"
macro_unavailable: "Makro %{macro_name} kann nicht angezeigt werden"

mail_body_account_activation_request: "Ein neuer Benutzer (%{value}) hat sich registriert. Sein Konto wartet auf Ihre Genehmigung:"
mail_body_account_information: "Ihre Konto-Informationen"
mail_body_account_information_external: "Sie können sich mit Ihrem Konto %{value} anmelden."
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,9 @@ en:
label_keyboard_shortcut_focus_previous_item: "Focus previous list element (on some lists only)"
label_keyboard_shortcut_focus_next_item: "Focus next list element (on some lists only)"

macro_execution_error: "Error executing the macro %{macro_name}"
macro_unavailable: "Macro %{macro_name} cannot be displayed."

mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"
mail_body_account_information: "Your account information"
mail_body_account_information_external: "You can use your %{value} account to log in."
Expand Down
4 changes: 2 additions & 2 deletions lib/redmine/wiki_formatting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def execute_macros(text, macros_runner)
begin
macros_runner.call(macro, args)
rescue => e
"<div class=\"flash error\">Error executing the <strong>#{macro}</strong> macro (#{e})</div>"
"<div class=\"flash error\">#{::I18n.t(:macro_execution_error, macro_name: macro)} (#{e})</div>"
rescue NotImplementedError
"<div class=\"macro-unavailable\">Macro <strong>#{macro}</strong> cannot be displayed.</div>"
"<div class=\"macro-unavailable\">#{::I18n.t(:macro_unavailable, macro_name: macro)}</div>"
end || all
else
all
Expand Down

0 comments on commit 8eb1322

Please sign in to comment.