From db51d7f3dd3dfdceeb9f0f583e21d1f4e962f57c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 6 Jun 2009 13:15:53 +0000 Subject: [PATCH] Added & cleaned up messages relating to a given user not existing The following pages now have a 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}}. --- app/controllers/diary_entry_controller.rb | 1 + app/controllers/message_controller.rb | 4 ++++ app/controllers/trace_controller.rb | 1 + app/controllers/user_controller.rb | 1 + app/views/diary_entry/no_such_user.rhtml | 2 +- app/views/message/no_such_user.rhtml | 4 ++-- app/views/trace/no_such_user.rhtml | 4 ++-- app/views/user/no_such_user.rhtml | 2 +- config/locales/de.yml | 8 ++++---- config/locales/en.yml | 13 ++++++++++--- config/locales/he.yml | 6 +++--- config/locales/is.yml | 17 ++++++++++++----- config/locales/it.yml | 6 +++--- config/locales/nl.yml | 6 +++--- config/locales/pl.yml | 6 +++--- config/locales/ru.yml | 6 +++--- config/locales/sl.yml | 6 +++--- config/locales/zh-CN.yml | 6 +++--- 18 files changed, 60 insertions(+), 39 deletions(-) diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 46986acb4..16186314f 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -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 diff --git a/app/controllers/message_controller.rb b/app/controllers/message_controller.rb index 155e619d7..b4cc6bfa8 100644 --- a/app/controllers/message_controller.rb +++ b/app/controllers/message_controller.rb @@ -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 diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 0248ad7cd..c05145a7e 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -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 diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index fa0adef56..c3ab012e3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -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 diff --git a/app/views/diary_entry/no_such_user.rhtml b/app/views/diary_entry/no_such_user.rhtml index 02f6a4df2..f1ba37d7b 100644 --- a/app/views/diary_entry/no_such_user.rhtml +++ b/app/views/diary_entry/no_such_user.rhtml @@ -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> diff --git a/app/views/message/no_such_user.rhtml b/app/views/message/no_such_user.rhtml index 0d9ba66aa..ace99530e 100644 --- a/app/views/message/no_such_user.rhtml +++ b/app/views/message/no_such_user.rhtml @@ -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> diff --git a/app/views/trace/no_such_user.rhtml b/app/views/trace/no_such_user.rhtml index 46ff6c1b0..6b1b27f46 100644 --- a/app/views/trace/no_such_user.rhtml +++ b/app/views/trace/no_such_user.rhtml @@ -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> diff --git a/app/views/user/no_such_user.rhtml b/app/views/user/no_such_user.rhtml index f510daffa..585d29d8c 100644 --- a/app/views/user/no_such_user.rhtml +++ b/app/views/user/no_such_user.rhtml @@ -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> diff --git a/config/locales/de.yml b/config/locales/de.yml index 83e0d5935..a03b24f94 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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." \ No newline at end of file + not_a_friend: "{{name}} ist nicht dein Freund." diff --git a/config/locales/en.yml b/config/locales/en.yml index b0bcebd80..562aa47ef 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 diff --git a/config/locales/he.yml b/config/locales/he.yml index 496f26c87..0a5531e90 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -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: "תאור" diff --git a/config/locales/is.yml b/config/locales/is.yml index 76fc9e539..5062e96e9 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -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 diff --git a/config/locales/it.yml b/config/locales/it.yml index c28094528..7057b633f 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -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" diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 1d055d9eb..8a4ea183f 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -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" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 45e79b1a5..b35ea29b4 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -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" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 151d8aa48..ab681dc40 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -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: "Описание" diff --git a/config/locales/sl.yml b/config/locales/sl.yml index fd940283e..3619a0cd1 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -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" diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 613016e4a..06803d73d 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -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" -- 2.43.2