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', :order => 'created_at DESC',
:per_page => 20) :per_page => 20)
else else
@title = t'diary_entry.no_such_user.title'
@not_found_user = params[:display_name] @not_found_user = params[:display_name]
render :action => 'no_such_user', :status => :not_found render :action => 'no_such_user', :status => :not_found

View file

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

View file

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

View file

@ -251,6 +251,7 @@ class UserController < ApplicationController
if @this_user if @this_user
@title = @this_user.display_name @title = @this_user.display_name
else else
@title = t 'user.no_such_user.title'
@not_found_user = params[:display_name] @not_found_user = params[:display_name]
render :action => 'no_such_user', :status => :not_found render :action => 'no_such_user', :status => :not_found
end 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> <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> <h1><%= t'message.no_such_user.heading' %></h1>
<p><%= t'message.no_such_user.sorry' %></p> <p><%= t'message.no_such_user.body' %></p>

View file

@ -1,2 +1,2 @@
<h2><%= h(@not_found_user) %></h2> <h2><%= t'trace.no_such_user.heading', :user => @not_found_user %></h2>
<p><%= t'trace.no_such_user.no_such_user', :name => @not_found_user %></p> <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> <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" back_to_inbox: "Zurück zum Posteingang"
message_sent: "Nachricht gesendet" message_sent: "Nachricht gesendet"
no_such_user: no_such_user:
no_such_user: "Benutzer oder Nachricht nicht gefunden" heading: "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." 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: outbox:
title: "Gesendet" title: "Gesendet"
my_inbox: "{{inbox_link}}" my_inbox: "{{inbox_link}}"
@ -503,7 +503,7 @@ de:
tags: "Tags:" tags: "Tags:"
save_button: "Speichere Änderungen" save_button: "Speichere Änderungen"
no_such_user: 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: trace_form:
upload_gpx: "GPX-Datei" upload_gpx: "GPX-Datei"
description: "Beschreibung" description: "Beschreibung"
@ -679,4 +679,4 @@ de:
already_a_friend: "Du bist bereits mit {{name}} befreundet." already_a_friend: "Du bist bereits mit {{name}} befreundet."
remove_friend: remove_friend:
success: "{{name} wurde als Freund entfernt." 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}}" 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." 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: 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." body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
diary_entry: diary_entry:
posted_by: "Posted by {{link_user}} at {{created}} in {{language}}" posted_by: "Posted by {{link_user}} at {{created}} in {{language}}"
@ -438,8 +440,9 @@ en:
back_to_inbox: "Back to inbox" back_to_inbox: "Back to inbox"
message_sent: "Message sent" message_sent: "Message sent"
no_such_user: no_such_user:
no_such_user: "No such user or message" title: "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: outbox:
title: "Outbox" title: "Outbox"
my_inbox: "My {{inbox_link}}" my_inbox: "My {{inbox_link}}"
@ -509,7 +512,9 @@ en:
tags: "Tags:" tags: "Tags:"
save_button: "Save Changes" save_button: "Save Changes"
no_such_user: 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: trace_form:
upload_gpx: "Upload GPX File" upload_gpx: "Upload GPX File"
description: "Description" description: "Description"
@ -607,6 +612,8 @@ en:
signup: Signup 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." 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: 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." body: "Sorry, there is no user with the name {{user}}. Please check your spelling, or maybe the link you clicked is wrong."
view: view:
my diary: my diary my diary: my diary

View file

@ -384,8 +384,8 @@ he:
back_to_inbox: "Back to inbox" back_to_inbox: "Back to inbox"
message_sent: "Message sent" message_sent: "Message sent"
no_such_user: no_such_user:
no_such_user: "No such user or message" heading: "No such user or message"
sorry: "Sorry there is no user or message with that name or id" body: "Sorry there is no user or message with that name or id"
outbox: outbox:
title: "Outbox" title: "Outbox"
my_inbox: "My {{inbox_link}}" my_inbox: "My {{inbox_link}}"
@ -455,7 +455,7 @@ he:
tags: "Tags:" tags: "Tags:"
save_button: "Save Changes" save_button: "Save Changes"
no_such_user: 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: trace_form:
upload_gpx: "Upload GPX File" upload_gpx: "Upload GPX File"
description: "תאור" description: "תאור"

View file

@ -254,7 +254,9 @@ is:
heading: "No entry with the id: {{id}}" 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." 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: 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: diary_entry:
posted_by: "Sett inn af {{link_user}} klukkan {{created}} á {{language}}" posted_by: "Sett inn af {{link_user}} klukkan {{created}} á {{language}}"
comment_link: "Bæta við athugasemd" comment_link: "Bæta við athugasemd"
@ -388,8 +390,9 @@ is:
back_to_inbox: "Aftur í innhólf" back_to_inbox: "Aftur í innhólf"
message_sent: "Skilaboðin hafa verið send" message_sent: "Skilaboðin hafa verið send"
no_such_user: no_such_user:
no_such_user: "No such user or message" title: "Notandi eða skilaboð ekki til"
sorry: "Sorry there is no user or message with that name or id" heading: "Notandi eða skilaboð ekki til"
body: "Það eru engin skilaboð eða notandi til með nafni"
outbox: outbox:
title: "Úthólf" title: "Úthólf"
my_inbox: "Mitt {{inbox_link}}" my_inbox: "Mitt {{inbox_link}}"
@ -459,7 +462,9 @@ is:
tags: "Tögg:" tags: "Tögg:"
save_button: "Save Changes" save_button: "Save Changes"
no_such_user: 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: trace_form:
upload_gpx: "Upphala GPX skrá" upload_gpx: "Upphala GPX skrá"
description: "Lýsing" description: "Lýsing"
@ -557,7 +562,9 @@ is:
signup: "Nýskrá" 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." 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: 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: view:
my diary: bloggið mitt my diary: bloggið mitt
new diary entry: ný bloggfærsla new diary entry: ný bloggfærsla

