Added I18n translations to helpers
This commit is contained in:
parent
1384b65565
commit
0014024870
11 changed files with 113 additions and 25 deletions
|
|
@ -6,17 +6,17 @@
|
||||||
module AlbumsHelper
|
module AlbumsHelper
|
||||||
def friends_albums_link
|
def friends_albums_link
|
||||||
if params[:friends]
|
if params[:friends]
|
||||||
"Friends Albums"
|
I18n.t('albums.helper.friends_albums')
|
||||||
else
|
else
|
||||||
link_to 'Friends Albums', albums_path({:friends => true})
|
link_to I18n.t('albums.helper.friends_albums'), albums_path({:friends => true})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def your_albums_link
|
def your_albums_link
|
||||||
if params[:friends]
|
if params[:friends]
|
||||||
link_to 'Your Albums', albums_path
|
link_to I18n.t('albums.helper.your_albums'), albums_path
|
||||||
else
|
else
|
||||||
'Your Albums'
|
I18n.t('albums.helper.your_albums')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ module ApplicationHelper
|
||||||
when "Person"
|
when "Person"
|
||||||
person_path(person)
|
person_path(person)
|
||||||
else
|
else
|
||||||
"unknown person"
|
I18n.t('application.helper.unknown_person')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_request(request_count)
|
def new_request(request_count)
|
||||||
"new_requests" if request_count > 0
|
I18n.t('application.helper.new_requests') if request_count > 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def post_yield_tag(post)
|
def post_yield_tag(post)
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ module AspectsHelper
|
||||||
|
|
||||||
def remove_link( aspect )
|
def remove_link( aspect )
|
||||||
if aspect.people.size == 0
|
if aspect.people.size == 0
|
||||||
link_to "remove", aspect, :method => :delete
|
link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete
|
||||||
else
|
else
|
||||||
"<span class='grey' title='Aspect not empty'>remove</span>"
|
"<span class='grey' title=#{I18n.t('aspects.helper.aspect_not_empty')}>#{I18n.t('aspects.helper.remove')}</span>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@
|
||||||
module DashboardsHelper
|
module DashboardsHelper
|
||||||
|
|
||||||
def title_for_page
|
def title_for_page
|
||||||
'home'
|
I18n.t('dashboards.helper.home')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ module ErrorMessagesHelper
|
||||||
# Render error messages for the given objects. The :message and :header_message options are allowed.
|
# Render error messages for the given objects. The :message and :header_message options are allowed.
|
||||||
def error_messages_for(*objects)
|
def error_messages_for(*objects)
|
||||||
options = objects.extract_options!
|
options = objects.extract_options!
|
||||||
options[:header_message] ||= "Invalid Fields"
|
options[:header_message] ||= I18n.t('error_messages.helper.invalid_fields')
|
||||||
options[:message] ||= "Correct the following errors and try again."
|
options[:message] ||= I18n.t('error_messages.helper.correct_the_following_errors_and_try_again')
|
||||||
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
|
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
|
||||||
unless messages.empty?
|
unless messages.empty?
|
||||||
content_tag(:div, :class => "error_messages") do
|
content_tag(:div, :class => "error_messages") do
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ module PeopleHelper
|
||||||
|
|
||||||
def search_or_index
|
def search_or_index
|
||||||
if params[:q]
|
if params[:q]
|
||||||
" results for #{params[:q]}"
|
I18n.t 'people.helper.results_for',:params => params[:q]
|
||||||
else
|
else
|
||||||
" people on pod is aware of"
|
I18n.t "people.helper.people_on_pod_are_aware_of"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ module StatusMessagesHelper
|
||||||
unless @latest_status_message.nil?
|
unless @latest_status_message.nil?
|
||||||
return @latest_status_message.message
|
return @latest_status_message.message
|
||||||
else
|
else
|
||||||
return "No message to display."
|
return I18n.t('status_messages.helper.no_message_to_display')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,21 @@
|
||||||
|
|
||||||
de:
|
de:
|
||||||
hello: "Hallo Welt"
|
hello: "Hallo Welt"
|
||||||
|
application:
|
||||||
|
helper:
|
||||||
|
unknown_person: "unknown person"
|
||||||
|
new_requests: "new requests"
|
||||||
|
dashboards:
|
||||||
|
helper:
|
||||||
|
home: "home"
|
||||||
|
error_messages:
|
||||||
|
helper:
|
||||||
|
invalid_fields: "Invalid Fields"
|
||||||
|
correct_the_following_errors_and_try_again: "Correct the following errors and try again."
|
||||||
|
people:
|
||||||
|
helper:
|
||||||
|
results_for: " resultados para %{params}"
|
||||||
|
people_on_pod_are_aware_of: " gente en pod estan al tanto de "
|
||||||
layouts:
|
layouts:
|
||||||
application:
|
application:
|
||||||
edit_profile: "Profil bearbeiten"
|
edit_profile: "Profil bearbeiten"
|
||||||
|
|
@ -51,6 +66,9 @@ de:
|
||||||
failure: "%{name} wurde nicht geändert."
|
failure: "%{name} wurde nicht geändert."
|
||||||
destroy:
|
destroy:
|
||||||
success: "Album %{name} gelöscht."
|
success: "Album %{name} gelöscht."
|
||||||
|
helper:
|
||||||
|
friends_albums: "Friends Albums"
|
||||||
|
your_albums: "Your Albums"
|
||||||
aspects:
|
aspects:
|
||||||
index:
|
index:
|
||||||
photos: "Fotos"
|
photos: "Fotos"
|
||||||
|
|
@ -66,6 +84,9 @@ de:
|
||||||
new_aspect:
|
new_aspect:
|
||||||
add_a_new_aspect: "Neuen Aspekt erstellen"
|
add_a_new_aspect: "Neuen Aspekt erstellen"
|
||||||
create: "Erstellen"
|
create: "Erstellen"
|
||||||
|
helper:
|
||||||
|
remove: "remove"
|
||||||
|
aspect_not_empty: "Aspect not empty"
|
||||||
users:
|
users:
|
||||||
edit:
|
edit:
|
||||||
cancel: "Abbrechen"
|
cancel: "Abbrechen"
|
||||||
|
|
@ -122,5 +143,5 @@ de:
|
||||||
view_all: "Alle anzeigen"
|
view_all: "Alle anzeigen"
|
||||||
message: "Nachricht"
|
message: "Nachricht"
|
||||||
owner: "Besitzer"
|
owner: "Besitzer"
|
||||||
|
helper:
|
||||||
|
no_message_to_display: "No message to display."
|
||||||
|
|
@ -8,6 +8,21 @@
|
||||||
|
|
||||||
en:
|
en:
|
||||||
hello: "Hello world"
|
hello: "Hello world"
|
||||||
|
application:
|
||||||
|
helper:
|
||||||
|
unknown_person: "unknown person"
|
||||||
|
new_requests: "new requests"
|
||||||
|
dashboards:
|
||||||
|
helper:
|
||||||
|
home: "home"
|
||||||
|
error_messages:
|
||||||
|
helper:
|
||||||
|
invalid_fields: "Invalid Fields"
|
||||||
|
correct_the_following_errors_and_try_again: "Correct the following errors and try again."
|
||||||
|
people:
|
||||||
|
helper:
|
||||||
|
results_for: " results for %{params}"
|
||||||
|
people_on_pod_are_aware_of: " people on pod are aware of"
|
||||||
layouts:
|
layouts:
|
||||||
application:
|
application:
|
||||||
edit_profile: "edit profile"
|
edit_profile: "edit profile"
|
||||||
|
|
@ -51,6 +66,9 @@ en:
|
||||||
failure: "Failed to edit album %{name}."
|
failure: "Failed to edit album %{name}."
|
||||||
destroy:
|
destroy:
|
||||||
success: "Album %{name} deleted."
|
success: "Album %{name} deleted."
|
||||||
|
helper:
|
||||||
|
friends_albums: "Friends Albums"
|
||||||
|
your_albums: "Your Albums"
|
||||||
aspects:
|
aspects:
|
||||||
index:
|
index:
|
||||||
photos: "photos"
|
photos: "photos"
|
||||||
|
|
@ -68,6 +86,9 @@ en:
|
||||||
create: "Create"
|
create: "Create"
|
||||||
create:
|
create:
|
||||||
success:"Click on the plus on the left side to tell Diaspora who can see your new aspect."
|
success:"Click on the plus on the left side to tell Diaspora who can see your new aspect."
|
||||||
|
helper:
|
||||||
|
remove: "remove"
|
||||||
|
aspect_not_empty: "Aspect not empty"
|
||||||
users:
|
users:
|
||||||
edit:
|
edit:
|
||||||
cancel: "Cancel"
|
cancel: "Cancel"
|
||||||
|
|
@ -123,5 +144,5 @@ en:
|
||||||
view_all: "View All"
|
view_all: "View All"
|
||||||
message: "Message"
|
message: "Message"
|
||||||
owner: "Owner"
|
owner: "Owner"
|
||||||
|
helper:
|
||||||
|
no_message_to_display: "No message to display."
|
||||||
|
|
@ -9,6 +9,21 @@
|
||||||
|
|
||||||
es:
|
es:
|
||||||
hello: "Hola Mundo"
|
hello: "Hola Mundo"
|
||||||
|
application:
|
||||||
|
helper:
|
||||||
|
unknown_person: "persona desconocida"
|
||||||
|
new_requests: "nuevas peticiones"
|
||||||
|
dashboards:
|
||||||
|
helper:
|
||||||
|
home: "home"
|
||||||
|
error_messages:
|
||||||
|
helper:
|
||||||
|
invalid_fields: "Campos Invalidos"
|
||||||
|
correct_the_following_errors_and_try_again: "Corrija los siguentes errores y trate de nuevo."
|
||||||
|
people:
|
||||||
|
helper:
|
||||||
|
results_for: " resultados para %{params}"
|
||||||
|
people_on_pod_are_aware_of: " gente en pod estan al tanto de "
|
||||||
layouts:
|
layouts:
|
||||||
application:
|
application:
|
||||||
edit_profile: "editar perfil"
|
edit_profile: "editar perfil"
|
||||||
|
|
@ -40,18 +55,21 @@ es:
|
||||||
editing: "Editando"
|
editing: "Editando"
|
||||||
updated: "actualizado"
|
updated: "actualizado"
|
||||||
are_you_sure: "Esta seguro?"
|
are_you_sure: "Esta seguro?"
|
||||||
delete_album: "Eliminar Album"
|
delete_album: "Eliminar Álbum"
|
||||||
cancel: "Cancelar"
|
cancel: "Cancelar"
|
||||||
index:
|
index:
|
||||||
home: "home"
|
home: "home"
|
||||||
new_album: "Nuevo Album"
|
new_album: "Nuevo Álbum"
|
||||||
create:
|
create:
|
||||||
success: "Creo el album llamado %{name}."
|
success: "Creo el álbum llamado %{name}."
|
||||||
update:
|
update:
|
||||||
success: "Album %{name} fue editado exitosamente."
|
success: "Álbum %{name} fue editado exitosamente."
|
||||||
failure: "Fallo el editar el album %{name}."
|
failure: "Fallo el editar el álbum %{name}."
|
||||||
destroy:
|
destroy:
|
||||||
success: "Album %{name} fue eliminado."
|
success: "Álbum %{name} fue eliminado."
|
||||||
|
helper:
|
||||||
|
friends_albums: "Álbumes de amigos"
|
||||||
|
your_albums: "Tus Álbumes"
|
||||||
aspects:
|
aspects:
|
||||||
index:
|
index:
|
||||||
photos: "fotos"
|
photos: "fotos"
|
||||||
|
|
@ -69,6 +87,9 @@ es:
|
||||||
create: "Crear"
|
create: "Crear"
|
||||||
create:
|
create:
|
||||||
success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto."
|
success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto."
|
||||||
|
helper:
|
||||||
|
remove: "remover"
|
||||||
|
aspect_not_empty: "Aspecto no esta vacio"
|
||||||
users:
|
users:
|
||||||
edit:
|
edit:
|
||||||
cancel: "Cancelar"
|
cancel: "Cancelar"
|
||||||
|
|
@ -123,4 +144,6 @@ es:
|
||||||
destroy: "Destruir"
|
destroy: "Destruir"
|
||||||
view_all: "Ver Todos"
|
view_all: "Ver Todos"
|
||||||
message: "Mensaje"
|
message: "Mensaje"
|
||||||
owner: "Dueño"
|
owner: "Dueño"
|
||||||
|
helper:
|
||||||
|
no_message_to_display: "No hay mensajes que mostrar."
|
||||||
|
|
@ -9,6 +9,21 @@
|
||||||
|
|
||||||
fr:
|
fr:
|
||||||
hello: "Bonjour tout le monde"
|
hello: "Bonjour tout le monde"
|
||||||
|
application:
|
||||||
|
helper:
|
||||||
|
unknown_person: "unknown person"
|
||||||
|
new_requests: "new requests"
|
||||||
|
dashboards:
|
||||||
|
helper:
|
||||||
|
home: "home"
|
||||||
|
error_messages:
|
||||||
|
helper:
|
||||||
|
invalid_fields: "Invalid Fields"
|
||||||
|
correct_the_following_errors_and_try_again: "Correct the following errors and try again."
|
||||||
|
people:
|
||||||
|
helper:
|
||||||
|
results_for: " resultados para %{params}"
|
||||||
|
people_on_pod_are_aware_of: " gente en pod estan al tanto de "
|
||||||
layouts:
|
layouts:
|
||||||
application:
|
application:
|
||||||
edit_profile: "Éditez votre profil"
|
edit_profile: "Éditez votre profil"
|
||||||
|
|
@ -45,6 +60,9 @@ fr:
|
||||||
index:
|
index:
|
||||||
home: "accueil"
|
home: "accueil"
|
||||||
new_album: "Nouvel album"
|
new_album: "Nouvel album"
|
||||||
|
helper:
|
||||||
|
friends_albums: "Friends Albums"
|
||||||
|
your_albums: "Your Albums"
|
||||||
aspects:
|
aspects:
|
||||||
index:
|
index:
|
||||||
photos: "photos"
|
photos: "photos"
|
||||||
|
|
@ -60,6 +78,9 @@ fr:
|
||||||
new_aspect:
|
new_aspect:
|
||||||
add_a_new_aspect: "Ajouter un nouvel aspect"
|
add_a_new_aspect: "Ajouter un nouvel aspect"
|
||||||
create: "Créer"
|
create: "Créer"
|
||||||
|
helper:
|
||||||
|
remove: "remove"
|
||||||
|
aspect_not_empty: "Aspect not empty"
|
||||||
users:
|
users:
|
||||||
edit:
|
edit:
|
||||||
cancel: "Annuler"
|
cancel: "Annuler"
|
||||||
|
|
@ -113,3 +134,5 @@ fr:
|
||||||
view_all: "Tout voir"
|
view_all: "Tout voir"
|
||||||
message: "Message"
|
message: "Message"
|
||||||
owner: "Propriétaire"
|
owner: "Propriétaire"
|
||||||
|
helper:
|
||||||
|
no_message_to_display: "No message to display."
|
||||||
Loading…
Reference in a new issue