translations

This commit is contained in:
Meutel 2015-08-05 19:21:30 +02:00
parent 028887f1a2
commit 58a556378f
10 changed files with 55 additions and 45 deletions

View File

@ -1,14 +1,14 @@
<% opts = { data: { url: url_for, remote: true, method: :get } } <% opts = { data: { url: url_for, remote: true, method: :get } }
content_for :latest_filter do %> content_for :latest_filter do %>
<div class="form-group"> <div class="form-group">
<%= label_tag "sort", "Sort by" %> <%= label_tag "sort", t(:sort_by) %>
<label class="radio-inline"> <label class="radio-inline">
<%= radio_button_tag "sort", "latest", @preference.sort == "latest",opts %> <%= radio_button_tag "sort", "latest", @preference.sort == "latest",opts %>
Date <%= t :sort_by_date %>
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<%= radio_button_tag "sort", "alpha", @preference.sort == "alpha", opts %> <%= radio_button_tag "sort", "alpha", @preference.sort == "alpha", opts %>
Name <%= t :sort_by_name %>
</label> </label>
</div> </div>
<% end %> <% end %>
@ -17,9 +17,9 @@ content_for :latest_filter do %>
<%= will_paginate class: "center" %> <%= will_paginate class: "center" %>
<table class="table table-striped authors"> <table class="table table-striped authors">
<tr> <tr>
<th>Name</th> <th><%= t :col_book_title %></th>
<th>Authors</th> <th><%= t :col_book_authors %></th>
<th>Serie</th> <th><%= t :col_book_serie %></th>
</tr> </tr>
<% @books.each do |book| %> <% @books.each do |book| %>
<tr> <tr>

View File

@ -4,7 +4,7 @@
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-download-alt"></span> <span class="glyphicon glyphicon-download-alt"></span>
Download <span class="caret"></span> <%= t :download %> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<% @book.data.each do |d| %> <% @book.data.each do |d| %>

View File

@ -3,7 +3,7 @@
<%= link_to "#filterContent", { class: "collapsed", data: { toggle: "collapse" } } do %> <%= link_to "#filterContent", { class: "collapsed", data: { toggle: "collapse" } } do %>
<h3 class="panel-title"> <h3 class="panel-title">
<span class="glyphicon filterToggle" aria-hidden="true"/> <span class="glyphicon filterToggle" aria-hidden="true"/>
Filter <%= t :filter %>
</h3> </h3>
<% end %> <% end %>
</div> </div>
@ -13,9 +13,9 @@
<%= form_tag({}, {method: :get, remote: true}) do %> <%= form_tag({}, {method: :get, remote: true}) do %>
<div class="input-group"> <div class="input-group">
<span class="input-group-btn"> <span class="input-group-btn">
<%= button_tag "Search", class: "btn btn-default" %> <%= button_tag t(:search), class: "btn btn-default" %>
</span> </span>
<%= search_field_tag(:term, @preference.term, placeholder: "Search for...", class: "form-control") %> <%= search_field_tag(:term, @preference.term, placeholder: t(:search_ph), class: "form-control") %>
</div> </div>
<% end %> <% end %>
<%= render'layouts/perpage' %> <%= render'layouts/perpage' %>

View File

@ -1,9 +1,8 @@
<% initials = ['0'] + ('A'..'Z').to_a %> <% initials = ['0'] + ('A'..'Z').to_a %>
<div class="center"> <div class="center">
<ul class="pagination pagination-sm" title="Initial letter"> <ul class="pagination pagination-sm" title="<%= t :initial_tooltip %>">
<% initials.each do |i| <% initials.each do |i|
is_cur = (i == @preference.initial) is_cur = (i == @preference.initial) %>
%>
<%= content_tag :li, class: (is_cur ? "active": nil) do %> <%= content_tag :li, class: (is_cur ? "active": nil) do %>
<%= link_to i, url_for(initial: ( is_cur ? "reset" : i)), remote: true %> <%= link_to i, url_for(initial: ( is_cur ? "reset" : i)), remote: true %>
<% end %> <% end %>

