Use lazy translations where possible

This commit is contained in:
Andy Allan 2018-04-25 14:10:59 +08:00
parent 4a9846b078
commit 5bed217823
75 changed files with 401 additions and 401 deletions

View file

@ -1,29 +1,29 @@
<div class='standard-form'>
<fieldset>
<div class="form-row">
<label class='standard-label' for="client_application_name"><%= t'oauth_clients.form.name' %> (<%= t'oauth_clients.form.required' %>)</label>
<label class='standard-label' for="client_application_name"><%= t '.name' %> (<%= t '.required' %>)</label>
<%= f.text_field :name %>
</div>
<div class="form-row">
<label class='standard-label' for="client_application_url"><%= t'oauth_clients.form.url' %> (<%= t'oauth_clients.form.required' %>)</label>
<label class='standard-label' for="client_application_url"><%= t '.url' %> (<%= t '.required' %>)</label>
<%= f.text_field :url %>
</div>
<div class="form-row">
<label class='standard-label' for="client_application_callback_url"><%= t'oauth_clients.form.callback_url' %></label>
<label class='standard-label' for="client_application_callback_url"><%= t '.callback_url' %></label>
<%= f.text_field :callback_url %>
</div>
<div class="form-row">
<label class='standard-label' for="client_application_support_url"><%= t'oauth_clients.form.support_url' %></label>
<label class='standard-label' for="client_application_support_url"><%= t '.support_url' %></label>
<%= f.text_field :support_url %>
</div>
</fieldset>
<fieldset class='form-divider'>
<p><%= t'oauth_clients.form.requests' %></p>
<p><%= t '.requests' %></p>
<% ClientApplication.all_permissions.each do |perm| %>
<div class="form-row">
<%= f.check_box perm %>
<label class='standard-label' for="client_application_<%= perm.to_s %>"><%= t('oauth_clients.form.' + perm.to_s) %></label>
<label class='standard-label' for="client_application_<%= perm.to_s %>"><%= t('.' + perm.to_s) %></label>
</div>
<% end %>
</fieldset>
</div>
</div>

View file

@ -1,8 +1,8 @@
<% content_for :heading do %>
<h1><%= t'oauth_clients.edit.title' %></h1>
<h1><%= t '.title' %></h1>
<% end %>
<%= form_for @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<%= submit_tag t'oauth_clients.edit.submit' %>
<%= submit_tag t '.submit' %>
<% end %>

View file

@ -1,13 +1,13 @@
<% content_for :heading do %>
<h1><%= t'oauth_clients.index.title' %></h1>
<h1><%= t '.title' %></h1>
<% end %>
<% unless @tokens.empty? %>
<h3><%= t'oauth_clients.index.my_tokens' %></h3>
<p><%= t'oauth_clients.index.list_tokens' %></p>
<h3><%= t '.my_tokens' %></h3>
<p><%= t '.list_tokens' %></p>
<table>
<tr><th><%= t'oauth_clients.index.application' %></th>
<th><%= t'oauth_clients.index.issued_at' %></th><th>&nbsp;</th></tr>
<tr><th><%= t '.application' %></th>
<th><%= t '.issued_at' %></th><th>&nbsp;</th></tr>
<% @tokens.each do |token|%>
<%= content_tag_for :tr, token do %>
<td><%= link_to token.client_application.name, token.client_application.url %></td>
@ -15,22 +15,22 @@
<td>
<%= form_tag :controller => 'oauth', :action => 'revoke' do %>
<%= hidden_field_tag 'token', token.token %>
<%= submit_tag t('oauth_clients.index.revoke') %>
<%= submit_tag t('.revoke') %>
<% end %>
</td>
<% end %>
<% end %>
</table>
<% end %>
<h3><%= t'oauth_clients.index.my_apps' %></h3>
<h3><%= t '.my_apps' %></h3>
<% if @client_applications.empty? %>
<p><%= raw(t('oauth_clients.index.no_apps', :oauth => "<a href=\"https://oauth.net\">OAuth</a>")) %></p>
<p><%= raw(t('.no_apps', :oauth => "<a href=\"https://oauth.net\">OAuth</a>")) %></p>
<% else %>
<p><%= t'oauth_clients.index.registered_apps' %></p>
<p><%= t '.registered_apps' %></p>
<% @client_applications.each do |client|%>
<%= div_for client do %>
<%= link_to client.name, :action => :show, :id => client.id %>
<% end %>
<% end %>
<% end %>
<h3><%= link_to t('oauth_clients.index.register_new'), :action => :new %></h3>
<h3><%= link_to t('.register_new'), :action => :new %></h3>

View file

@ -1,10 +1,10 @@
<% content_for :heading do %>
<h1><%= t'oauth_clients.new.title' %></h1>
<h1><%= t '.title' %></h1>
<% end %>
<div class='standard-form'>
<%= form_for :client_application, :url => { :action => :create } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<%= submit_tag t('oauth_clients.new.submit') %>
<%= submit_tag t('.submit') %>
<% end %>
</div>

View file

@ -1 +1 @@
<p><%= t('oauth_clients.not_found.sorry', :type => @type) %></p>
<p><%= t('.sorry', :type => @type) %></p>

View file

@ -1,33 +1,33 @@
<% content_for :heading do %>
<h1><%= t('oauth_clients.show.title', :app_name => @client_application.name) %></h1>
<h1><%= t('.title', :app_name => @client_application.name) %></h1>
<% end %>
<div class='prose'>
<p>
<strong><%= t'oauth_clients.show.key' %></strong> <%=@client_application.key %>
<strong><%= t '.key' %></strong> <%=@client_application.key %>
</p>
<p>
<strong><%= t'oauth_clients.show.secret' %></strong> <%=@client_application.secret %>
<strong><%= t '.secret' %></strong> <%=@client_application.secret %>
</p>
<p>
<strong><%= t'oauth_clients.show.url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %>
<strong><%= t '.url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %>
</p>
<p>
<strong><%= t'oauth_clients.show.access_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %>
<strong><%= t '.access_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %>
</p>
<p>
<strong><%= t'oauth_clients.show.authorize_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %>
<strong><%= t '.authorize_url' %></strong> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %>
</p>
<p><%= t'oauth_clients.show.requests' %></p>
<p><%= t '.requests' %></p>
<ul><% @client_application.permissions.each do |perm| %>
<div class="field">
<li><%= t('oauth_clients.form.' + perm.to_s) %></li>
</div>
<% end %></ul>
<p><%= t'oauth_clients.show.support_notice' %></p>
<p><%= t '.support_notice' %></p>
</div>
<div class="buttons">
<%= button_to t('oauth_clients.show.edit'), edit_oauth_client_path(@client_application.user.display_name, @client_application), :method => :get, :class=> "oauth-edit" %>
<%= button_to t('oauth_clients.show.delete'), oauth_client_path(@client_application.user.display_name, @client_application), :method => :delete, :data => { :confirm => t('oauth_clients.show.confirm') }, :class=> "oauth-delete deemphasize" %>
<%= button_to t('.edit'), edit_oauth_client_path(@client_application.user.display_name, @client_application), :method => :get, :class=> "oauth-edit" %>
<%= button_to t('.delete'), oauth_client_path(@client_application.user.display_name, @client_application), :method => :delete, :data => { :confirm => t('.confirm') }, :class=> "oauth-delete deemphasize" %>
</div>