From 044bd937a7af7c1c1f9505c82984fdf6309bb231 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 7 May 2013 15:28:34 -0400 Subject: [PATCH] Make success UI translatable. Fixes #1425 --- data/core.yaml | 5 +++++ dist/locales/en.json | 6 ++++++ js/id/ui/success.js | 8 ++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 1db92d46b..bf34a83a2 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -185,6 +185,11 @@ en: error: An error occurred while trying to save uploading: Uploading changes to OpenStreetMap. unsaved_changes: You have unsaved changes + success: + edited_osm: "Edited OSM!" + facebook: "Share on Facebook" + tweet: "Tweet" + okay: "Okay" splash: welcome: Welcome to the iD OpenStreetMap editor text: "iD is a friendly but powerful tool for contributing to the world's best free world map. This is version {version}. For more information see {website} and report bugs at {github}." diff --git a/dist/locales/en.json b/dist/locales/en.json index aa5cc1fc9..47a31a5c0 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -228,6 +228,12 @@ "uploading": "Uploading changes to OpenStreetMap.", "unsaved_changes": "You have unsaved changes" }, + "success": { + "edited_osm": "Edited OSM!", + "facebook": "Share on Facebook", + "tweet": "Tweet", + "okay": "Okay" + }, "splash": { "welcome": "Welcome to the iD OpenStreetMap editor", "text": "iD is a friendly but powerful tool for contributing to the world's best free world map. This is version {version}. For more information see {website} and report bugs at {github}.", diff --git a/js/id/ui/success.js b/js/id/ui/success.js index 3ffc343e0..c04dfb704 100644 --- a/js/id/ui/success.js +++ b/js/id/ui/success.js @@ -11,7 +11,7 @@ iD.ui.Success = function(connection) { var m = changeset.comment ? changeset.comment.substring(0, 130) : ''; - var message = (m || 'Edited OSM!') + ' ' + + var message = (m || t('success.edited_osm')) + ' ' + connection.changesetURL(changeset.id); var links = body.append('div').attr('class','modal-actions cf'); @@ -31,7 +31,7 @@ iD.ui.Success = function(connection) { return 'https://twitter.com/intent/tweet?source=webclient&text=' + encodeURIComponent(message); }) - .text('Tweet'); + .text(t('success.tweet')); links.append('a') .attr('class','col4 facebook') @@ -39,7 +39,7 @@ iD.ui.Success = function(connection) { .attr('href', function() { return 'https://facebook.com/sharer/sharer.php?u=' + encodeURIComponent(message); }) - .text('Share on Facebook'); + .text(t('success.facebook')); var section = body.append('div').attr('class','modal-section cf'); @@ -48,7 +48,7 @@ iD.ui.Success = function(connection) { .on('click.save', function() { event.cancel(); }) - .text('Okay') + .text(t('success.okay')) .node().focus(); }