View File

@ -1,5 +1,5 @@
<div class="center"> <div class="center">
<ul class="pagination pagination-sm" title="Items per page"> <ul class="pagination pagination-sm" title="<%= t :per_page %>">
<% [10,20,50,100].each do |p| %> <% [10,20,50,100].each do |p| %>
<%= content_tag :li, class: (p == @preference.per_page ? "active": nil) do %> <%= content_tag :li, class: (p == @preference.per_page ? "active": nil) do %>
<%= link_to p, url_for(per_page: p), remote: true %> <%= link_to p, url_for(per_page: p), remote: true %>

View File

@ -1,2 +1,2 @@
<h1>About</h1> <h1><%= t :about %></h1>
<p>Bouquins is a web frontend for calibre e-book manager</p> <p><%= t :about_descr %></p>

View File

@ -3,9 +3,9 @@
<h2><%= t :welcome_count, count: @books_count %></h2> <h2><%= t :welcome_count, count: @books_count %></h2>
<p> <p>
<%= link_to "Books", books_path, class: "btn btn-lg btn-primary", remote: true %> <%= link_to t(:books), books_path, class: "btn btn-lg btn-primary", remote: true %>
<%= link_to "Authors", authors_path, class: "btn btn-lg btn-primary", remote: true %> <%= link_to t(:authors), authors_path, class: "btn btn-lg btn-primary", remote: true %>
<%= link_to "Series", series_path, class: "btn btn-lg btn-primary", remote: true %> <%= link_to t(:series), series_path, class: "btn btn-lg btn-primary", remote: true %>
</p> </p>
</div> </div>
<div class="container-fluid" id="items"> <div class="container-fluid" id="items">

View File

@ -18,7 +18,7 @@ module BouquinsRor
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de config.i18n.default_locale = :fr
# Do not swallow errors in after_commit/after_rollback callbacks. # Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true config.active_record.raise_in_transactional_callbacks = true

View File

@ -1,25 +1,20 @@
# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
# I18n.t 'hello'
#
# In views, this is aliased to just `t`:
#
# <%= t('hello') %>
#
# To use a different locale, set it with `I18n.locale`:
#
# I18n.locale = :es
#
# This would use the information in config/locales/es.yml.
#
# To learn more, please read the Rails Internationalization guide
# available at http://guides.rubyonrails.org/i18n.html.
en: en:
hello: "Hello world"
library: "Library" library: "Library"
welcome_count: "Browse %{count} books" welcome_count: "Browse %{count} books"
books: "Books"
authors: "Authors"
series: "Series"
about: "About"
about_descr: "Bouquins is a web frontend for calibre e-book manager"
download: "Télécharger"
initial_tooltip: "Initiale"
filter: "Filter"
filter: "Filtre"
search: "Search"
search_ph: "Search for..."
per_page: "Items per page"
sort_by_date: "Date"
sort_by_name: "Name"
col_book_title: "Title"
col_book_authors: "Authors"
col_book_serie: "Serie"

View File

@ -1,4 +1,20 @@
fr: fr:
hello: "Bonjour" library: "Bibliothèque"
library: "Bibliothèque" welcome_count: "Parcourir les %{count} livres"
welcome_count: "Parcourir les %{count} livres" books: "Livres"
authors: "Auteurs"
series: "Series"
about: "A propos"
about_descr: "Bouquins est une interface web pour le gestionnaire d'e-books calibre"
download: "Download"
initial_tooltip: "Initial letter"
filter: "Filtre"
search: "Rechercher"
search_ph: "Rechercher..."
per_page: "Eléments par page"
sort_by: "Trier par"
sort_by_date: "Date"
sort_by_name: "Nom"
col_book_title: "Titre"
col_book_authors: "Auteurs"
col_book_serie: "Serie"