[PATCH conductor] BZ 860556 Revised missing translation keys

Matt Wagner matt.wagner at redhat.com
Tue Oct 16 18:18:31 UTC 2012


On Tue, Oct 16, 2012 at 05:50:23PM +0200, jzigmund at redhat.com wrote:
> From: Jozef Zigmund <jzigmund at redhat.com>
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=860556
> ---
>  src/app/models/quota.rb                       | 4 ++--
>  src/app/views/providers/new.html.haml         | 2 +-
>  src/app/views/settings/self_service.html.haml | 2 +-
>  src/app/views/users/show.html.haml            | 2 +-
>  src/config/locales/activerecord/en.yml        | 5 +++++
>  src/config/locales/en.yml                     | 1 +
>  6 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/src/app/models/quota.rb b/src/app/models/quota.rb
> index 83e630a..9e408c5 100644
> --- a/src/app/models/quota.rb
> +++ b/src/app/models/quota.rb
> @@ -46,14 +46,14 @@ class Quota < ActiveRecord::Base
>                              :less_than_or_equal_to => 2147483647,
>                              :only_integer => true,
>                              :allow_nil => true,
> -                            :message => "must be a positive whole number less than 2147483647"
> +                            :message => I18n.t("quotas.flash.error.must_be_positive")
>  
>    validates_numericality_of :maximum_running_instances,
>                              :greater_than_or_equal_to => 0,
>                              :less_than_or_equal_to => 2147483647,
>                              :only_integer => true,
>                              :allow_nil => true,
> -                            :message => "must be a positive whole number less than 2147483647"
> +                            :message => I18n.t("quotas.flash.error.must_be_positive")
>  
>    QuotaResource = Struct.new(:name, :used, :max, :available, :unit)
>  
> diff --git a/src/app/views/providers/new.html.haml b/src/app/views/providers/new.html.haml
> index 54144a1..c5d53ac 100644
> --- a/src/app/views/providers/new.html.haml
> +++ b/src/app/views/providers/new.html.haml
> @@ -1,7 +1,7 @@
>  = render :partial => 'layouts/admin_nav'
>  %header.page-header
>    .obj_actions
> -    %span.label.light Choose a provider:
> +    %span.label.light=t("providers.choose_a_provider")
>      %ul#provider_select
>        %li
>          = link_to t("providers.index.create_new_provider"), "javascript:void(0)"
> diff --git a/src/app/views/settings/self_service.html.haml b/src/app/views/settings/self_service.html.haml
> index 898e9ab..c243b6f 100644
> --- a/src/app/views/settings/self_service.html.haml
> +++ b/src/app/views/settings/self_service.html.haml
> @@ -3,7 +3,7 @@
>    .obj_actions
>      .return_to
>        = t 'return_to'
> -      = link_to "Settings", settings_path
> +      = link_to t("settings.settings"), settings_path
>    %h1.settings=t '.self_service_settings'
>  
>  %section.content-section
> diff --git a/src/app/views/users/show.html.haml b/src/app/views/users/show.html.haml
> index 4ebe8a6..cb90992 100644
> --- a/src/app/views/users/show.html.haml
> +++ b/src/app/views/users/show.html.haml
> @@ -54,7 +54,7 @@
>          %td= t("user_groups.#{user_group.membership_source.downcase}")
>  %section.content-section.permissions
>    %header
> -    %h2.permissions=t'permissions.index.permissions'
> +    %h2.permissions=t'instances.tab_captions.permissions'
>    .content
>      = render :partial => 'permissions/objects'
>  /%section.content-section.user
> diff --git a/src/config/locales/activerecord/en.yml b/src/config/locales/activerecord/en.yml
> index 6c3ab0d..6397d17 100644
> --- a/src/config/locales/activerecord/en.yml
> +++ b/src/config/locales/activerecord/en.yml
> @@ -37,6 +37,7 @@ en:
>        task: "Task"
>        user: "User"
>        view_state: "View State"
> +      user_group: User Group
>      attributes:
>        base_permission_object:
>          name: "Name"
> @@ -338,6 +339,10 @@ en:
>          last_login_ip: "Last Login Ip"
>          created_at: "Created At"
>          updated_at: "Updated At"
> +      user_group:
> +        type: Type
> +        name: Name
> +        description: Description
>        view_state:
>          user_id: "User"
>          name: "Name"
> diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
> index 5235672..79698b1 100644
> --- a/src/config/locales/en.yml
> +++ b/src/config/locales/en.yml
> @@ -1474,6 +1474,7 @@ en:
>          updated: "Quota updated"
>        error:
>          not_updated: "Could not update quota. Please check you have entered valid values"
> +        must_be_positive: "must be a positive whole number less than 2147483647"
>    roles:
>      new_role: New Role
>      tab_captions:
> -- 
> 1.7.11.7

Hmm, unfortunately there are a few things this doesn't quite fix.

Overall this is good and fixes what is claimed. The exceptions are #3
and #4 -- on /user_groups/new, the Type, Name, and Description labels
still appear untranslated (#3). If you post that form with validation
errors, the displayed flash message contains English text as well
(though just the model name and field name) (#4).

#9 is not translated either -- /providers/:id (the show method, though
I'm not sure how you get there in the UI) -- still shows
"X-Deltacloud-Driver" and "X-Deltacloud-Cloud". However, it could be
argued that, as HTTP header values, these should not / cannot be
translated, and this is thus not a bug.

Everything else is as described, so conditional ACK here -- this is
good, it just misses a couple things.

-- Matt



More information about the aeolus-devel mailing list