mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Minor improvements to rake i18n:check
This commit is contained in:
@ -32,12 +32,12 @@ task "i18n:check", [:locale] => [:environment] do |_, args|
|
||||
errors.each do |error|
|
||||
message =
|
||||
case error[:type]
|
||||
when LocaleFileChecker::TYPE_MISSING_INTERPOLATION_KEY
|
||||
"Missing interpolation key".red
|
||||
when LocaleFileChecker::TYPE_UNSUPPORTED_INTERPOLATION_KEY
|
||||
"Unsupported interpolation key".red
|
||||
when LocaleFileChecker::TYPE_MISSING_PLURAL_KEY
|
||||
"Missing plural key".yellow
|
||||
when LocaleFileChecker::TYPE_MISSING_INTERPOLATION_KEYS
|
||||
"Missing interpolation keys".red
|
||||
when LocaleFileChecker::TYPE_UNSUPPORTED_INTERPOLATION_KEYS
|
||||
"Unsupported interpolation keys".red
|
||||
when LocaleFileChecker::TYPE_MISSING_PLURAL_KEYS
|
||||
"Missing plural keys".yellow
|
||||
end
|
||||
details = error[:details] ? ": #{error[:details]}" : ""
|
||||
|
||||
@ -49,4 +49,5 @@ task "i18n:check", [:locale] => [:environment] do |_, args|
|
||||
failed_locales.each do |failed_locale|
|
||||
puts "", "Failed to check locale files for #{failed_locale}".red
|
||||
end
|
||||
exit 1 unless failed_locales.empty?
|
||||
end
|
||||
|
Reference in New Issue
Block a user