Skip to content

Commit

Permalink
Corrected, added, and normalized missing translation for admin/users
Browse files Browse the repository at this point in the history
  • Loading branch information
beneggett authored and radar committed May 4, 2012
1 parent fa9fddd commit c6676e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions api/app/controllers/spree/admin/users_controller_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

def generate_api_key
if @user.generate_api_key!
flash.notice = t('api.key_generated')
flash.notice = t('key_generated', :scope => 'spree.api')
end
redirect_to edit_admin_user_path(@user)
end

def clear_api_key
if @user.clear_api_key!
flash.notice = t('api.key_cleared')
flash.notice = t('key_cleared', :scope => 'spree.api')
end
redirect_to edit_admin_user_path(@user)
end
Expand Down
12 changes: 6 additions & 6 deletions api/app/views/spree/admin/users/_api_fields.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<h2><%= t('api.access') %></h2>
<h2><%= t('access', :scope => 'spree.api') %></h2>

<% if @user.authentication_token.present? %>
<p><strong><%= t('api.key') %></strong> <%= @user.authentication_token %></p>
<p><strong><%= t('key', :scope => 'spree.api') %></strong> <%= @user.authentication_token %></p>

<%= form_tag spree.clear_api_key_admin_user_path(@user), :method => :put do %>
<%= button t('api.clear_key') %>
<%= button t('clear_key', :scope => 'spree.api') %>
<% end %>

<%= form_tag spree.generate_api_key_admin_user_path(@user), :method => :put do %>
<%= button t('api.regenerate_key') %>
<%= button t('regenerate_key', :scope => 'spree.api') %>
<% end %>

<% else %>

<p><%= t('api.no_key') %></p>
<p><%= t('no_key', :scope => 'spree.api') %></p>
<%= form_tag spree.generate_api_key_admin_user_path(@user), :method => :put do %>
<%= button t('api.generate_key') %>
<%= button t('generate_key', :scope => 'spree.api') %>
<% end %>
<% end %>
9 changes: 8 additions & 1 deletion api/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ en:
resource_not_found: "The resource you were looking for could not be found."
gateway_error: "There was a problem with the payment gateway: %{text}"
credit_over_limit: "This payment can only be credited up to %{limit}. Please specify an amount less than or equal to this number."

access: "API Access"
key: "Key"
clear_key: "Clear key"
regenerate_key: "Regenerate Key"
no_key: "No key"
generate_key: "Generate API key"
key_generated: "Key generated"
key_cleared: "Key cleared"
order:
could_not_transition: "The order could not be transitioned. Please fix the errors and try again."
invalid_shipping_method: "Invalid shipping method specified."

0 comments on commit c6676e8

Please sign in to comment.