Added & cleaned up messages relating to a given user not existing

The following pages now have a <title> that can be set in localizations:

 * /user/USER_DOES_NOT_EXIST
 * /user/USER_DOES_NOT_EXIST/diary
 * /user/USER_DOES_NOT_EXIST/traces
 * /message/*/ID_DOES_NOT_EXIST

In addition I've cleaned up the i18n message keys of all the
''no_such_user.rhtml'' pages involved. They now all use
title/heading/body for the <title>, <h2> and <p> respectively. And the
message key {{user}} instead of {{name}}.
This commit is contained in:
Ævar Arnfjörð Bjarmason 2009-06-06 13:15:53 +00:00
parent f798504669
commit db51d7f3dd
18 changed files with 60 additions and 39 deletions

View file

@ -63,6 +63,7 @@ class DiaryEntryController < ApplicationController
:order => 'created_at DESC',
:per_page => 20)
else
@title = t'diary_entry.no_such_user.title'
@not_found_user = params[:display_name]
render :action => 'no_such_user', :status => :not_found

View file

@ -29,6 +29,7 @@ class MessageController < ApplicationController
@title = params[:title]
end
rescue ActiveRecord::RecordNotFound
@title = t'message.no_such_user.title'
render :action => 'no_such_user', :status => :not_found
end
@ -40,6 +41,7 @@ class MessageController < ApplicationController
@to_user = User.find(message.from_user_id)
render :action => 'new'
rescue ActiveRecord::RecordNotFound
@title = t'message.no_such_user.title'
render :action => 'no_such_user', :status => :not_found
end
@ -50,6 +52,7 @@ class MessageController < ApplicationController
@message.message_read = true if @message.to_user_id == @user.id
@message.save
rescue ActiveRecord::RecordNotFound
@title = t'message.no_such_user.title'
render :action => 'no_such_user', :status => :not_found
end
@ -90,6 +93,7 @@ class MessageController < ApplicationController
end
end
rescue ActiveRecord::RecordNotFound
@title = t'message.no_such_user.title'
render :action => 'no_such_user', :status => :not_found
end
end

View file

@ -18,6 +18,7 @@ class TraceController < ApplicationController
if target_user.nil? and !display_name.blank?
target_user = User.find(:first, :conditions => [ "visible = ? and display_name = ?", true, display_name])
if target_user.nil?
@title = t'trace.no_such_user.title'
@not_found_user = display_name
render :action => 'no_such_user', :status => :not_found
return

View file

@ -251,6 +251,7 @@ class UserController < ApplicationController
if @this_user
@title = @this_user.display_name
else
@title = t 'user.no_such_user.title'
@not_found_user = params[:display_name]
render :action => 'no_such_user', :status => :not_found
end

View file

@ -1,2 +1,2 @@
<h2><%= h(@not_found_user) %></h2>
<h2><%= t 'diary_entry.no_such_user.heading', :user => @not_found_user %></h2>
<p><%= t 'diary_entry.no_such_user.body', :user => @not_found_user %></p>

View file

@ -1,2 +1,2 @@
<h1><%= t'message.no_such_user.no_such_user' %></h1>
<p><%= t'message.no_such_user.sorry' %></p>
<h1><%= t'message.no_such_user.heading' %></h1>
<p><%= t'message.no_such_user.body' %></p>

View file

@ -1,2 +1,2 @@
<h2><%= h(@not_found_user) %></h2>
<p><%= t'trace.no_such_user.no_such_user', :name => @not_found_user %></p>
<h2><%= t'trace.no_such_user.heading', :user => @not_found_user %></h2>
<p><%= t'trace.no_such_user.body', :user => @not_found_user %></p>

View file

@ -1,2 +1,2 @@
<h2><%= h(@not_found_user) %></h2>
<h2><%= t 'user.no_such_user.heading', :user => @not_found_user %></h2>
<p><%= t 'user.no_such_user.body', :user => @not_found_user %></p>

View file

@ -432,8 +432,8 @@ de:
back_to_inbox: "Zurück zum Posteingang"
message_sent: "Nachricht gesendet"
no_such_user:
no_such_user: "Benutzer oder Nachricht nicht gefunden"
sorry: "Wir konnten leider keinen entsprechenden Benutzer oder eine entsprechende Nachricht finden. Du hast dich möglicherweise vertippt oder du bist einem ungültigem Link gefolgt."
heading: "Benutzer oder Nachricht nicht gefunden"
body: "Wir konnten leider keinen entsprechenden Benutzer oder eine entsprechende Nachricht finden. Du hast dich möglicherweise vertippt oder du bist einem ungültigem Link gefolgt."
outbox:
title: "Gesendet"
my_inbox: "{{inbox_link}}"
@ -503,7 +503,7 @@ de:
tags: "Tags:"
save_button: "Speichere Änderungen"
no_such_user:
no_such_user: "Entschuldige, wir konnten keinen Benutzer mit dem Namen {{name}} finden. Du hast dich möglicherweise vertippt, oder du bist einem ungültigem Link gefolgt."
body: "Entschuldige, wir konnten keinen Benutzer mit dem Namen {{user}} finden. Du hast dich möglicherweise vertippt, oder du bist einem ungültigem Link gefolgt."
trace_form:
upload_gpx: "GPX-Datei"
description: "Beschreibung"
@ -679,4 +679,4 @@ de:
already_a_friend: "Du bist bereits mit {{name}} befreundet."
remove_friend:
success: "{{name} wurde als Freund entfernt."
not_a_friend: "{{name}} ist nicht dein Freund."
not_a_friend: "{{name}} ist nicht dein Freund."

View file

@ -256,6 +256,8 @@ en:
heading: "No entry with the id: {{id}}"
body: "Sorry, there is no diary entry or comment with the id {{id}}. Please check your spelling, or maybe the link you clicked is wrong."
no_such_user:
title: "No such user"
heading: "The user {{user}} does not exist"
body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
diary_entry:
posted_by: "Posted by {{link_user}} at {{created}} in {{language}}"
@ -438,8 +440,9 @@ en:
back_to_inbox: "Back to inbox"
message_sent: "Message sent"
no_such_user:
no_such_user: "No such user or message"
sorry: "Sorry there is no user or message with that name or id"
title: "No such user or message"
heading: "No such user or message"
body: "Sorry there is no user or message with that name or id"
outbox:
title: "Outbox"
my_inbox: "My {{inbox_link}}"
@ -509,7 +512,9 @@ en:
tags: "Tags:"
save_button: "Save Changes"
no_such_user:
no_such_user: "Sorry, there is no user with the name {{name}}. Please check your spelling, or maybe the link you clicked is wrong."
title: "No such user"
heading: "The user {{user}} does not exist"
body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
trace_form:
upload_gpx: "Upload GPX File"
description: "Description"
@ -607,6 +612,8 @@ en:
signup: Signup
flash create success message: "User was successfully created. Check your email for a confirmation note, and you'll be mapping in no time :-)<br /><br />Please note that you won't be able to login until you've received and confirmed your email address.<br /><br />If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests."
no_such_user:
title: "No such user"
heading: "The user {{user}} does not exist"
body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
view:
my diary: my diary

View file

@ -384,8 +384,8 @@ he:
back_to_inbox: "Back to inbox"
message_sent: "Message sent"
no_such_user:
no_such_user: "No such user or message"
sorry: "Sorry there is no user or message with that name or id"
heading: "No such user or message"
body: "Sorry there is no user or message with that name or id"
outbox:
title: "Outbox"
my_inbox: "My {{inbox_link}}"
@ -455,7 +455,7 @@ he:
tags: "Tags:"
save_button: "Save Changes"
no_such_user:
no_such_user: "Sorry, there is no user with the name {{name}}. Please check your spelling, or maybe the link you clicked is wrong."
body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
trace_form:
upload_gpx: "Upload GPX File"
description: "תאור"

View file

@ -254,7 +254,9 @@ is:
heading: "No entry with the id: {{id}}"
body: "Sorry, there is no diary entry or comment with the id {{id}}. Please check your spelling, or maybe the link you clicked is wrong."
no_such_user:
body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
title: "Notandi ekki til"
heading: "Notandinn {{user}} er ekki til"
body: "Það er ekki til notandi með nafninu {{user}}. Kannski slóstu nafnið rangt inn eða fylgdir ógildum tengli."
diary_entry:
posted_by: "Sett inn af {{link_user}} klukkan {{created}} á {{language}}"
comment_link: "Bæta við athugasemd"
@ -388,8 +390,9 @@ is:
back_to_inbox: "Aftur í innhólf"
message_sent: "Skilaboðin hafa verið send"
no_such_user:
no_such_user: "No such user or message"
sorry: "Sorry there is no user or message with that name or id"
title: "Notandi eða skilaboð ekki til"
heading: "Notandi eða skilaboð ekki til"
body: "Það eru engin skilaboð eða notandi til með nafni"
outbox:
title: "Úthólf"
my_inbox: "Mitt {{inbox_link}}"
@ -459,7 +462,9 @@ is:
tags: "Tögg:"
save_button: "Save Changes"
no_such_user:
no_such_user: "Sorry, there is no user with the name {{name}}. Please check your spelling, or maybe the link you clicked is wrong."
title: "Notandi ekki til"
heading: "Notandinn {{user}} er ekki til"
body: "Það er ekki til notandi með nafninu {{user}}. Kannski slóstu nafnið rangt inn eða fylgdir ógildum tengli."
trace_form:
upload_gpx: "Upphala GPX skrá"
description: "Lýsing"
@ -557,7 +562,9 @@ is:
signup: "Nýskrá"
flash create success message: "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br /><br />Please note that you won't be able to login until you've received and confirmed your email address.<br /><br />If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests."
no_such_user:
body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
title: "Notandi ekki til"
heading: "Notandinn {{user}} er ekki til"
body: "Það er ekki til notandi með nafninu {{user}}. Kannski slóstu nafnið rangt inn eða fylgdir ógildum tengli."
view:
my diary: bloggið mitt
new diary entry: ný bloggfærsla

View file

@ -384,8 +384,8 @@ it:
back_to_inbox: "Ritorna ai messaggi in arrivo"
message_sent: "Messaggio inviato"
no_such_user:
no_such_user: "Nessun utente o messaggio"
sorry: "Spiacenti, ma non c'è alcun utente o messaggio con questo nome o identificativo"
heading: "Nessun utente o messaggio"
body: "Spiacenti, ma non c'è alcun utente o messaggio con questo nome o identificativo"
outbox:
title: "In uscita"
my_inbox: "Messaggi {{inbox_link}}"
@ -455,7 +455,7 @@ it:
tags: "Etichette:"
save_button: "Salva modifiche"
no_such_user:
no_such_user: "Spiacenti, non c'è alcun utente con il nome {{name}}. Controllare la digitazione, oppure potrebbe essere che il collegamento che si è seguito sia errato."
body: "Spiacenti, non c'è alcun utente con il nome {{user}}. Controllare la digitazione, oppure potrebbe essere che il collegamento che si è seguito sia errato."
trace_form:
upload_gpx: "Carica file GPX"
description: "Descrizione"

View file

@ -384,8 +384,8 @@ nl:
back_to_inbox: "Terug naar Postvak IN"
message_sent: "Bericht verzonden"
no_such_user:
no_such_user: "Deze gebruiker of bericht bestaat niet"
sorry: "Sorry, er is geen gebruiker of bericht met die naam of id"
heading: "Deze gebruiker of bericht bestaat niet"
body: "Sorry, er is geen gebruiker of bericht met die naam of id"
outbox:
title: "Postvak UIT"
my_inbox: "Mijn {{inbox_link}}"
@ -455,7 +455,7 @@ nl:
tags: "Tags:"
save_button: "Wijzigingen opslaan"
no_such_user:
no_such_user: "Sorry, er is geen gebruiker {{name}}. Controleer de spelling, of misschien is de link waarop je klikte verkeerd."
body: "Sorry, er is geen gebruiker {{user}}. Controleer de spelling, of misschien is de link waarop je klikte verkeerd."
trace_form:
upload_gpx: "Upload GPX-bestand"
description: "Beschrijving"

View file

@ -387,8 +387,8 @@ pl:
back_to_inbox: "Powrót do skrzynki"
message_sent: "Wiadomość wysłana"
no_such_user:
no_such_user: "Nie ma takiego użytkownika / wiadomości"
sorry: "Niestety nie znaleziono użytkownika / wiadomości o tej nazwie lub id"
heading: "Nie ma takiego użytkownika / wiadomości"
body: "Niestety nie znaleziono użytkownika / wiadomości o tej nazwie lub id"
outbox:
title: "Wiadomości wysłane"
my_inbox: "Moja skrzynka {{inbox_link}}"
@ -458,7 +458,7 @@ pl:
tags: "Tagi:"
save_button: "Zapisz zmiany"
no_such_user:
no_such_user: "Niestety nie znaleziono użytkownika o nazwie {{name}}, sprawdź pisownię. Być może użyłeś(aś) linku który był niepoprawny."
body: "Niestety nie znaleziono użytkownika o nazwie {{user}}, sprawdź pisownię. Być może użyłeś(aś) linku który był niepoprawny."
trace_form:
upload_gpx: "Wgraj plik GPX"
description: "Opis"

View file

@ -384,8 +384,8 @@ ru:
back_to_inbox: "Назад ко входящим"
message_sent: "Сообщение отправлено"
no_such_user:
no_such_user: "Нет такого пользователя/сообщения"
sorry: "К сожалению, не удалось найти пользователя или сообщение с таким именем или идентификатором"
heading: "Нет такого пользователя/сообщения"
body: "К сожалению, не удалось найти пользователя или сообщение с таким именем или идентификатором"
outbox:
title: "Исходящие"
my_inbox: "Мои {{inbox_link}}"
@ -455,7 +455,7 @@ ru:
tags: "Метки:"
save_button: "Сохранить изменения"
no_such_user:
no_such_user: "Извините, пользователя с именем {{name}} не существует. Пожалуйста, проверьте правильность написания. Возможно ссылка, по которой вы пришли, неверна."
body: "Извините, пользователя с именем {{user}} не существует. Пожалуйста, проверьте правильность написания. Возможно ссылка, по которой вы пришли, неверна."
trace_form:
upload_gpx: "Файл GPX"
description: "Описание"

View file

@ -381,8 +381,8 @@ sl:
send_button: "Pošlji"
back_to_inbox: "Nazaj na prejeto pošto"
no_such_user:
no_such_user: "No such user or message"
sorry: "Sorry there is no user or message with that name or id"
heading: "No such user or message"
body: "Sorry there is no user or message with that name or id"
outbox:
my_inbox: "Moja {{inbox_link}}"
inbox: "prejeta"
@ -447,7 +447,7 @@ sl:
tags: "Oznake:"
save_button: "Shrani spremembe"
no_such_user:
no_such_user: "Oprostite, uporabnika z imenom {{user}} ni. Prosimo, preverite črkovanje in povezavo, ki ste jo kliknili."
body: "Oprostite, uporabnika z imenom {{user}} ni. Prosimo, preverite črkovanje in povezavo, ki ste jo kliknili."
trace_form:
upload_gpx: "Pošljite datoteko GPX"
description: "Opis"

View file

@ -379,8 +379,8 @@
send_button: "Send"
back_to_inbox: "Back to inbox"
no_such_user:
no_such_user: "No such user or message"
sorry: "Sorry there is no user or message with that name or id"
heading: "No such user or message"
body: "Sorry there is no user or message with that name or id"
outbox:
my_inbox: "My {{inbox_link}}"
inbox: "inbox"
@ -445,7 +445,7 @@
tags: "Tags:"
save_button: "Save Changes"
no_such_user:
no_such_user: "Sorry, there is no user with the name {{name}}. Please check your spelling, or maybe the link you clicked is wrong."
body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
trace_form:
upload_gpx: "Upload GPX File"
description: "Description"