Added I18n translations to helpers

This commit is contained in:
Ariel Zavala 2010-09-17 15:26:31 -04:00
parent 1384b65565
commit 0014024870
11 changed files with 113 additions and 25 deletions

View file

@ -6,17 +6,17 @@
module AlbumsHelper
def friends_albums_link
if params[:friends]
"Friends Albums"
I18n.t('albums.helper.friends_albums')
else
link_to 'Friends Albums', albums_path({:friends => true})
link_to I18n.t('albums.helper.friends_albums'), albums_path({:friends => true})
end
end
def your_albums_link
if params[:friends]
link_to 'Your Albums', albums_path
link_to I18n.t('albums.helper.your_albums'), albums_path
else
'Your Albums'
I18n.t('albums.helper.your_albums')
end
end
end

View file

@ -38,7 +38,7 @@ module ApplicationHelper
when "Person"
person_path(person)
else
"unknown person"
I18n.t('application.helper.unknown_person')
end
end
@ -62,7 +62,7 @@ module ApplicationHelper
end
def new_request(request_count)
"new_requests" if request_count > 0
I18n.t('application.helper.new_requests') if request_count > 0
end
def post_yield_tag(post)

View file

@ -10,9 +10,9 @@ module AspectsHelper
def remove_link( aspect )
if aspect.people.size == 0
link_to "remove", aspect, :method => :delete
link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete
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

View file

@ -6,6 +6,6 @@
module DashboardsHelper
def title_for_page
'home'
I18n.t('dashboards.helper.home')
end
end

View file

@ -7,8 +7,8 @@ module ErrorMessagesHelper
# Render error messages for the given objects. The :message and :header_message options are allowed.
def error_messages_for(*objects)
options = objects.extract_options!
options[:header_message] ||= "Invalid Fields"
options[:message] ||= "Correct the following errors and try again."
options[:header_message] ||= I18n.t('error_messages.helper.invalid_fields')
options[:message] ||= I18n.t('error_messages.helper.correct_the_following_errors_and_try_again')
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
unless messages.empty?
content_tag(:div, :class => "error_messages") do

View file

@ -7,9 +7,9 @@ module PeopleHelper
def search_or_index
if params[:q]
" results for #{params[:q]}"
I18n.t 'people.helper.results_for',:params => params[:q]
else
" people on pod is aware of"
I18n.t "people.helper.people_on_pod_are_aware_of"
end
end

View file

@ -8,7 +8,7 @@ module StatusMessagesHelper
unless @latest_status_message.nil?
return @latest_status_message.message
else
return "No message to display."
return I18n.t('status_messages.helper.no_message_to_display')
end
end
end

View file

@ -8,6 +8,21 @@
de:
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:
application:
edit_profile: "Profil bearbeiten"
@ -51,6 +66,9 @@ de:
failure: "%{name} wurde nicht geändert."
destroy:
success: "Album %{name} gelöscht."
helper:
friends_albums: "Friends Albums"
your_albums: "Your Albums"
aspects:
index:
photos: "Fotos"
@ -66,6 +84,9 @@ de:
new_aspect:
add_a_new_aspect: "Neuen Aspekt erstellen"
create: "Erstellen"
helper:
remove: "remove"
aspect_not_empty: "Aspect not empty"
users:
edit:
cancel: "Abbrechen"
@ -122,5 +143,5 @@ de:
view_all: "Alle anzeigen"
message: "Nachricht"
owner: "Besitzer"
helper:
no_message_to_display: "No message to display."

View file

@ -8,6 +8,21 @@
en:
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:
application:
edit_profile: "edit profile"
@ -51,6 +66,9 @@ en:
failure: "Failed to edit album %{name}."
destroy:
success: "Album %{name} deleted."
helper:
friends_albums: "Friends Albums"
your_albums: "Your Albums"
aspects:
index:
photos: "photos"
@ -68,6 +86,9 @@ en:
create: "Create"
create:
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:
edit:
cancel: "Cancel"
@ -123,5 +144,5 @@ en:
view_all: "View All"
message: "Message"
owner: "Owner"
helper:
no_message_to_display: "No message to display."

View file

@ -9,6 +9,21 @@
es:
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:
application:
edit_profile: "editar perfil"
@ -40,18 +55,21 @@ es:
editing: "Editando"
updated: "actualizado"
are_you_sure: "Esta seguro?"
delete_album: "Eliminar Album"
delete_album: "Eliminar Álbum"
cancel: "Cancelar"
index:
home: "home"
new_album: "Nuevo Album"
new_album: "Nuevo Álbum"
create:
success: "Creo el album llamado %{name}."
success: "Creo el álbum llamado %{name}."
update:
success: "Album %{name} fue editado exitosamente."
failure: "Fallo el editar el album %{name}."
success: "Álbum %{name} fue editado exitosamente."
failure: "Fallo el editar el álbum %{name}."
destroy:
success: "Album %{name} fue eliminado."
success: "Álbum %{name} fue eliminado."
helper:
friends_albums: "Álbumes de amigos"
your_albums: "Tus Álbumes"
aspects:
index:
photos: "fotos"
@ -69,6 +87,9 @@ es:
create: "Crear"
create:
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:
edit:
cancel: "Cancelar"
@ -124,3 +145,5 @@ es:
view_all: "Ver Todos"
message: "Mensaje"
owner: "Dueño"
helper:
no_message_to_display: "No hay mensajes que mostrar."

View file

@ -9,6 +9,21 @@
fr:
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:
application:
edit_profile: "Éditez votre profil"
@ -45,6 +60,9 @@ fr:
index:
home: "accueil"
new_album: "Nouvel album"
helper:
friends_albums: "Friends Albums"
your_albums: "Your Albums"
aspects:
index:
photos: "photos"
@ -60,6 +78,9 @@ fr:
new_aspect:
add_a_new_aspect: "Ajouter un nouvel aspect"
create: "Créer"
helper:
remove: "remove"
aspect_not_empty: "Aspect not empty"
users:
edit:
cancel: "Annuler"
@ -113,3 +134,5 @@ fr:
view_all: "Tout voir"
message: "Message"
owner: "Propriétaire"
helper:
no_message_to_display: "No message to display."