From: Herve Saint-Amand Date: Sun, 12 Feb 2017 21:05:38 +0000 (+0000) Subject: merging master into html-mail-fixes X-Git-Tag: live~3574^2~1 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a520f1251cf06be665d93037c74116a9f769fbf1?hp=fcba1a9857b7a225a5540b08432be876bde8501f merging master into html-mail-fixes --- diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 61d95ba11..6fb255a36 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -12,7 +12,7 @@ class DiaryEntryController < ApplicationController def new @title = t "diary_entry.new.title" - if params[:diary_entry] + if request.post? @diary_entry = DiaryEntry.new(entry_params) @diary_entry.user = @user @@ -35,7 +35,7 @@ class DiaryEntryController < ApplicationController else default_lang = @user.preferences.where(:k => "diary.default_language").first lang_code = default_lang ? default_lang.v : @user.preferred_language - @diary_entry = DiaryEntry.new(:language_code => lang_code) + @diary_entry = DiaryEntry.new(entry_params.merge(:language_code => lang_code)) set_map_location render :action => "edit" end @@ -218,6 +218,8 @@ class DiaryEntryController < ApplicationController # return permitted diary entry parameters def entry_params params.require(:diary_entry).permit(:title, :body, :language_code, :latitude, :longitude) + rescue ActionController::ParameterMissing + ActionController::Parameters.new.permit(:title, :body, :language_code, :latitude, :longitude) end ## diff --git a/app/controllers/message_controller.rb b/app/controllers/message_controller.rb index 0ec1c8eb6..450313e62 100644 --- a/app/controllers/message_controller.rb +++ b/app/controllers/message_controller.rb @@ -13,7 +13,7 @@ class MessageController < ApplicationController # clicks send. # The display_name param is the display name of the user that the message is being sent to. def new - if params[:message] + if request.post? if @user.sent_messages.where("sent_on >= ?", Time.now.getutc - 1.hour).count >= MAX_MESSAGES_PER_HOUR flash[:error] = t "message.new.limit_exceeded" else @@ -30,7 +30,7 @@ class MessageController < ApplicationController end end - @message ||= Message.new(:recipient => @this_user) + @message ||= Message.new(message_params.merge(:recipient => @this_user)) @title = t "message.new.title" end @@ -139,5 +139,7 @@ class MessageController < ApplicationController # return permitted message parameters def message_params params.require(:message).permit(:title, :body) + rescue ActionController::ParameterMissing + ActionController::Parameters.new.permit(:title, :body) end end diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index f3fa81fd8..e41bd01f3 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -103,7 +103,7 @@ class TraceController < ApplicationController end def create - if params[:trace] + if request.post? logger.info(params[:trace][:gpx_file].class.name) if params[:trace][:gpx_file].respond_to?(:read) @@ -170,7 +170,7 @@ class TraceController < ApplicationController else @title = t "trace.edit.title", :name => @trace.name - if params[:trace] + if request.post? @trace.description = params[:trace][:description] @trace.tagstring = params[:trace][:tagstring] @trace.visibility = params[:trace][:visibility] diff --git a/app/views/notifier/note_comment_notification.html.erb b/app/views/notifier/note_comment_notification.html.erb index ecaff81dc..909bffaa6 100644 --- a/app/views/notifier/note_comment_notification.html.erb +++ b/app/views/notifier/note_comment_notification.html.erb @@ -6,8 +6,10 @@

<%= raw t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %>

<% end %> -<%= message_body do %> - <%= @comment.to_html %> +<% unless @comment.empty? %> + <%= message_body do %> + <%= @comment.to_html %> + <% end %> <% end %>

<%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %>

