[PATCH conductor] BZs #798501 and #798505: Object names should be pulled from mapping file
Matt Wagner
matt.wagner at redhat.com
Mon Mar 5 22:39:51 UTC 2012
On Mon, Mar 05, 2012 at 05:37:50PM -0500, Jason Guiditta wrote:
> 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.
> ---
> aeolus-conductor.spec.in | 1 +
> src/app/controllers/permissions_controller.rb | 4 ++--
> src/config/locales/classnames/en.yml | 11 +++++++++++
> 3 files changed, 14 insertions(+), 2 deletions(-)
> create mode 100644 src/config/locales/classnames/en.yml
>
> diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
> index 35c50e0..57c0df3 100644
> --- a/aeolus-conductor.spec.in
> +++ b/aeolus-conductor.spec.in
> @@ -198,6 +198,7 @@ svg="public/images public/images/icons public/javascripts/jquery-svg"
> ttf="public/fonts"
> txt="public"
> yml="config config/locales config/locales/overrides config/locales/role_definitions \
> + config/locales/classnames \
> config/locales/overrides/role_definitions"
> xml="app/util"
> for filetype in builder css feature gif haml html ico jpg js json key opts png \
> diff --git a/src/app/controllers/permissions_controller.rb b/src/app/controllers/permissions_controller.rb
> index 1545429..37c5979 100644
> --- a/src/app/controllers/permissions_controller.rb
> +++ b/src/app/controllers/permissions_controller.rb
> @@ -37,8 +37,8 @@ class PermissionsController < ApplicationController
> @return_text = t("permissions.new.global_role_grants")
> @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}"
> + @return_text = "#{@permission_object.name} " + t("classnames.#{@permission_object.class.to_s.downcase}")
> + @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/en.yml b/src/config/locales/classnames/en.yml
> new file mode 100644
> index 0000000..aa7bbd1
> --- /dev/null
> +++ b/src/config/locales/classnames/en.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
ACK this one.
-- Matt
More information about the aeolus-devel
mailing list