[PATCH conductor] BZs #798501 and #798505: Object names should be pulled from mapping file

Jason Guiditta jguiditt at redhat.com
Fri Mar 2 21:27:13 UTC 2012


https://bugzilla.redhat.com/show_bug.cgi?id=798505
https://bugzilla.redhat.com/show_bug.cgi?id=798501

This boils down to the following: The strings in question were NOT
being internationalized, they were pulled from the class names.  This
patch adds a mapping i18n file, which fixes both bugs (and any similar)
and future ones saying we don't internationalize the class names.

It is possible there are other cases beside permissions where this
maybe be the case, but if so, it is a simple matter of repeating the
pattern here and add a few translation strings to this file.
---
 src/app/controllers/permissions_controller.rb |    2 +-
 src/config/locales/classnames.yml             |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)
 create mode 100644 src/config/locales/classnames.yml

diff --git a/src/app/controllers/permissions_controller.rb b/src/app/controllers/permissions_controller.rb
index 1545429..77398b2 100644
--- a/src/app/controllers/permissions_controller.rb
+++ b/src/app/controllers/permissions_controller.rb
@@ -38,7 +38,7 @@ class PermissionsController < ApplicationController
       @summary_text =  t("permissions.new.choose_global_role")
     else
       @return_text =  "#{@permission_object.name} #{@permission_object.class}"
-      @summary_text = t('permissions.new.choose_roles')+ " #{@permission_object.class}"
+      @summary_text = t('permissions.new.choose_roles') + " " + t("classnames.#{@permission_object.class.to_s.downcase}")
     end
     load_headers
     load_users
diff --git a/src/config/locales/classnames.yml b/src/config/locales/classnames.yml
new file mode 100644
index 0000000..aa7bbd1
--- /dev/null
+++ b/src/config/locales/classnames.yml
@@ -0,0 +1,11 @@
+en:
+  classnames:
+    catalog: Catalog
+    deployable: Deployable
+    deployment: Deployment
+    hardwareprofile: HWP
+    instance: Instance
+    pool: Pool
+    poolfamily: Pool Family
+    provider: Provider
+    provideraccount: Provider Account
-- 
1.7.7.6




More information about the aeolus-devel mailing list