diff --git a/app/views/notifier/note_comment_notification.text.erb b/app/views/notifier/note_comment_notification.text.erb index c8a967450..5924c8a9d 100644 --- a/app/views/notifier/note_comment_notification.text.erb +++ b/app/views/notifier/note_comment_notification.text.erb @@ -6,8 +6,10 @@ <%= t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => @commenter, :place => @place %> <% end %> +<% unless @comment.empty? %> == <%= @comment.to_text %> == +<% end %> <%= t 'notifier.note_comment_notification.details', :url => @noteurl %> diff --git a/config/locales/be-Tarask.yml b/config/locales/be-Tarask.yml index 301e5ade3..6916b98cf 100644 --- a/config/locales/be-Tarask.yml +++ b/config/locales/be-Tarask.yml @@ -104,6 +104,8 @@ be-Tarask: feed: title: Набор зьменаў %{id} title_comment: Набор зьменаў %{id} - %{comment} + way: + nodes: Вузлы relation_member: entry_role: '%{type} %{name} як %{role}' type: @@ -748,11 +750,8 @@ be-Tarask: ліцэнзіі растлумачыць Вам правы і адказнасьці. credit_title_html: Як спасылацца на OpenStreetMap credit_1_html: |- - Калі Вы выкарыстоўваеце выявы мапаў OpenStreetMap, мы патрабуем, каб - Вы рабілі спасылку хаця б “© удзельнікі OpenStreetMap - , CC BY-SA”. Калі Вы выкарыстоўваеце толькі картаграфічныя зьвесткі, - мы патрабуем наяўнасьць “Картаграфічныя зьвесткі © Удзельнікі OpenStreetMap, - CC BY-SA”. + Мы патрабуем, каб + Вы пазначалі “© удзельнікі OpenStreetMap”. credit_2_html: |- Дзе магчыма, павінна быць гіпэр-спасылка на OpenStreetMap http://www.openstreetmap.org/ @@ -765,8 +764,8 @@ be-Tarask: www.creativecommons.org. more_title_html: Даведацца болей more_1_html: |- - Даведайцеся болей пра выкарыстаньне нашых зьвестак на старонцы адказаў + Даведайцеся болей пра выкарыстаньне нашых зьвестак і пра спасыланьне на нас на старонцы ліцэнзіі OSMF і старонцы адказаў і пытаньняў. more_2_html: |- Удзельнікі OSM павінны памятаць пра тое, што забаронена дадаваць зьвесткі @@ -1121,7 +1120,7 @@ be-Tarask: trace_not_found: Трэк ня знойдзены! visibility: 'Бачнасьць:' trace_paging_nav: - showing_page: Паказаная старонка %{page} + showing_page: Старонка %{page} trace: pending: ЧАКАЕ count_points: '%{count} пунктаў' @@ -1190,8 +1189,7 @@ be-Tarask: url: 'URL-адрас ключа запыту:' access_url: 'URL-адрас ключа доступу:' authorize_url: 'URL-адрас аўтарызацыі:' - support_notice: Мы падтрымліваем HMAC-SHA1 (рэкамэндуецца) і звычайны тэкст - у SSL-рэжыме. + support_notice: Мы падтрымліваем HMAC-SHA1 (рэкамэндуецца) і подпісы RSA-SHA1. edit: Рэдагаваць падрабязнасьці requests: 'Запыт наступных дазволаў ад удзельніка:' allow_read_prefs: чытаць іх налады ўдзельніка. @@ -1284,7 +1282,7 @@ be-Tarask: flash changed: Ваш пароль быў зьменены. flash token bad: Немагчыма знайсьці такі ключ, можа праверце URL-адрас? new: - title: Стварыць рахунак + title: Зарэгістравацца no_auto_account_create: На жаль, мы зараз ня можам стварыць для Вас рахунак аўтаматычна. contact_webmaster: Калі ласка, зьвяжыцеся з вэбмайстрам @@ -1344,10 +1342,10 @@ be-Tarask: blocks by me: заблякаваныя мной send message: даслаць паведамленьне diary: дзёньнік - edits: рэдагаваньні - traces: трэкі - remove as friend: выдаліць зь сяброў - add as friend: дадаць у сябры + edits: Рэдагаваньні + traces: Трэкі + remove as friend: Выдаліць зь сяброў + add as friend: Дадаць у сябры mapper since: 'Стварае мапы з:' ago: (%{time_in_words_ago} таму) ct status: 'Умовы супрацоўніцтва:' @@ -1458,7 +1456,7 @@ be-Tarask: электроннай пошты. flash update success: Зьвесткі пра карыстальніка пасьпяхова абноўленыя. confirm: - heading: Пацьверджаньне рахунку + heading: Праверце электронную пошту! press confirm button: Націсьніце кнопку «Пацьвердзіць» для актывацыі Вашага рахунку. button: Пацьвердзіць diff --git a/config/locales/bg.yml b/config/locales/bg.yml index a506d7b21..dfbd128bb 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -16,7 +16,7 @@ bg: friendly: '%e %B %Y в %H:%M' activerecord: models: - changeset: Списък промени + changeset: Списък с промени country: Държава friend: Приятел language: Език @@ -62,6 +62,7 @@ bg: user: email: Електронна поща active: Активен + display_name: Видимо потребителско име description: Описание languages: Езици pass_crypt: Парола @@ -133,13 +134,13 @@ bg: node: възел way: път relation: релация - changeset: списък промени + changeset: списък с промени note: Бележка timeout: type: way: път relation: релация - changeset: списък промени + changeset: списък с промени note: бележка redacted: type: @@ -169,7 +170,7 @@ bg: comment: Коментар area: Област list: - title: Списък промени + title: Списък с промени empty: Няма намерени списъци с промени. empty_area: Няма списъци с промени в този район. empty_user: Няма списъци с промени от този потребител. @@ -267,8 +268,12 @@ bg: geonames_reverse: Резултати от GeoNames search_osm_nominatim: prefix: + aerialway: + cable_car: Кабинков лифт + chair_lift: Седалков лифт aeroway: helipad: Вертолетна площадка + taxiway: Път за рулиране terminal: Терминал amenity: animal_shelter: Приют за животни @@ -370,6 +375,7 @@ bg: phone: Телефон за спешни повиквания highway: abandoned: Изоставена железопътна линия + bridleway: Конен път bus_stop: Автобусна спирка construction: Магистрала в строеж cycleway: Велосипедна пътека @@ -431,11 +437,13 @@ bg: construction: Строителство farm: Ферма farmland: Обработваема земя + farmyard: Стопански двор forest: Гора garages: Гаражи grass: Трева industrial: Промишлена зона landfill: Сметище + meadow: Ливада military: Военна зона mine: Рудник orchard: Овощна градина @@ -542,6 +550,7 @@ bg: historic_station: Гара с историческо значение junction: Железопътен възел level_crossing: Прелез + light_rail: Бърз трамвай monorail: Монорелсов път narrow_gauge: Теснолинейка platform: Железопътна платформа @@ -684,6 +693,8 @@ bg: title: Добре дошли в OSM beginners_guide: title: Наръчник за начинаещи + mailing_lists: + title: Пощенски списъци forums: title: Форуми irc: @@ -771,6 +782,7 @@ bg: search: Търсене get_directions_title: Намерете маршрут между две точки from: От + to: До where_am_i: Къде съм аз? submit_text: Напред key: @@ -781,16 +793,54 @@ bg: trunk: Междуградски път primary: Главен път secondary: Второстепенен път + bridleway: Конен път + cycleway: Велосипедна пътека + footway: Пътека + rail: Железопът subway: Метро + tram: + - Бърз трамвай + - трамвай + cable: + - Кабинков лифт + - седалков лифт + runway: + - Летищна писта + - път за рулиране + apron: + - Летищен перон + - терминал + admin: Административна граница forest: Гора + wood: Лес + golf: Игрище за голф park: Парк + resident: Жилищна зона + common: + 1: ливада + retail: Зона за търговия на дребно + industrial: Промишлена зона + commercial: Търговска зона + heathland: Пустош lake: - Езеро + farm: Земеделско стопанство cemetery: Гробище + pitch: Спортна площадка centre: Спортен център + reserve: Природен резерват + military: Военна зона school: - Училище + building: Значима сграда station: Железопътна гара + summit: + - Било + - връх + tunnel: Тунел (пунктирана линия) + bridge: Мост (плътна линия) + construction: Пътища в изграждане + bicycle_shop: Магазин за велосипеди richtext_area: edit: Редактиране preview: Преглед @@ -851,10 +901,23 @@ bg: allow_write_api: промяна на картата. user: login: + title: Вписване email or username: 'Електронна поща или потребителско име:' password: 'Парола:' remember: Запомни ме lost password link: Забравена парола? + login_button: Вписване + register now: Регистрирайте се + no account: Нямате сметка? + auth_providers: + google: + title: Вписване с Гугъл + facebook: + title: Вписване с Фейсбук + wikipedia: + title: Вписване с Уикипедия + yahoo: + title: Вписване с Яху lost_password: email address: 'Електронна поща:' reset_password: @@ -896,6 +959,9 @@ bg: preferred languages: 'Предпочитани езици:' preferred editor: 'Предпочитан редактор:' image: 'Изображение:' + new image: Добавяне на изображение + keep image: Запазване на текущото изображение + replace image: Заменяне на текущото изображение latitude: 'Географска ширина:' longitude: 'Географска дължина:' flash update success confirm needed: Сведенията за потребителя са успешно обновени. @@ -920,13 +986,22 @@ bg: show: ago: преди %{time} edit: Редактиране + note: + mine: + ago_html: преди %{when} javascripts: share: title: Споделяне cancel: Отказ + image: Изображение + link: Препратка или код + custom_dimensions: Размер по избор format: 'Формат:' scale: 'Мащаб:' download: Изтегляне + include_marker: Добавяне на маркер + key: + title: Легенда map: zoom: in: Увеличаване @@ -936,21 +1011,32 @@ bg: base: standard: Стандартен cycle_map: Колоездачна карта - transport_map: Транспортна карта + transport_map: Превозна карта hot: Хуманитарна карта layers: header: Слоеве на картата + notes: Бележки data: Данни + overlays: Слоеве за отстраняване на грешки title: Слоеве donate_link_text: site: edit_tooltip: Редактиране на картата createnote_tooltip: Добавяне на бележка на картата + notes: + new: + add: Добавяне на бележка directions: engines: + graphhopper_bicycle: Велосипед (GraphHopper) + graphhopper_foot: Пеша (GraphHopper) + mapquest_bicycle: Велосипед (MapQuest) mapquest_car: Кола (MapQuest) + mapquest_foot: Пеша (MapQuest) osrm_car: Кола (OSRM) + mapzen_bicycle: Велосипед (Mapzen) mapzen_car: Кола (Mapzen) + mapzen_foot: Пеша (Mapzen) directions: Насоки distance: Разстояние instructions: @@ -959,6 +1045,7 @@ bg: turn_left_without_exit: Завийте наляво по %{name} endofroad_left_without_exit: В края на пътя завийте наляво по %{name} roundabout_without_exit: На кръговото движение вземете %{name} + start_without_exit: Тръгнете от края на %{name} destination_without_exit: Пристигнахте на местоназначението unnamed: неименуван път time: Време diff --git a/config/locales/en.yml b/config/locales/en.yml index 9389c0e2f..2414fcd1f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -782,7 +782,6 @@ en: car_parts: "Car Parts" car_repair: "Car Repair" carpet: "Carpet Shop" - car_repair: "Car Repair" charity: "Charity Shop" chemist: "Chemist" clothes: "Clothes Shop" diff --git a/config/locales/fi.yml b/config/locales/fi.yml index f2ac67d9e..d2a4e5912 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1334,6 +1334,7 @@ fi: on lähellä paikkaa %{place}.' details: Lisää tietoja merkinnästä löytyy osoitteesta %{url}. changeset_comment_notification: + hi: Hei %{to_user}, greeting: Hei, commented: partial_changeset_without_comment: ei kommenttia diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 6d6048039..c088db13f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1382,6 +1382,7 @@ fr: La note se trouve près de %{place}.' details: Plus de détails concernant la note se trouvent à %{url}. changeset_comment_notification: + hi: Bonjour %{to_user}, greeting: Bonjour, commented: subject_own: '[OpenStreetMap] %{commenter} a commenté un de vos ensembles @@ -1396,6 +1397,8 @@ fr: partial_changeset_with_comment: avec le commentaire « %{changeset_comment}' Â» partial_changeset_without_comment: sans commentaire details: Plus de détails sur l’ensemble de modifications à %{url}. + unsubscribe: Pour vous désabonner des mises à jour de cet ensemble de modifications, + visitez %{url} et cliquez sur « Désabonner ». message: inbox: title: Boîte de réception diff --git a/config/locales/gl.yml b/config/locales/gl.yml index fb5fb382c..d65124fe9 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1345,6 +1345,7 @@ gl: vostede comentou. A nota está preto de %{place}.' details: Pode atopar máis detalles da nota en %{url}. changeset_comment_notification: + hi: Ola %{to_user}, greeting: Ola, commented: subject_own: '[OpenStreetMap] %{commenter} comentou nun dos teus conxuntos @@ -1358,6 +1359,8 @@ gl: partial_changeset_with_comment: co comentario '%{changeset_comment}' partial_changeset_without_comment: sen comentarios details: Máis detalles sobre o conxunto de cambios poden atoparse en %{url}. + unsubscribe: Para darse de baixa das actualizacións deste conxunto de cambios, + visite %{url} e prema en "darse de baixa". message: inbox: title: Caixa de entrada diff --git a/config/locales/ia.yml b/config/locales/ia.yml index 53de0675d..eebb71d02 100644 --- a/config/locales/ia.yml +++ b/config/locales/ia.yml @@ -1324,6 +1324,7 @@ ia: Le nota es in le vicinitate de %{place}.' details: Plus detalios sur le nota pote esser trovate a %{url}. changeset_comment_notification: + hi: Salute %{to_user}, greeting: Salute, commented: subject_own: '[OpenStreetMap] %{commenter} ha commentate un de tu gruppos @@ -1338,6 +1339,8 @@ ia: partial_changeset_without_comment: sin commento details: Plus detalios sur le gruppo de modificationes pote esser trovate a %{url}. + unsubscribe: Pro disabonar te del actualisationes de iste gruppo de modificationes, + visita %{url} e clicca sur "Disabonar". message: inbox: title: Cassa de entrata @@ -2313,6 +2316,7 @@ ia: header: Stratos de carta notes: Notas de carta data: Datos de carta + gps: Tracias GPS public overlays: Activar superpositiones pro resolver problemas in le carta title: Stratos copyright: © contributores de OpenStreetMap @@ -2368,7 +2372,7 @@ ia: no_place: Iste loco non ha essite trovate. instructions: continue_without_exit: Continuar sur %{name} - slight_right_without_exit: Curva suave a dextra verso %{name} + slight_right_without_exit: Girar legiermente a dextra verso %{name} offramp_right_without_exit: Prende le rampa a dextra verso %{name} onramp_right_without_exit: Girar a dextra sur le rampa verso %{name} endofroad_right_without_exit: Al fin del strata, girar a dextra verso %{name} @@ -2384,7 +2388,7 @@ ia: endofroad_left_without_exit: Al fin del strata, girar a sinistra verso %{name} merge_left_without_exit: Junger a sinistra verso %{name} fork_left_without_exit: Al bifurcation, girar a sinistra verso %{name} - slight_left_without_exit: Curva suave a sinistra verso %{name} + slight_left_without_exit: Girar legiermente a sinistra verso %{name} via_point_without_exit: (puncto intermedie) follow_without_exit: Sequer %{name} roundabout_without_exit: Al rotunda prender %{name} @@ -2395,6 +2399,11 @@ ia: against_oneway_without_exit: Ir contra direction obligatori sur %{name} end_oneway_without_exit: Fin del direction obligatori sur %{name} roundabout_with_exit: Al rotunda prende le exito %{exit} sur %{name} + turn_left_with_exit: Al rotunda, girar a sinistra verso %{name} + slight_left_with_exit: Al rotunda, girar legiermente a sinistra verso %{name} + turn_right_with_exit: Al rotunda, girar a dextra verso %{name} + slight_right_with_exit: Al rotunda, girar legiermente a dextra verso %{name} + continue_with_exit: Al rotunda, continuar toto recte verso %{name} unnamed: cammino sin nomine courtesy: Itinerario fornite per %{link} time: Tempore diff --git a/config/locales/it.yml b/config/locales/it.yml index c1bfd6ef5..e82a2bd1e 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -941,13 +941,13 @@ it: weir: Sbarramento idrico "yes": Corso d'acqua admin_levels: - level2: Confine di Stato Nazionale - level4: Confine di Regione - level5: Confine d'Area Regionale - level6: Confine di Provincia - level8: Confine di Città - level9: Confine di Borgo - level10: Confine di Quartiere + level2: Confine Amministrativo 2^Livello - Stato Nazionale + level4: Confine amministrativo 4^livello - Subnazionale + level5: Confine amministrativo 5^livello - Area regionale + level6: Confine amministrativo 6^livello - Subregionale + level8: Confine amministrativo 8^livello - Città + level9: Confine amministrativo 9^livello - Subcittadino, borgo + level10: Confine amministrativo 10^livello - Subcittadino, quartiere description: title: osm_nominatim: Località da OpenStreetMap @@ -1266,7 +1266,7 @@ it: notifier: diary_comment_notification: subject: '[OpenStreetMap] %{user} ha commentato una voce del diario' - hi: Salve %{to_user}, + hi: Ciao %{to_user}, header: '%{from_user} ha commentato la voce del diario OpenStreetMap con l''oggetto %{subject}:' footer: Puoi anche leggere il commento su %{readurl} e puoi commentare su %{commenturl} @@ -1364,6 +1364,7 @@ it: La nota si trova vicino a %{place}.' details: Ulteriori dettagli sulla nota possono essere trovati su %{url}. changeset_comment_notification: + hi: Ciao %{to_user}, greeting: Ciao, commented: subject_own: '[OpenStreetMap] %{commenter} ha commentato uno dei tuoi changeset' @@ -1377,6 +1378,8 @@ it: partial_changeset_without_comment: senza commento details: Ulteriori dettagli sul gruppo di modifiche possono essere trovati su %{url}. + unsubscribe: Per cancellarsi dagli aggiornamenti di questo insieme di modifiche, + visita %{url} e fai clic su "Cancellazione". message: inbox: title: Posta in arrivo @@ -1862,7 +1865,7 @@ it: title: password persa heading: Password dimenticata? email address: 'Indirizzo email:' - new password button: Spediscimi una nuova password + new password button: Reimposta password help_text: Inserire l'indirizzo email che si è utilizzato per l'iscrizione, a cui verrà inviato un collegamento che permetterà la reimpostazione della propria password. diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 3b8748a9b..a8fb1cb3c 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -421,7 +421,7 @@ ko: terminal: 터미널 amenity: animal_shelter: 동물 보호소 - arts_centre: 예술 회관 + arts_centre: 아트 센터 atm: ATM bank: 은행 bar: 주점 @@ -1209,8 +1209,8 @@ ko: 기여하고 유지하는 매퍼 공동체에 의해 구축됩니다. local_knowledge_title: 지역 지식 local_knowledge_html: |- - OpenStreetMap은 지역 지식을 강조합니다. 기여자는 OSM이 정확하고 - 최신으로 검증하기 위해 항공 영상, GPS 장치와, 낮은 기술 분야 지도를 + OpenStreetMap은 지역 지식을 강조합니다. 기여자는 OSM이 정확하고 최신 정보로 + 유지된다는 것을 검증하기 위해 항공 영상, GPS 장치와, 낮은 기술 분야 지도를 사용합니다. community_driven_title: 공동체 주도 community_driven_html: |- @@ -1222,19 +1222,18 @@ ko: 공동체 블로그와, OSM 재단 웹사이트를 참조하세요. open_data_title: 오픈 데이터 open_data_html: |- - OpenStreetMap은 오픈 데이터입니다: OpenStreetMapê³¼ 기여자를 제작진으로 - 어떤 목적으로도 자유롭게 사용할 수 있습니다. 특정 방법으로 바꾸거나 + OpenStreetMap은 오픈 데이터입니다: OpenStreetMap 기여자를 제작진으로 + 명시하는 한 어떤 목적으로도 자유롭게 사용할 수 있습니다. 특정 방법으로 바꾸거나 데이터에 빌드한다면, 동일한 라이선스에 따라 결과를 배포할 수 있습니다. 자세한 내용은 저작권 및 라이선스 페이지를 참조하세요. legal_title: 법률 legal_html: |- - 이 사이트와 많은 다른 관련된 서비스는 공동체 뒤의 OpenStreetMap 재단 (OSMF)에 - 의해 공식적으로 운영하고 있고 공동체를 대표하여 사용된 모든 OSMF 서비스의 사용은 다음과 같습니다. - 우리의허용되는 사용 정책과 개인정보 정책 - 을 참고하시기 바랍니다. + 이 사이트와 많은 다른 관련 사이트는 공동체를 대표하여 OpenStreetMap 재단 (OSMF) + 에 의해 운영됩니다. OSMF가 운영하는 서비스의 사용은 + 허용 가능한 사용 정책과 개인정보 정책에 의해 규율됩니다.
- 라이선싱, 저작권 또는 다른 법률 질문과 이슈가 있다면 OSMF에 문의하시기 바랍니다. + 라이선싱, 저작권, 기타 다른 법률적 문제가 있다면 OSMF에 연락하기 바랍니다. partners_title: 파트너 notifier: diary_comment_notification: @@ -1316,6 +1315,7 @@ ko: 근처에 있습니다.' details: 참고에 대한 자세한 사항은 %{url}에서 찾을 수 있습니다. changeset_comment_notification: + hi: 안녕하세요 %{to_user}님, greeting: 안녕하세요, commented: subject_own: '[OpenStreetMap] %{commenter}님이 당신의 바뀜집합 중 하나에 댓글을 남겼습니다' diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 5aeba831b..b9281dc07 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1023,10 +1023,9 @@ vi: Hãy đọc thêm chi tiết về việc sử dụng dữ liệu của chúng tôi và cách ghi công chúng tôi tại OSMF Licence page and the community Hỏi đáp Pháp lý. more_2_html: Tuy OpenStreetMap là một nguồn dữ liệu mở, nhưng chúng tôi không - thể cung cấp API miễn phí cho những nhà phát triển bên thứ ba truy cập bản - đồ. Hãy xem Quy - định Sử dụng API, Quy - định Sử dụng Mảnh Bản đồ, và Quy + thể cung cấp API miễn phí cho bên thứ ba truy cập bản đồ. Hãy xem Quy + định Sử dụng API, Quy + định Sử dụng Mảnh Bản đồ, và Quy định Sử dụng Nominatim. contributors_title_html: Những người đóng góp vào đây contributors_intro_html: 'Dự án này nhờ công sức đóng góp của hàng ngàn cá nhân @@ -1206,15 +1205,15 @@ vi: Bản quyền và Giấy phép.' legal_title: Pháp luật legal_html: |- - Trang Web này và nhiều dịch vụ có liên quan được hoạt động chính thức bởi Quỹ OpenStreetMap (OSMF) thay mặt cho cộng đồng. + Trang Web này và nhiều dịch vụ có liên quan được hoạt động chính thức bởi Quỹ OpenStreetMap (OSMF) thay mặt cho cộng đồng. Việc sử dụng các dịch vụ do OSMF hoạt động phải tuân theo các Quy định Sử dụng Hợp lý và Quy định về Quyền Riêng tư của chúng tôi.
Xin vui lòng liên lạc với OSMF nếu bạn có thắc mắc về giấy phép, bản quyền, hoặc vấn đề pháp luật khác. partners_title: Nhà bảo trợ notifier: diary_comment_notification: - subject: '[OpenStreetMap] %{user} đã bình luận về mục nhật ký của bạn' + subject: '[OpenStreetMap] %{user} đã bình luận về mục nhật ký' hi: Chào %{to_user}, - header: '%{from_user} đã bình luận về mục nhật ký gần đây của bạn tại OpenStreetMap + header: '%{from_user} đã bình luận về mục nhật ký gần đây tại OpenStreetMap với tiêu đề %{subject}:' footer: Bạn cũng có thể đọc bình luận tại %{readurl}, bình luận tại %{commenturl}, hoặc trả lời tại %{replyurl} @@ -1310,6 +1309,7 @@ vi: chú gần %{place}.' details: Xem chi tiết về ghi chú tại %{url}. changeset_comment_notification: + hi: Chào %{to_user}, greeting: Chào bạn, commented: subject_own: '[OpenStreetMap] %{commenter} đã bình luận về một bộ thay đổi @@ -1323,6 +1323,8 @@ vi: partial_changeset_with_comment: với lời bình luận “%{changeset_comment}” partial_changeset_without_comment: không có lời bình luận details: Xem chi tiết về bộ thay đổi tại %{url}. + unsubscribe: Để ngừng nhận các thông báo về bộ thay đổi này, mở %{url} và bấm + “Không theo dõi”. message: inbox: title: Hộp thư @@ -1775,6 +1777,9 @@ vi: github: title: Đăng nhập qua GitHub alt: Đăng nhập dùng tài khoản GitHub + wikipedia: + title: Đăng nhập qua Wikipedia + alt: Đăng nhập qua Tài khoản Wikipedia yahoo: title: Đăng nhập qua Yahoo! alt: Đăng nhập dùng OpenID của Yahoo! @@ -1821,9 +1826,10 @@ vi: Điều kiện Đóng góp. email address: 'Địa chỉ Thư điện tử:' confirm email address: 'Xác nhận Địa chỉ Thư điện tử:' - not displayed publicly: Không được hiển thị công khai (xem quy - định quyền riêng tư) + not displayed publicly: Địa chỉ thư điện tử của bạn không được hiển thị công + khai (xem thêm chi tiết trong quy + định quyền riêng tư của chúng tôi) display name: 'Tên hiển thị:' display name description: Tên người dùng của bạn được hiển thị công khai. Bạn có thể thay đổi tên này về sau trong tùy chọn. @@ -2262,7 +2268,7 @@ vi: key: title: Chú giải Bản đồ tooltip: Chú giải Bản đồ - tooltip_disabled: Bảng Chú giải chỉ có sẵn cho lớp Chuẩn + tooltip_disabled: Bảng Chú giải không có sẵn cho lớp này map: zoom: in: Phóng to @@ -2279,6 +2285,7 @@ vi: header: Lớp Bản đồ notes: Ghi chú Bản đồ data: Dữ liệu Bản đồ + gps: Tuyến đường GPS Công khai overlays: Bật lớp phủ để gỡ lỗi trên bản đồ title: Lớp copyright: © những người đóng góp vào OpenStreetMap @@ -2361,6 +2368,11 @@ vi: against_oneway_without_exit: Chạy ngược chiều trên %{name} end_oneway_without_exit: Kết thúc khúc một chiều trên %{name} roundabout_with_exit: Tại bùng binh, đi ra tại đường thứ %{exit} tức %{name} + turn_left_with_exit: Tới bùng binh quẹo trái vào %{name} + slight_left_with_exit: Tới bùng binh nghiêng về bên trái vào %{name} + turn_right_with_exit: Tới bùng binh quẹo phải vào %{name} + slight_right_with_exit: Tới bùng binh nghiêng về bên phải vào %{name} + continue_with_exit: Tới bùng binh đi thẳng vào %{name} unnamed: không tên courtesy: Chỉ đường do %{link} cung cấp time: Thời gian diff --git a/test/controllers/diary_entry_controller_test.rb b/test/controllers/diary_entry_controller_test.rb index 5e53cb6b0..268834019 100644 --- a/test/controllers/diary_entry_controller_test.rb +++ b/test/controllers/diary_entry_controller_test.rb @@ -101,13 +101,15 @@ class DiaryEntryControllerTest < ActionController::TestCase ) end - def test_new + def test_new_no_login # Make sure that you are redirected to the login page when you # are not logged in get :new assert_response :redirect assert_redirected_to :controller => :user, :action => :login, :referer => "/diary/new" + end + def test_new_form # Now try again when logged in get :new, {}, { :user => users(:normal_user).id } assert_response :success @@ -128,71 +130,82 @@ class DiaryEntryControllerTest < ActionController::TestCase assert_select "input", :count => 7 end end + end - new_title = "New Title" - new_body = "This is a new body for the diary entry" - new_latitude = "1.1" - new_longitude = "2.2" - new_language_code = "en" + def test_new_get_with_params + # Now try creating a diary entry using get + assert_difference "DiaryEntry.count", 0 do + get :new, { :commit => "save", + :diary_entry => { :title => "New Title", :body => "This is a new body for the diary entry", :latitude => "1.1", + :longitude => "2.2", :language_code => "en" } }, + { :user => users(:normal_user).id } + end + assert_response :success + assert_template :edit + end + def test_new_no_body # Now try creating a invalid diary entry with an empty body assert_no_difference "DiaryEntry.count" do post :new, { :commit => "save", - :diary_entry => { :title => new_title, :body => "", :latitude => new_latitude, - :longitude => new_longitude, :language_code => new_language_code } }, + :diary_entry => { :title => "New Title", :body => "", :latitude => "1.1", + :longitude => "2.2", :language_code => "en" } }, { :user => users(:normal_user).id } end assert_response :success assert_template :edit assert_nil UserPreference.where(:user_id => users(:normal_user).id, :k => "diary.default_language").first + end + def test_new_post # Now try creating a diary entry assert_difference "DiaryEntry.count", 1 do post :new, { :commit => "save", - :diary_entry => { :title => new_title, :body => new_body, :latitude => new_latitude, - :longitude => new_longitude, :language_code => new_language_code } }, + :diary_entry => { :title => "New Title", :body => "This is a new body for the diary entry", :latitude => "1.1", + :longitude => "2.2", :language_code => "en" } }, { :user => users(:normal_user).id } end assert_response :redirect assert_redirected_to :action => :list, :display_name => users(:normal_user).display_name entry = DiaryEntry.order(:id).last assert_equal users(:normal_user).id, entry.user_id - assert_equal new_title, entry.title - assert_equal new_body, entry.body - assert_equal new_latitude.to_f, entry.latitude - assert_equal new_longitude.to_f, entry.longitude - assert_equal new_language_code, entry.language_code + assert_equal "New Title", entry.title + assert_equal "This is a new body for the diary entry", entry.body + assert_equal "1.1".to_f, entry.latitude + assert_equal "2.2".to_f, entry.longitude + assert_equal "en", entry.language_code # checks if user was subscribed assert_equal 1, entry.subscribers.length - assert_equal new_language_code, UserPreference.where(:user_id => users(:normal_user).id, :k => "diary.default_language").first.v + assert_equal "en", UserPreference.where(:user_id => users(:normal_user).id, :k => "diary.default_language").first.v + end - new_language_code = "de" - create(:language, :code => new_language_code) + def test_new_german + create(:language, :code => "de") # Now try creating a diary entry in a different language assert_difference "DiaryEntry.count", 1 do post :new, { :commit => "save", - :diary_entry => { :title => new_title, :body => new_body, :latitude => new_latitude, - :longitude => new_longitude, :language_code => new_language_code } }, + :diary_entry => { :title => "New Title", :body => "This is a new body for the diary entry", :latitude => "1.1", + :longitude => "2.2", :language_code => "de" } }, { :user => users(:normal_user).id } end assert_response :redirect assert_redirected_to :action => :list, :display_name => users(:normal_user).display_name entry = DiaryEntry.order(:id).last assert_equal users(:normal_user).id, entry.user_id - assert_equal new_title, entry.title - assert_equal new_body, entry.body - assert_equal new_latitude.to_f, entry.latitude - assert_equal new_longitude.to_f, entry.longitude - assert_equal new_language_code, entry.language_code + assert_equal "New Title", entry.title + assert_equal "This is a new body for the diary entry", entry.body + assert_equal "1.1".to_f, entry.latitude + assert_equal "2.2".to_f, entry.longitude + assert_equal "de", entry.language_code # checks if user was subscribed assert_equal 1, entry.subscribers.length - assert_equal new_language_code, UserPreference.where(:user_id => users(:normal_user).id, :k => "diary.default_language").first.v + assert_equal "de", UserPreference.where(:user_id => users(:normal_user).id, :k => "diary.default_language").first.v end def test_new_spammy diff --git a/test/controllers/message_controller_test.rb b/test/controllers/message_controller_test.rb index 60192abce..210a05288 100644 --- a/test/controllers/message_controller_test.rb +++ b/test/controllers/message_controller_test.rb @@ -45,12 +45,16 @@ class MessageControllerTest < ActionController::TestCase end ## - # test the new action - def test_new + # test fetching new message page when not logged in + def test_new_no_login # Check that the new message page requires us to login get :new, :display_name => users(:public_user).display_name assert_redirected_to login_path(:referer => new_message_path(:display_name => users(:public_user).display_name)) + end + ## + # test fetching new message page when logged in + def test_new_form # Login as a normal user session[:user] = users(:normal_user).id @@ -64,6 +68,39 @@ class MessageControllerTest < ActionController::TestCase assert_select "textarea#message_body", :count => 1 assert_select "input[type='submit'][value='Send']", :count => 1 end + end + + ## + # test fetching new message page with body and title + def test_new_get_with_params + # Login as a normal user + session[:user] = users(:normal_user).id + + # Check that we can't send a message from a GET request + assert_difference "ActionMailer::Base.deliveries.size", 0 do + assert_difference "Message.count", 0 do + get :new, + :display_name => users(:public_user).display_name, + :message => { :title => "Test Message", :body => "Test message body" } + end + end + assert_response :success + assert_template "new" + assert_select "title", "OpenStreetMap | Send message" + assert_select "form[action='#{new_message_path(:display_name => users(:public_user).display_name)}']", :count => 1 do + assert_select "input#message_title", :count => 1 do + assert_select "[value='Test Message']" + end + assert_select "textarea#message_body", :text => "Test message body", :count => 1 + assert_select "input[type='submit'][value='Send']", :count => 1 + end + end + + ## + # test posting new message page with no body + def test_new_post_no_body + # Login as a normal user + session[:user] = users(:normal_user).id # Check that the subject is preserved over errors assert_difference "ActionMailer::Base.deliveries.size", 0 do @@ -83,6 +120,13 @@ class MessageControllerTest < ActionController::TestCase assert_select "textarea#message_body", :text => "", :count => 1 assert_select "input[type='submit'][value='Send']", :count => 1 end + end + + ## + # test posting new message page with no title + def test_new_post_no_title + # Login as a normal user + session[:user] = users(:normal_user).id # Check that the body text is preserved over errors assert_difference "ActionMailer::Base.deliveries.size", 0 do @@ -102,6 +146,13 @@ class MessageControllerTest < ActionController::TestCase assert_select "textarea#message_body", :text => "Test message body", :count => 1 assert_select "input[type='submit'][value='Send']", :count => 1 end + end + + ## + # test posting new message page sends message + def test_new_post_send + # Login as a normal user + session[:user] = users(:normal_user).id # Check that sending a message works assert_difference "ActionMailer::Base.deliveries.size", 1 do