From 806de963dbbac723d5c20cf5368eb2b289064650 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 12 Feb 2013 20:16:53 -0800 Subject: [PATCH] Cleanup, translate Splash --- js/id/ui.js | 6 ++---- js/id/ui/splash.js | 41 ++++++++++++++++++++++++++--------------- locale/da.js | 5 +++++ locale/de.js | 5 +++++ locale/en.js | 5 +++++ locale/es.js | 5 +++++ locale/fr.js | 5 +++++ locale/ja.js | 5 +++++ locale/lv.js | 5 +++++ locale/tr.js | 5 +++++ 10 files changed, 68 insertions(+), 19 deletions(-) diff --git a/js/id/ui.js b/js/id/ui.js index 628a46d4a..15fb55c09 100644 --- a/js/id/ui.js +++ b/js/id/ui.js @@ -148,10 +148,8 @@ iD.ui = function(context) { context.enter(iD.modes.Browse(context)); - if (!context.storage('sawSplash')) { - iD.ui.splash(context.container()); - context.storage('sawSplash', true); - } + context.container() + .call(iD.ui.Splash(context)); if (history.lock() && history.restorableChanges()) { context.container() diff --git a/js/id/ui/splash.js b/js/id/ui/splash.js index bfcbf3e05..c0e79261c 100644 --- a/js/id/ui/splash.js +++ b/js/id/ui/splash.js @@ -1,21 +1,32 @@ -iD.ui.splash = function(selection) { - var modal = iD.ui.modal(selection); +iD.ui.Splash = function(context) { + return function(selection) { + if (context.storage('sawSplash')) + return; - modal.select('.modal') - .attr('class', 'modal-splash modal'); + context.storage('sawSplash', true); - var introModal = modal.select('.content') - .append('div') - .attr('class', 'modal-section fillL'); + var modal = iD.ui.modal(selection); - introModal.append('div') - .attr('class','logo'); + modal.select('.modal') + .attr('class', 'modal-splash modal'); - introModal.append('div') - .html("

Welcome to the iD OpenStreetMap editor

" + - "This is development version 0.0.0-alpha1. " + - "For more information see ideditor.com" + - " and report bugs at github.com.systemed/iD.

"); + var introModal = modal.select('.content') + .append('div') + .attr('class', 'modal-section fillL'); - return modal; + introModal.append('div') + .attr('class', 'logo'); + + var div = introModal.append('div'); + + div.append("h2") + .text(t('splash.welcome')); + + div.append("p") + .html(t('splash.text', { + version: iD.version, + website: 'ideditor.com', + github: 'github.com' + })); + } }; diff --git a/locale/da.js b/locale/da.js index 1e983c3de..d42f95c61 100644 --- a/locale/da.js +++ b/locale/da.js @@ -196,6 +196,11 @@ locale.da = { unsaved_changes: "Du har ændringer der ikke er gemt endnu", }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "live", dev: "dev" diff --git a/locale/de.js b/locale/de.js index 31f919a73..8629471be 100644 --- a/locale/de.js +++ b/locale/de.js @@ -196,6 +196,11 @@ locale.de = { unsaved_changes: "Ungespeicherte Änderugen vorhanden", }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "live", dev: "dev" diff --git a/locale/en.js b/locale/en.js index b5ea93202..bd26f932b 100644 --- a/locale/en.js +++ b/locale/en.js @@ -196,6 +196,11 @@ locale.en = { unsaved_changes: "You have unsaved changes" }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "live", dev: "dev" diff --git a/locale/es.js b/locale/es.js index 2e3eebcdd..2d47ecfe6 100644 --- a/locale/es.js +++ b/locale/es.js @@ -196,6 +196,11 @@ locale.es = { unsaved_changes: "Tienes cambios sin guardar" //"You have unsaved changes", }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "en vivo", //"live", dev: "dev" diff --git a/locale/fr.js b/locale/fr.js index 61ffcf675..4716080cc 100644 --- a/locale/fr.js +++ b/locale/fr.js @@ -196,6 +196,11 @@ locale.fr = { unsaved_changes: "Vous avez des modifications non enregistrées" }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "live", dev: "dev" diff --git a/locale/ja.js b/locale/ja.js index 0fd8c5229..3d4abec79 100644 --- a/locale/ja.js +++ b/locale/ja.js @@ -196,6 +196,11 @@ locale.ja = { unsaved_changes: "変更が保存されていません" }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "本番サーバ", dev: "開発サーバ" diff --git a/locale/lv.js b/locale/lv.js index 58d05e4a4..9eb93f387 100644 --- a/locale/lv.js +++ b/locale/lv.js @@ -196,6 +196,11 @@ locale.lv = { unsaved_changes: "Jums ir nesaglabātas izmaiņas" }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "live", dev: "dev" diff --git a/locale/tr.js b/locale/tr.js index 566ee10d2..402d822f1 100644 --- a/locale/tr.js +++ b/locale/tr.js @@ -196,6 +196,11 @@ locale.tr = { unsaved_changes: "Kaydedilmemiş değişiklikleriniz var" }, + splash: { + welcome: "Welcome to the iD OpenStreetMap editor", + text: "This is development version {version}. For more information see {website} and report bugs at {github}." + }, + source_switch: { live: "canlı", dev: "geliştirme"