View file

@ -384,8 +384,8 @@ it:
back_to_inbox: "Ritorna ai messaggi in arrivo" back_to_inbox: "Ritorna ai messaggi in arrivo"
message_sent: "Messaggio inviato" message_sent: "Messaggio inviato"
no_such_user: no_such_user:
no_such_user: "Nessun utente o messaggio" heading: "Nessun utente o messaggio"
sorry: "Spiacenti, ma non c'è alcun utente o messaggio con questo nome o identificativo" body: "Spiacenti, ma non c'è alcun utente o messaggio con questo nome o identificativo"
outbox: outbox:
title: "In uscita" title: "In uscita"
my_inbox: "Messaggi {{inbox_link}}" my_inbox: "Messaggi {{inbox_link}}"
@ -455,7 +455,7 @@ it:
tags: "Etichette:" tags: "Etichette:"
save_button: "Salva modifiche" save_button: "Salva modifiche"
no_such_user: 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: trace_form:
upload_gpx: "Carica file GPX" upload_gpx: "Carica file GPX"
description: "Descrizione" description: "Descrizione"

View file

@ -384,8 +384,8 @@ nl:
back_to_inbox: "Terug naar Postvak IN" back_to_inbox: "Terug naar Postvak IN"
message_sent: "Bericht verzonden" message_sent: "Bericht verzonden"
no_such_user: no_such_user:
no_such_user: "Deze gebruiker of bericht bestaat niet" heading: "Deze gebruiker of bericht bestaat niet"
sorry: "Sorry, er is geen gebruiker of bericht met die naam of id" body: "Sorry, er is geen gebruiker of bericht met die naam of id"
outbox: outbox:
title: "Postvak UIT" title: "Postvak UIT"
my_inbox: "Mijn {{inbox_link}}" my_inbox: "Mijn {{inbox_link}}"
@ -455,7 +455,7 @@ nl:
tags: "Tags:" tags: "Tags:"
save_button: "Wijzigingen opslaan" save_button: "Wijzigingen opslaan"
no_such_user: 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: trace_form:
upload_gpx: "Upload GPX-bestand" upload_gpx: "Upload GPX-bestand"
description: "Beschrijving" description: "Beschrijving"

View file

@ -387,8 +387,8 @@ pl:
back_to_inbox: "Powrót do skrzynki" back_to_inbox: "Powrót do skrzynki"
message_sent: "Wiadomość wysłana" message_sent: "Wiadomość wysłana"
no_such_user: no_such_user:
no_such_user: "Nie ma takiego użytkownika / wiadomości" heading: "Nie ma takiego użytkownika / wiadomości"
sorry: "Niestety nie znaleziono użytkownika / wiadomości o tej nazwie lub id" body: "Niestety nie znaleziono użytkownika / wiadomości o tej nazwie lub id"
outbox: outbox:
title: "Wiadomości wysłane" title: "Wiadomości wysłane"
my_inbox: "Moja skrzynka {{inbox_link}}" my_inbox: "Moja skrzynka {{inbox_link}}"
@ -458,7 +458,7 @@ pl:
tags: "Tagi:" tags: "Tagi:"
save_button: "Zapisz zmiany" save_button: "Zapisz zmiany"
no_such_user: 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: trace_form:
upload_gpx: "Wgraj plik GPX" upload_gpx: "Wgraj plik GPX"
description: "Opis" description: "Opis"

View file

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

View file

@ -381,8 +381,8 @@ sl:
send_button: "Pošlji" send_button: "Pošlji"
back_to_inbox: "Nazaj na prejeto pošto" back_to_inbox: "Nazaj na prejeto pošto"
no_such_user: no_such_user:
no_such_user: "No such user or message" heading: "No such user or message"
sorry: "Sorry there is no user or message with that name or id" body: "Sorry there is no user or message with that name or id"
outbox: outbox:
my_inbox: "Moja {{inbox_link}}" my_inbox: "Moja {{inbox_link}}"
inbox: "prejeta" inbox: "prejeta"
@ -447,7 +447,7 @@ sl:
tags: "Oznake:" tags: "Oznake:"
save_button: "Shrani spremembe" save_button: "Shrani spremembe"
no_such_user: 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: trace_form:
upload_gpx: "Pošljite datoteko GPX" upload_gpx: "Pošljite datoteko GPX"
description: "Opis" description: "Opis"

View file

@ -379,8 +379,8 @@
send_button: "Send" send_button: "Send"
back_to_inbox: "Back to inbox" back_to_inbox: "Back to inbox"
no_such_user: no_such_user:
no_such_user: "No such user or message" heading: "No such user or message"
sorry: "Sorry there is no user or message with that name or id" body: "Sorry there is no user or message with that name or id"
outbox: outbox:
my_inbox: "My {{inbox_link}}" my_inbox: "My {{inbox_link}}"
inbox: "inbox" inbox: "inbox"
@ -445,7 +445,7 @@
tags: "Tags:" tags: "Tags:"
save_button: "Save Changes" save_button: "Save Changes"
no_such_user: 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: trace_form:
upload_gpx: "Upload GPX File" upload_gpx: "Upload GPX File"
description: "Description" description: "Description"