From 32f8274929c9cdd97fcdd2aff332586c0ff140f2 Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Tue, 15 Sep 2020 21:56:22 -0400 Subject: [PATCH] Make `t` function return a `span` element with a `lang` attribute unless `html: false` is specified in the options (re: #7963) Update `text` functions to `html` to support inserting the `span` elements Specify `html: false` for various instances where a `span` is not desired, e.g. `placeholder` and `title` attributes --- modules/core/localizer.js | 20 +++++-- modules/modes/add_note.js | 2 +- modules/modes/select.js | 2 +- modules/modes/select_data.js | 2 +- modules/modes/select_error.js | 2 +- modules/modes/select_note.js | 2 +- modules/operations/circularize.js | 2 +- modules/operations/continue.js | 2 +- modules/operations/disconnect.js | 2 +- modules/operations/extract.js | 2 +- modules/operations/merge.js | 2 +- modules/operations/move.js | 2 +- modules/operations/orthogonalize.js | 2 +- modules/operations/reverse.js | 2 +- modules/operations/rotate.js | 2 +- modules/operations/split.js | 2 +- modules/operations/straighten.js | 2 +- modules/presets/category.js | 2 +- modules/presets/field.js | 6 +- modules/presets/preset.js | 10 ++-- modules/renderer/tile_layer.js | 4 +- modules/services/openstreetcam.js | 18 +++--- modules/services/streetside.js | 16 +++--- modules/svg/mapillary_map_features.js | 2 +- modules/ui/account.js | 4 +- modules/ui/attribution.js | 4 +- modules/ui/changeset_editor.js | 2 +- modules/ui/combobox.js | 2 +- modules/ui/commit.js | 12 ++-- modules/ui/commit_warnings.js | 4 +- modules/ui/confirm.js | 2 +- modules/ui/conflicts.js | 20 +++---- modules/ui/contributors.js | 4 +- modules/ui/data_editor.js | 2 +- modules/ui/data_header.js | 2 +- modules/ui/disclosure.js | 2 +- modules/ui/edit_menu.js | 6 +- modules/ui/entity_editor.js | 2 +- modules/ui/feature_list.js | 12 ++-- modules/ui/field.js | 6 +- modules/ui/field_help.js | 4 +- modules/ui/fields/access.js | 4 +- modules/ui/fields/address.js | 4 +- modules/ui/fields/check.js | 6 +- modules/ui/fields/combo.js | 14 ++--- modules/ui/fields/cycleway.js | 4 +- modules/ui/fields/input.js | 4 +- modules/ui/fields/lanes.js | 6 +- modules/ui/fields/localized.js | 8 +-- modules/ui/fields/maxspeed.js | 2 +- modules/ui/fields/radio.js | 14 ++--- modules/ui/fields/restrictions.js | 12 ++-- modules/ui/fields/textarea.js | 2 +- modules/ui/fields/wikidata.js | 8 +-- modules/ui/fields/wikipedia.js | 4 +- modules/ui/flash.js | 2 +- modules/ui/form_fields.js | 2 +- modules/ui/full_screen.js | 2 +- modules/ui/geolocate.js | 4 +- modules/ui/improveOSM_comments.js | 6 +- modules/ui/improveOSM_details.js | 2 +- modules/ui/improveOSM_editor.js | 12 ++-- modules/ui/improveOSM_header.js | 2 +- modules/ui/info.js | 6 +- modules/ui/init.js | 12 ++-- modules/ui/intro/helper.js | 6 +- modules/ui/intro/intro.js | 2 +- modules/ui/intro/navigation.js | 2 +- modules/ui/intro/start_editing.js | 2 +- modules/ui/issues_info.js | 2 +- modules/ui/keepRight_details.js | 2 +- modules/ui/keepRight_editor.js | 12 ++-- modules/ui/keepRight_header.js | 2 +- modules/ui/loading.js | 2 +- modules/ui/map_in_map.js | 2 +- modules/ui/note_comments.js | 4 +- modules/ui/note_editor.js | 22 ++++---- modules/ui/note_header.js | 2 +- modules/ui/note_report.js | 2 +- modules/ui/notice.js | 2 +- modules/ui/osmose_details.js | 12 ++-- modules/ui/osmose_editor.js | 6 +- modules/ui/osmose_header.js | 2 +- modules/ui/pane.js | 2 +- modules/ui/panels/background.js | 18 +++--- modules/ui/panels/history.js | 56 +++++++++---------- modules/ui/panels/location.js | 12 ++-- modules/ui/panels/measurement.js | 40 ++++++------- modules/ui/panes/background.js | 2 +- modules/ui/panes/help.js | 10 ++-- modules/ui/panes/issues.js | 2 +- modules/ui/panes/map_data.js | 2 +- modules/ui/panes/preferences.js | 2 +- modules/ui/preset_list.js | 8 +-- modules/ui/restore.js | 8 +-- modules/ui/scale.js | 2 +- .../ui/sections/background_display_options.js | 8 +-- modules/ui/sections/background_list.js | 18 +++--- modules/ui/sections/background_offset.js | 4 +- modules/ui/sections/changes.js | 8 +-- modules/ui/sections/data_layers.js | 22 ++++---- modules/ui/sections/entity_issues.js | 8 +-- modules/ui/sections/feature_type.js | 2 +- modules/ui/sections/map_features.js | 6 +- modules/ui/sections/map_style_options.js | 6 +- modules/ui/sections/overlay_list.js | 2 +- modules/ui/sections/photo_overlays.js | 4 +- modules/ui/sections/privacy.js | 4 +- modules/ui/sections/raw_member_editor.js | 16 +++--- modules/ui/sections/raw_membership_editor.js | 12 ++-- modules/ui/sections/raw_tag_editor.js | 8 +-- modules/ui/sections/selection_list.js | 6 +- modules/ui/sections/validation_issues.js | 6 +- modules/ui/sections/validation_options.js | 4 +- modules/ui/sections/validation_rules.js | 4 +- modules/ui/sections/validation_status.js | 8 +-- modules/ui/settings/custom_background.js | 6 +- modules/ui/settings/custom_data.js | 12 ++-- modules/ui/shortcuts.js | 24 ++++---- modules/ui/source_switch.js | 4 +- modules/ui/splash.js | 6 +- modules/ui/status.js | 12 ++-- modules/ui/success.js | 30 +++++----- modules/ui/tag_reference.js | 12 ++-- modules/ui/tools/modes.js | 2 +- modules/ui/tools/save.js | 6 +- modules/ui/tools/sidebar_toggle.js | 2 +- modules/ui/tools/undo_redo.js | 2 +- modules/ui/top_toolbar.js | 2 +- modules/ui/version.js | 2 +- modules/ui/view_on_keepRight.js | 2 +- modules/ui/view_on_osm.js | 2 +- modules/ui/view_on_osmose.js | 2 +- modules/ui/zoom.js | 2 +- modules/ui/zoom_to_selection.js | 4 +- modules/validations/almost_junction.js | 2 +- modules/validations/close_nodes.js | 4 +- modules/validations/crossing_ways.js | 2 +- modules/validations/disconnected_way.js | 2 +- modules/validations/help_request.js | 2 +- modules/validations/impossible_oneway.js | 2 +- modules/validations/incompatible_source.js | 2 +- modules/validations/invalid_format.js | 4 +- modules/validations/mismatched_geometry.js | 8 +-- modules/validations/missing_role.js | 2 +- modules/validations/missing_tag.js | 2 +- modules/validations/outdated_tags.js | 8 +-- modules/validations/private_data.js | 6 +- modules/validations/suspicious_name.js | 4 +- modules/validations/unsquare_way.js | 2 +- 150 files changed, 471 insertions(+), 463 deletions(-) diff --git a/modules/core/localizer.js b/modules/core/localizer.js index b23699824..a4063debb 100644 --- a/modules/core/localizer.js +++ b/modules/core/localizer.js @@ -221,6 +221,8 @@ export function coreLocalizer() { return 'other'; } + let _lastUsedTCode; + /** * Given a string identifier, try to find that string in the current * language, and return it. This function will be called recursively @@ -232,17 +234,19 @@ export function coreLocalizer() { * @return {string?} localized string */ localizer.t = function(stringId, replacements, locale) { - locale = locale || _localeCode; + _lastUsedTCode = null; - // US English is the default - if (locale.toLowerCase() === 'en-us') locale = 'en'; + locale = locale || _localeCode; let path = stringId .split('.') .map(s => s.replace(//g, '.')) .reverse(); - let result = _localeStrings[locale]; + let stringsKey = locale; + // US English is the default + if (stringsKey.toLowerCase() === 'en-us') stringsKey = 'en'; + let result = _localeStrings[stringsKey]; while (result !== undefined && path.length) { result = result[path.pop()]; @@ -287,7 +291,11 @@ export function coreLocalizer() { } if (typeof result === 'string') { // found a localized string! - return result; + _lastUsedTCode = locale; + if (replacements && replacements.html === false) { + return result; + } + return `${result}`; } } // no localized string found... @@ -311,6 +319,8 @@ export function coreLocalizer() { return missing; }; + localizer.t.lastCode = () => _lastUsedTCode; + localizer.languageName = (code, options) => { if (_languageNames[code]) { // name in locale language diff --git a/modules/modes/add_note.js b/modules/modes/add_note.js index b257663cd..db48bdbce 100644 --- a/modules/modes/add_note.js +++ b/modules/modes/add_note.js @@ -12,7 +12,7 @@ export function modeAddNote(context) { button: 'note', title: t('modes.add_note.title'), description: t('modes.add_note.description'), - key: t('modes.add_note.key') + key: t('modes.add_note.key', { html: false }) }; var behavior = behaviorDraw(context) diff --git a/modules/modes/select.js b/modules/modes/select.js index ac9e35f29..b6c06cd7c 100644 --- a/modules/modes/select.js +++ b/modules/modes/select.js @@ -230,7 +230,7 @@ export function modeSelect(context, selectedIDs) { _behaviors.forEach(context.install); keybinding - .on(t('inspector.zoom_to.key'), mode.zoomToSelected) + .on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected) .on(['[', 'pgup'], previousVertex) .on([']', 'pgdown'], nextVertex) .on(['{', uiCmd('⌘['), 'home'], firstVertex) diff --git a/modules/modes/select_data.js b/modules/modes/select_data.js index a631798c9..adfa7ac6d 100644 --- a/modules/modes/select_data.js +++ b/modules/modes/select_data.js @@ -72,7 +72,7 @@ export function modeSelectData(context, selectedDatum) { behaviors.forEach(context.install); keybinding - .on(t('inspector.zoom_to.key'), mode.zoomToSelected) + .on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected) .on('⎋', esc, true); d3_select(document) diff --git a/modules/modes/select_error.js b/modules/modes/select_error.js index 4a7cb8e80..61a4e8ec2 100644 --- a/modules/modes/select_error.js +++ b/modules/modes/select_error.js @@ -98,7 +98,7 @@ export function modeSelectError(context, selectedErrorID, selectedErrorService) behaviors.forEach(context.install); keybinding - .on(t('inspector.zoom_to.key'), mode.zoomToSelected) + .on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected) .on('⎋', esc, true); d3_select(document) diff --git a/modules/modes/select_note.js b/modules/modes/select_note.js index d8f6cbd9f..a29a8fa68 100644 --- a/modules/modes/select_note.js +++ b/modules/modes/select_note.js @@ -108,7 +108,7 @@ export function modeSelectNote(context, selectedNoteID) { _behaviors.forEach(context.install); _keybinding - .on(t('inspector.zoom_to.key'), mode.zoomToSelected) + .on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected) .on('⎋', esc, true); d3_select(document) diff --git a/modules/operations/circularize.js b/modules/operations/circularize.js index 0ecbe3d1a..27fe1bdf3 100644 --- a/modules/operations/circularize.js +++ b/modules/operations/circularize.js @@ -107,7 +107,7 @@ export function operationCircularize(context, selectedIDs) { operation.id = 'circularize'; - operation.keys = [t('operations.circularize.key')]; + operation.keys = [t('operations.circularize.key', { html: false })]; operation.title = t('operations.circularize.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/continue.js b/modules/operations/continue.js index 90bc32fb1..bf7755c4e 100644 --- a/modules/operations/continue.js +++ b/modules/operations/continue.js @@ -65,7 +65,7 @@ export function operationContinue(context, selectedIDs) { operation.id = 'continue'; - operation.keys = [t('operations.continue.key')]; + operation.keys = [t('operations.continue.key', { html: false })]; operation.title = t('operations.continue.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/disconnect.js b/modules/operations/disconnect.js index b62c325c7..a1b4c7e5d 100644 --- a/modules/operations/disconnect.js +++ b/modules/operations/disconnect.js @@ -183,7 +183,7 @@ export function operationDisconnect(context, selectedIDs) { operation.id = 'disconnect'; - operation.keys = [t('operations.disconnect.key')]; + operation.keys = [t('operations.disconnect.key', { html: false })]; operation.title = t('operations.disconnect.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/extract.js b/modules/operations/extract.js index b8a3309c6..2b9fbbf4d 100644 --- a/modules/operations/extract.js +++ b/modules/operations/extract.js @@ -84,7 +84,7 @@ export function operationExtract(context, selectedIDs) { operation.id = 'extract'; - operation.keys = [t('operations.extract.key')]; + operation.keys = [t('operations.extract.key', { html: false })]; operation.title = t('operations.extract.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/merge.js b/modules/operations/merge.js index fc0d0d50d..d2d50c111 100644 --- a/modules/operations/merge.js +++ b/modules/operations/merge.js @@ -88,7 +88,7 @@ export function operationMerge(context, selectedIDs) { }; operation.id = 'merge'; - operation.keys = [t('operations.merge.key')]; + operation.keys = [t('operations.merge.key', { html: false })]; operation.title = t('operations.merge.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/move.js b/modules/operations/move.js index f8e7a3ff6..68af877ca 100644 --- a/modules/operations/move.js +++ b/modules/operations/move.js @@ -72,7 +72,7 @@ export function operationMove(context, selectedIDs) { operation.id = 'move'; - operation.keys = [t('operations.move.key')]; + operation.keys = [t('operations.move.key', { html: false })]; operation.title = t('operations.move.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/orthogonalize.js b/modules/operations/orthogonalize.js index cb4a1a382..1a683b166 100644 --- a/modules/operations/orthogonalize.js +++ b/modules/operations/orthogonalize.js @@ -130,7 +130,7 @@ export function operationOrthogonalize(context, selectedIDs) { operation.id = 'orthogonalize'; - operation.keys = [t('operations.orthogonalize.key')]; + operation.keys = [t('operations.orthogonalize.key', { html: false })]; operation.title = t('operations.orthogonalize.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/reverse.js b/modules/operations/reverse.js index 16e854826..b21e6de75 100644 --- a/modules/operations/reverse.js +++ b/modules/operations/reverse.js @@ -68,7 +68,7 @@ export function operationReverse(context, selectedIDs) { operation.id = 'reverse'; - operation.keys = [t('operations.reverse.key')]; + operation.keys = [t('operations.reverse.key', { html: false })]; operation.title = t('operations.reverse.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/rotate.js b/modules/operations/rotate.js index 574acd99e..c7883c2cf 100644 --- a/modules/operations/rotate.js +++ b/modules/operations/rotate.js @@ -72,7 +72,7 @@ export function operationRotate(context, selectedIDs) { operation.id = 'rotate'; - operation.keys = [t('operations.rotate.key')]; + operation.keys = [t('operations.rotate.key', { html: false })]; operation.title = t('operations.rotate.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/split.js b/modules/operations/split.js index e5527b84b..171b8e0ed 100644 --- a/modules/operations/split.js +++ b/modules/operations/split.js @@ -63,7 +63,7 @@ export function operationSplit(context, selectedIDs) { operation.id = 'split'; - operation.keys = [t('operations.split.key')]; + operation.keys = [t('operations.split.key', { html: false })]; operation.title = t('operations.split.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/operations/straighten.js b/modules/operations/straighten.js index f1829c15d..b3e6b3894 100644 --- a/modules/operations/straighten.js +++ b/modules/operations/straighten.js @@ -135,7 +135,7 @@ export function operationStraighten(context, selectedIDs) { operation.id = 'straighten'; - operation.keys = [t('operations.straighten.key')]; + operation.keys = [t('operations.straighten.key', { html: false })]; operation.title = t('operations.straighten.title'); operation.behavior = behaviorOperation(context).which(operation); diff --git a/modules/presets/category.js b/modules/presets/category.js index 05b280f05..2e46f4b8b 100644 --- a/modules/presets/category.js +++ b/modules/presets/category.js @@ -33,7 +33,7 @@ export function presetCategory(categoryID, category, all) { _this.matchScore = () => -1; - _this.name = () => t(`presets.categories.${categoryID}.name`, { 'default': categoryID }); + _this.name = () => t(`presets.categories.${categoryID}.name`, { 'default': categoryID, html: false }); _this.terms = () => []; diff --git a/modules/presets/field.js b/modules/presets/field.js index 6d01657bf..e7b205523 100644 --- a/modules/presets/field.js +++ b/modules/presets/field.js @@ -22,14 +22,14 @@ export function presetField(fieldID, field) { _this.t = (scope, options) => t(`presets.fields.${fieldID}.${scope}`, options); - _this.label = () => _this.overrideLabel || _this.t('label', { 'default': fieldID }); + _this.label = () => _this.overrideLabel || _this.t('label', { 'default': fieldID, html: false }); const _placeholder = _this.placeholder; - _this.placeholder = () => _this.t('placeholder', { 'default': _placeholder }); + _this.placeholder = () => _this.t('placeholder', { 'default': _placeholder, html: false }); _this.originalTerms = (_this.terms || []).join(); - _this.terms = () => _this.t('terms', { 'default': _this.originalTerms }) + _this.terms = () => _this.t('terms', { 'default': _this.originalTerms, html: false }) .toLowerCase().trim().split(/\s*,+\s*/); diff --git a/modules/presets/preset.js b/modules/presets/preset.js index 65fcef1f5..d1336acf5 100644 --- a/modules/presets/preset.js +++ b/modules/presets/preset.js @@ -79,11 +79,9 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { }; - let _textCache = {}; _this.t = (scope, options) => { const textID = `presets.presets.${presetID}.${scope}`; - if (_textCache[textID]) return _textCache[textID]; - return _textCache[textID] = t(textID, options); + return t(textID, options); }; @@ -92,13 +90,13 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { let path = presetID.split('/'); path.pop(); // remove brand name // NOTE: insert an en-dash, not a hyphen (to avoid conflict with fr - nl names in Brussels etc) - return _this.originalName + ' – ' + t('presets.presets.' + path.join('/') + '.name'); + return _this.originalName + ' – ' + t('presets.presets.' + path.join('/') + '.name', { html: false }); } - return _this.t('name', { 'default': _this.originalName }); + return _this.t('name', { 'default': _this.originalName, html: false }); }; - _this.terms = () => _this.t('terms', { 'default': _this.originalTerms }) + _this.terms = () => _this.t('terms', { 'default': _this.originalTerms, html: false }) .toLowerCase().trim().split(/\s*,+\s*/); diff --git a/modules/renderer/tile_layer.js b/modules/renderer/tile_layer.js index 9255927d6..163125e38 100644 --- a/modules/renderer/tile_layer.js +++ b/modules/renderer/tile_layer.js @@ -238,7 +238,7 @@ export function rendererTileLayer(context) { debug .selectAll('.tile-label-debug-coord') - .text(function(d) { return d[2] + ' / ' + d[0] + ' / ' + d[1]; }); + .html(function(d) { return d[2] + ' / ' + d[0] + ' / ' + d[1]; }); debug .selectAll('.tile-label-debug-vintage') @@ -246,7 +246,7 @@ export function rendererTileLayer(context) { var span = d3_select(this); var center = context.projection.invert(tileCenter(d)); _source.getMetadata(center, d, function(err, result) { - span.text((result && result.vintage && result.vintage.range) || + span.html((result && result.vintage && result.vintage.range) || t('info_panels.background.vintage') + ': ' + t('info_panels.background.unknown') ); }); diff --git a/modules/services/openstreetcam.js b/modules/services/openstreetcam.js index c173680d5..0f8ab2b7d 100644 --- a/modules/services/openstreetcam.js +++ b/modules/services/openstreetcam.js @@ -265,22 +265,22 @@ export default { controlsEnter .append('button') .on('click.back', step(-1)) - .text('◄'); + .html('◄'); controlsEnter .append('button') .on('click.rotate-ccw', rotate(-90)) - .text('⤿'); + .html('⤿'); controlsEnter .append('button') .on('click.rotate-cw', rotate(90)) - .text('⤾'); + .html('⤾'); controlsEnter .append('button') .on('click.forward', step(1)) - .text('►'); + .html('►'); wrapEnter .append('div') @@ -423,22 +423,22 @@ export default { .attr('class', 'captured_by') .attr('target', '_blank') .attr('href', 'https://openstreetcam.org/user/' + encodeURIComponent(d.captured_by)) - .text('@' + d.captured_by); + .html('@' + d.captured_by); attribution .append('span') - .text('|'); + .html('|'); } if (d.captured_at) { attribution .append('span') .attr('class', 'captured_at') - .text(localeDateString(d.captured_at)); + .html(localeDateString(d.captured_at)); attribution .append('span') - .text('|'); + .html('|'); } attribution @@ -446,7 +446,7 @@ export default { .attr('class', 'image-link') .attr('target', '_blank') .attr('href', 'https://openstreetcam.org/details/' + d.sequence_id + '/' + d.sequence_index) - .text('openstreetcam.org'); + .html('openstreetcam.org'); } return this; diff --git a/modules/services/streetside.js b/modules/services/streetside.js index 0c1dbcad5..c3e232f8c 100644 --- a/modules/services/streetside.js +++ b/modules/services/streetside.js @@ -526,12 +526,12 @@ export default { controlsEnter .append('button') .on('click.back', step(-1)) - .text('◄'); + .html('◄'); controlsEnter .append('button') .on('click.forward', step(1)) - .text('►'); + .html('►'); // create working canvas for stitching together images @@ -789,7 +789,7 @@ export default { label .append('span') - .text(t('streetside.hires')); + .html(t('streetside.hires')); let captureInfo = line1 @@ -805,18 +805,18 @@ export default { .attr('class', 'captured_by') .attr('target', '_blank') .attr('href', 'https://www.microsoft.com/en-us/maps/streetside') - .text('©' + yyyy + ' Microsoft'); + .html('©' + yyyy + ' Microsoft'); captureInfo .append('span') - .text('|'); + .html('|'); } if (d.captured_at) { captureInfo .append('span') .attr('class', 'captured_at') - .text(localeTimestamp(d.captured_at)); + .html(localeTimestamp(d.captured_at)); } // Add image links @@ -830,7 +830,7 @@ export default { .attr('target', '_blank') .attr('href', 'https://www.bing.com/maps?cp=' + d.loc[1] + '~' + d.loc[0] + '&lvl=17&dir=' + d.ca + '&style=x&v=2&sV=1') - .text(t('streetside.view_on_bing')); + .html(t('streetside.view_on_bing')); line2 .append('a') @@ -838,7 +838,7 @@ export default { .attr('target', '_blank') .attr('href', 'https://www.bing.com/maps/privacyreport/streetsideprivacyreport?bubbleid=' + encodeURIComponent(d.key) + '&focus=photo&lat=' + d.loc[1] + '&lng=' + d.loc[0] + '&z=17') - .text(t('streetside.report')); + .html(t('streetside.report')); let bubbleIdQuadKey = d.key.toString(4); diff --git a/modules/svg/mapillary_map_features.js b/modules/svg/mapillary_map_features.js index d0b8b77da..45b00e9b3 100644 --- a/modules/svg/mapillary_map_features.js +++ b/modules/svg/mapillary_map_features.js @@ -112,7 +112,7 @@ export function svgMapillaryMapFeatures(projection, context, dispatch) { .append('title') .text(function(d) { var id = d.value.replace(/--/g, '.').replace(/-/g, '_'); - return t('mapillary_map_features.' + id); + return t('mapillary_map_features.' + id, { html: false }); }); enter diff --git a/modules/ui/account.js b/modules/ui/account.js index 91ab09fcd..77969b37b 100644 --- a/modules/ui/account.js +++ b/modules/ui/account.js @@ -47,12 +47,12 @@ export function uiAccount(context) { // Add user name userLink.append('span') .attr('class', 'label') - .text(details.display_name); + .html(details.display_name); logoutLink.append('a') .attr('class', 'logout') .attr('href', '#') - .text(t('logout')) + .html(t('logout')) .on('click.logout', function() { d3_event.preventDefault(); osm.logout(); diff --git a/modules/ui/attribution.js b/modules/ui/attribution.js index 4001d3e25..27cf0e0e7 100644 --- a/modules/ui/attribution.js +++ b/modules/ui/attribution.js @@ -56,7 +56,7 @@ export function uiAttribution(context) { attribution .append('span') .attr('class', 'attribution-text') - .text(terms_text); + .html(terms_text); }) .merge(attributions); @@ -76,7 +76,7 @@ export function uiAttribution(context) { .merge(copyright); copyright - .text(String); + .html(String); } diff --git a/modules/ui/changeset_editor.js b/modules/ui/changeset_editor.js index 6adf1313e..192e4aab5 100644 --- a/modules/ui/changeset_editor.js +++ b/modules/ui/changeset_editor.js @@ -108,7 +108,7 @@ export function uiChangesetEditor(context) { .call(svgIcon('#iD-icon-alert', 'inline')) .attr('href', t('commit.google_warning_link')) .append('span') - .text(t('commit.google_warning')); + .html(t('commit.google_warning')); commentEnter .transition() diff --git a/modules/ui/combobox.js b/modules/ui/combobox.js index 1a11fced9..31bf215c4 100644 --- a/modules/ui/combobox.js +++ b/modules/ui/combobox.js @@ -380,7 +380,7 @@ export function uiCombobox(context, klass) { .append('a') .attr('class', 'combobox-option') .attr('title', function(d) { return d.title; }) - .text(function(d) { return d.display || d.value; }) + .html(function(d) { return d.display || d.value; }) .on('mouseenter', _mouseEnterHandler) .on('mouseleave', _mouseLeaveHandler) .merge(options) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 01271385a..eab57a373 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -223,7 +223,7 @@ export function uiCommit(context) { .append('div') .attr('class', 'header-block') .append('h3') - .text(t('commit.title')); + .html(t('commit.title')); headerTitle .append('div') @@ -283,7 +283,7 @@ export function uiCommit(context) { prose = prose.enter() .append('p') .attr('class', 'commit-info') - .text(t('commit.upload_explanation')) + .html(t('commit.upload_explanation')) .merge(prose); // always check if this has changed, but only update prose.html() @@ -306,7 +306,7 @@ export function uiCommit(context) { userLink .append('a') .attr('class', 'user-info') - .text(user.display_name) + .html(user.display_name) .attr('href', osm.userURL(user.display_name)) .attr('target', '_blank'); @@ -337,7 +337,7 @@ export function uiCommit(context) { labelEnter .append('span') - .text(t('commit.request_review')); + .html(t('commit.request_review')); // Update requestReview = requestReview @@ -362,7 +362,7 @@ export function uiCommit(context) { .attr('class', 'secondary-action button cancel-button') .append('span') .attr('class', 'label') - .text(t('commit.cancel')); + .html(t('commit.cancel')); var uploadButton = buttonEnter .append('button') @@ -370,7 +370,7 @@ export function uiCommit(context) { uploadButton.append('span') .attr('class', 'label') - .text(t('commit.save')); + .html(t('commit.save')); var uploadBlockerTooltipText = getUploadBlockerMessage(); diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index 2ed0e8912..9e62a415e 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -27,7 +27,7 @@ export function uiCommitWarnings(context) { containerEnter .append('h3') - .text(severity === 'warning' ? t('commit.warnings') : t('commit.errors')); + .html(severity === 'warning' ? t('commit.warnings') : t('commit.errors')); containerEnter .append('ul') @@ -64,7 +64,7 @@ export function uiCommitWarnings(context) { .merge(items); items.selectAll('.issue-message') - .text(function(d) { + .html(function(d) { return d.message(context); }); diff --git a/modules/ui/confirm.js b/modules/ui/confirm.js index e17a2732f..bd47d4e64 100644 --- a/modules/ui/confirm.js +++ b/modules/ui/confirm.js @@ -27,7 +27,7 @@ export function uiConfirm(selection) { .on('click.confirm', function() { modalSelection.remove(); }) - .text(t('confirm.okay')) + .html(t('confirm.okay')) .node() .focus(); diff --git a/modules/ui/conflicts.js b/modules/ui/conflicts.js index 1cd2134cf..b0c5a866e 100644 --- a/modules/ui/conflicts.js +++ b/modules/ui/conflicts.js @@ -66,7 +66,7 @@ export function uiConflicts(context) { headerEnter .append('h3') - .text(t('save.conflict.header')); + .html(t('save.conflict.header')); var bodyEnter = selection.selectAll('.body') .data([0]) @@ -77,7 +77,7 @@ export function uiConflicts(context) { var conflictsHelpEnter = bodyEnter .append('div') .attr('class', 'conflicts-help') - .text(t('save.conflict.help')); + .html(t('save.conflict.help')); // Download changes link @@ -110,7 +110,7 @@ export function uiConflicts(context) { linkEnter .call(svgIcon('#iD-icon-load', 'inline')) .append('span') - .text(t('save.conflict.download_changes')); + .html(t('save.conflict.download_changes')); bodyEnter @@ -123,7 +123,7 @@ export function uiConflicts(context) { .attr('class', 'conflicts-done') .attr('opacity', 0) .style('display', 'none') - .text(t('save.conflict.done')); + .html(t('save.conflict.done')); var buttonsEnter = bodyEnter .append('div') @@ -133,13 +133,13 @@ export function uiConflicts(context) { .append('button') .attr('disabled', _conflictList.length > 1) .attr('class', 'action conflicts-button col6') - .text(t('save.title')) + .html(t('save.title')) .on('click.try_again', tryAgain); buttonsEnter .append('button') .attr('class', 'secondary-action conflicts-button col6') - .text(t('confirm.cancel')) + .html(t('confirm.cancel')) .on('click.cancel', cancel); } @@ -177,13 +177,13 @@ export function uiConflicts(context) { conflictEnter .append('h4') .attr('class', 'conflict-count') - .text(t('save.conflict.count', { num: index + 1, total: _conflictList.length })); + .html(t('save.conflict.count', { num: index + 1, total: _conflictList.length })); conflictEnter .append('a') .attr('class', 'conflict-description') .attr('href', '#') - .text(function(d) { return d.name; }) + .html(function(d) { return d.name; }) .on('click', function(d) { d3_event.preventDefault(); zoomToEntity(d.id); @@ -215,7 +215,7 @@ export function uiConflicts(context) { .data(['previous', 'next']) .enter() .append('button') - .text(function(d) { return t('save.conflict.' + d); }) + .html(function(d) { return t('save.conflict.' + d); }) .attr('class', 'conflict-nav-button action col6') .attr('disabled', function(d, i) { return (i === 0 && index === 0) || @@ -265,7 +265,7 @@ export function uiConflicts(context) { labelEnter .append('span') - .text(function(d) { return d.text; }); + .html(function(d) { return d.text; }); // update choicesEnter diff --git a/modules/ui/contributors.js b/modules/ui/contributors.js index 036b2cfa6..7adb6db15 100644 --- a/modules/ui/contributors.js +++ b/modules/ui/contributors.js @@ -39,7 +39,7 @@ export function uiContributors(context) { .attr('class', 'user-link') .attr('href', function(d) { return osm.userURL(d); }) .attr('target', '_blank') - .text(String); + .html(String); if (u.length > limit) { var count = d3_select(document.createElement('span')); @@ -51,7 +51,7 @@ export function uiContributors(context) { .attr('href', function() { return osm.changesetsURL(context.map().center(), context.map().zoom()); }) - .text(othersNum); + .html(othersNum); wrap.append('span') .html(t('contributors.truncated_list', { n: othersNum, users: userList.html(), count: count.html() })); diff --git a/modules/ui/data_editor.js b/modules/ui/data_editor.js index 7048f04a2..6dcd60842 100644 --- a/modules/ui/data_editor.js +++ b/modules/ui/data_editor.js @@ -33,7 +33,7 @@ export function uiDataEditor(context) { headerEnter .append('h3') - .text(t('map_data.title')); + .html(t('map_data.title')); var body = selection.selectAll('.body') diff --git a/modules/ui/data_header.js b/modules/ui/data_header.js index f9aebdb60..e7c38e5d9 100644 --- a/modules/ui/data_header.js +++ b/modules/ui/data_header.js @@ -32,7 +32,7 @@ export function uiDataHeader() { headerEnter .append('div') .attr('class', 'data-header-label') - .text(t('map_data.layers.custom.title')); + .html(t('map_data.layers.custom.title')); } diff --git a/modules/ui/disclosure.js b/modules/ui/disclosure.js index 7294a58a1..e076ed242 100644 --- a/modules/ui/disclosure.js +++ b/modules/ui/disclosure.js @@ -49,7 +49,7 @@ export function uiDisclosure(context, key, expandedDefault) { .classed('expanded', _expanded); hideToggle.selectAll('.hide-toggle-text') - .text(_title()); + .html(_title()); hideToggle.selectAll('.hide-toggle-icon') .attr('xlink:href', _expanded ? '#iD-icon-down' diff --git a/modules/ui/edit_menu.js b/modules/ui/edit_menu.js index b149ba7c5..a454f5fd5 100644 --- a/modules/ui/edit_menu.js +++ b/modules/ui/edit_menu.js @@ -109,7 +109,7 @@ export function uiEditMenu(context) { if (showLabels) { buttonsEnter.append('span') .attr('class', 'label') - .text(function(d) { + .html(function(d) { return d.title; }); } @@ -148,7 +148,7 @@ export function uiEditMenu(context) { .duration(4000) .iconName('#iD-operation-' + operation.id) .iconClass('operation disabled') - .text(operation.tooltip)(); + .html(operation.tooltip)(); } } else { if (lastPointerUpType === 'touch' || @@ -157,7 +157,7 @@ export function uiEditMenu(context) { .duration(2000) .iconName('#iD-operation-' + operation.id) .iconClass('operation') - .text(operation.annotation() || operation.title)(); + .html(operation.annotation() || operation.title)(); } operation(); diff --git a/modules/ui/entity_editor.js b/modules/ui/entity_editor.js index df9846011..b905af80c 100644 --- a/modules/ui/entity_editor.js +++ b/modules/ui/entity_editor.js @@ -61,7 +61,7 @@ export function uiEntityEditor(context) { .merge(headerEnter); header.selectAll('h3') - .text(_entityIDs.length === 1 ? t('inspector.edit') : t('inspector.edit_features')); + .html(_entityIDs.length === 1 ? t('inspector.edit') : t('inspector.edit_features')); header.selectAll('.preset-reset') .on('click', function() { diff --git a/modules/ui/feature_list.js b/modules/ui/feature_list.js index 69b9709b7..bb1d405dd 100644 --- a/modules/ui/feature_list.js +++ b/modules/ui/feature_list.js @@ -35,7 +35,7 @@ export function uiFeatureList(context) { header .append('h3') - .text(t('inspector.feature_list')); + .html(t('inspector.feature_list')); var searchWrap = selection .append('div') @@ -46,7 +46,7 @@ export function uiFeatureList(context) { var search = searchWrap .append('input') - .attr('placeholder', t('inspector.search')) + .attr('placeholder', t('inspector.search', { html: false })) .attr('type', 'search') .call(utilNoAuto) .on('keypress', keypress) @@ -254,7 +254,7 @@ export function uiFeatureList(context) { .attr('class', 'entity-name'); list.selectAll('.no-results-item .entity-name') - .text(t('geocoder.no_results_worldwide')); + .html(t('geocoder.no_results_worldwide')); if (services.geocoder) { list.selectAll('.geocode-item') @@ -267,7 +267,7 @@ export function uiFeatureList(context) { .attr('class', 'label') .append('span') .attr('class', 'entity-name') - .text(t('geocoder.search')); + .html(t('geocoder.search')); } list.selectAll('.no-results-item') @@ -303,12 +303,12 @@ export function uiFeatureList(context) { label .append('span') .attr('class', 'entity-type') - .text(function(d) { return d.type; }); + .html(function(d) { return d.type; }); label .append('span') .attr('class', 'entity-name') - .text(function(d) { return d.name; }); + .html(function(d) { return d.name; }); enter .style('opacity', 0) diff --git a/modules/ui/field.js b/modules/ui/field.js index 163264cf0..9d92eb873 100644 --- a/modules/ui/field.js +++ b/modules/ui/field.js @@ -132,7 +132,7 @@ export function uiField(context, presetField, entityIDs, options) { textEnter .append('span') .attr('class', 'label-textvalue') - .text(function(d) { return d.label(); }); + .html(function(d) { return d.label(); }); textEnter .append('span') @@ -142,7 +142,7 @@ export function uiField(context, presetField, entityIDs, options) { labelEnter .append('button') .attr('class', 'remove-icon') - .attr('title', t('icons.remove')) + .attr('title', t('icons.remove', { html: false })) .attr('tabindex', -1) .call(svgIcon('#iD-operation-delete')); } @@ -151,7 +151,7 @@ export function uiField(context, presetField, entityIDs, options) { labelEnter .append('button') .attr('class', 'modified-icon') - .attr('title', t('icons.undo')) + .attr('title', t('icons.undo', { html: false })) .attr('tabindex', -1) .call(svgIcon((localizer.textDirection() === 'rtl') ? '#iD-icon-redo' : '#iD-icon-undo')); } diff --git a/modules/ui/field_help.js b/modules/ui/field_help.js index ba8b0e9b7..b81aa686b 100644 --- a/modules/ui/field_help.js +++ b/modules/ui/field_help.js @@ -198,7 +198,7 @@ export function uiFieldHelp(context, fieldName) { titleEnter .append('h2') .attr('class', ((localizer.textDirection() === 'rtl') ? 'fr' : 'fl')) - .text(t('help.field.' + fieldName + '.title')); + .html(t('help.field.' + fieldName + '.title')); titleEnter .append('button') @@ -220,7 +220,7 @@ export function uiFieldHelp(context, fieldName) { .enter() .append('div') .attr('class', 'field-help-nav-item') - .text(function(d) { return d; }) + .html(function(d) { return d; }) .on('click', function(d, i) { d3_event.stopPropagation(); d3_event.preventDefault(); diff --git a/modules/ui/fields/access.js b/modules/ui/fields/access.js index d7f4c8d6f..8e6823f09 100644 --- a/modules/ui/fields/access.js +++ b/modules/ui/fields/access.js @@ -40,7 +40,7 @@ export function uiFieldAccess(field, context) { .append('span') .attr('class', 'label preset-label-access') .attr('for', function(d) { return 'preset-input-access-' + d; }) - .text(function(d) { return field.t('types.' + d); }); + .html(function(d) { return field.t('types.' + d); }); enter .append('div') @@ -217,7 +217,7 @@ export function uiFieldAccess(field, context) { }) .attr('placeholder', function(d) { if (tags[d] && Array.isArray(tags[d])) { - return t('inspector.multiple_values'); + return t('inspector.multiple_values', { html: false }); } if (d === 'access') { return 'yes'; diff --git a/modules/ui/fields/address.js b/modules/ui/fields/address.js index 6564e1f2b..d292f736c 100644 --- a/modules/ui/fields/address.js +++ b/modules/ui/fields/address.js @@ -274,12 +274,12 @@ export function uiFieldAddress(field, context) { function updatePlaceholder(inputSelection) { return inputSelection.attr('placeholder', function(subfield) { if (_tags && Array.isArray(_tags[field.key + ':' + subfield.id])) { - return t('inspector.multiple_values'); + return t('inspector.multiple_values', { html: false }); } if (_countryCode) { var localkey = subfield.id + '!' + _countryCode; var tkey = addrField.strings.placeholders[localkey] ? localkey : subfield.id; - return addrField.t('placeholders.' + tkey); + return addrField.t('placeholders.' + tkey, { html: false }); } }); } diff --git a/modules/ui/fields/check.js b/modules/ui/fields/check.js index 8e0342fea..d44e8ecba 100644 --- a/modules/ui/fields/check.js +++ b/modules/ui/fields/check.js @@ -83,7 +83,7 @@ export function uiFieldCheck(field, context) { var icon = pseudoDirection ? '#iD-icon-forward' : '#iD-icon-backward'; selection.selectAll('.reverser-span') - .text(t('inspector.check.reverser')) + .html(t('inspector.check.reverser')) .call(svgIcon(icon, 'inline')); return selection; @@ -108,7 +108,7 @@ export function uiFieldCheck(field, context) { enter .append('span') - .text(texts[0]) + .html(texts[0]) .attr('class', 'value'); if (field.type === 'onewayCheck') { @@ -212,7 +212,7 @@ export function uiFieldCheck(field, context) { .property('checked', isChecked(_value)); text - .text(isMixed ? t('inspector.multiple_values') : textFor(_value)) + .html(isMixed ? t('inspector.multiple_values') : textFor(_value)) .classed('mixed', isMixed); label diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index 65f1fc398..1c0733d8f 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -149,7 +149,7 @@ export function uiFieldCombo(field, context) { if (optstrings) { _comboData = Object.keys(optstrings).map(function(k) { - var v = field.t('options.' + k, { 'default': optstrings[k] }); + var v = field.t('options.' + k, { 'default': optstrings[k], html: false }); return { key: k, value: v, @@ -242,7 +242,7 @@ export function uiFieldCombo(field, context) { function setPlaceholder(values) { if (isMulti || isSemi) { - _staticPlaceholder = field.placeholder() || t('inspector.add'); + _staticPlaceholder = field.placeholder() || t('inspector.add', { html: false }); } else { var vals = values .map(function(d) { return d.value; }) @@ -258,7 +258,7 @@ export function uiFieldCombo(field, context) { var ph; if (!isMulti && !isSemi && _tags && Array.isArray(_tags[field.key])) { - ph = t('inspector.multiple_values'); + ph = t('inspector.multiple_values', { html: false }); } else { ph = _staticPlaceholder; } @@ -528,7 +528,7 @@ export function uiFieldCombo(field, context) { return d.isMixed; }) .attr('title', function(d) { - return d.isMixed ? t('inspector.unshared_value_tooltip') : null; + return d.isMixed ? t('inspector.unshared_value_tooltip', { html: false }) : null; }); if (allowDragAndDrop) { @@ -536,12 +536,12 @@ export function uiFieldCombo(field, context) { } chips.select('span') - .text(function(d) { return d.value; }); + .html(function(d) { return d.value; }); chips.select('a') .on('click', removeMultikey) .attr('class', 'remove') - .text('×'); + .html('×'); } else { var isMixed = Array.isArray(tags[field.key]); @@ -552,7 +552,7 @@ export function uiFieldCombo(field, context) { utilGetSetValue(input, !isMixed ? displayValue(tags[field.key]) : '') .attr('title', isMixed ? mixedValues.join('\n') : undefined) - .attr('placeholder', isMixed ? t('inspector.multiple_values') : _staticPlaceholder || '') + .attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : _staticPlaceholder || '') .classed('mixed', isMixed); } }; diff --git a/modules/ui/fields/cycleway.js b/modules/ui/fields/cycleway.js index acfc37ed5..0ee8d32f1 100644 --- a/modules/ui/fields/cycleway.js +++ b/modules/ui/fields/cycleway.js @@ -49,7 +49,7 @@ export function uiFieldCycleway(field, context) { .append('span') .attr('class', 'label preset-label-cycleway') .attr('for', function(d) { return 'preset-input-cycleway-' + stripcolon(d); }) - .text(function(d) { return field.t('types.' + d); }); + .html(function(d) { return field.t('types.' + d); }); enter .append('div') @@ -149,7 +149,7 @@ export function uiFieldCycleway(field, context) { }) .attr('placeholder', function(d) { if (Array.isArray(tags.cycleway) || Array.isArray(tags[d])) { - return t('inspector.multiple_values'); + return t('inspector.multiple_values', { html: false }); } return field.placeholder(); }) diff --git a/modules/ui/fields/input.js b/modules/ui/fields/input.js index 3f231cb17..fe2494e3d 100644 --- a/modules/ui/fields/input.js +++ b/modules/ui/fields/input.js @@ -113,7 +113,7 @@ export function uiFieldText(field, context) { var domainResults = /^https?:\/\/(.{1,}?)\//.exec(field.urlFormat); if (domainResults.length >= 2 && domainResults[1]) { var domain = domainResults[1]; - return t('icons.view_on', { domain: domain }); + return t('icons.view_on', { domain: domain, html: false }); } return ''; }) @@ -202,7 +202,7 @@ export function uiFieldText(field, context) { utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : '') .attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined) - .attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown'))) + .attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : (field.placeholder() || t('inspector.unknown', { html: false }))) .classed('mixed', isMixed); if (outlinkButton && !outlinkButton.empty()) { diff --git a/modules/ui/fields/lanes.js b/modules/ui/fields/lanes.js index 61297df9c..d442678f9 100644 --- a/modules/ui/fields/lanes.js +++ b/modules/ui/fields/lanes.js @@ -77,7 +77,7 @@ export function uiFieldLanes(field, context) { .append('text') .attr('y', 40) .attr('x', 14) - .text('▲'); + .html('▲'); enter .append('g') @@ -85,7 +85,7 @@ export function uiFieldLanes(field, context) { .append('text') .attr('y', 40) .attr('x', 14) - .text('▲▼'); + .html('▲▼'); enter .append('g') @@ -93,7 +93,7 @@ export function uiFieldLanes(field, context) { .append('text') .attr('y', 40) .attr('x', 14) - .text('▼'); + .html('▼'); lane = lane diff --git a/modules/ui/fields/localized.js b/modules/ui/fields/localized.js index 3906b494f..d390cc1b4 100644 --- a/modules/ui/fields/localized.js +++ b/modules/ui/fields/localized.js @@ -513,7 +513,7 @@ export function uiFieldLocalized(field, context) { text .append('span') .attr('class', 'label-textvalue') - .text(t('translate.localized_translation_label')); + .html(t('translate.localized_translation_label')); text .append('span') @@ -544,7 +544,7 @@ export function uiFieldLocalized(field, context) { .attr('class', 'localized-lang') .attr('id', domId) .attr('type', 'text') - .attr('placeholder', t('translate.localized_translation_language')) + .attr('placeholder', t('translate.localized_translation_language', { html: false })) .on('blur', changeLang) .on('change', changeLang) .call(langCombo); @@ -591,7 +591,7 @@ export function uiFieldLocalized(field, context) { return Array.isArray(d.value) ? d.value.filter(Boolean).join('\n') : null; }) .attr('placeholder', function(d) { - return Array.isArray(d.value) ? t('inspector.multiple_values') : t('translate.localized_translation_name'); + return Array.isArray(d.value) ? t('inspector.multiple_values', { html: false }) : t('translate.localized_translation_name', { html: false }); }) .classed('mixed', function(d) { return Array.isArray(d.value); @@ -618,7 +618,7 @@ export function uiFieldLocalized(field, context) { utilGetSetValue(input, typeof tags[field.key] === 'string' ? tags[field.key] : '') .attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined) - .attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder()) + .attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : field.placeholder()) .classed('mixed', isMixed); calcMultilingual(tags); diff --git a/modules/ui/fields/maxspeed.js b/modules/ui/fields/maxspeed.js index 982b2eb0f..0983ea4fc 100644 --- a/modules/ui/fields/maxspeed.js +++ b/modules/ui/fields/maxspeed.js @@ -129,7 +129,7 @@ export function uiFieldMaxspeed(field, context) { utilGetSetValue(input, typeof value === 'string' ? value : '') .attr('title', isMixed ? value.filter(Boolean).join('\n') : null) - .attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder()) + .attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : field.placeholder()) .classed('mixed', isMixed); }; diff --git a/modules/ui/fields/radio.js b/modules/ui/fields/radio.js index 87df640ee..2e9a94dde 100644 --- a/modules/ui/fields/radio.js +++ b/modules/ui/fields/radio.js @@ -59,12 +59,12 @@ export function uiFieldRadio(field, context) { .append('input') .attr('type', 'radio') .attr('name', field.id) - .attr('value', function(d) { return field.t('options.' + d, { 'default': d }); }) + .attr('value', function(d) { return field.t('options.' + d, { 'default': d, html: false }); }) .attr('checked', false); enter .append('span') - .text(function(d) { return field.t('options.' + d, { 'default': d }); }); + .html(function(d) { return field.t('options.' + d, { 'default': d }); }); labels = labels .merge(enter); @@ -129,7 +129,7 @@ export function uiFieldRadio(field, context) { .append('span') .attr('class', 'label structure-label-type') .attr('for', 'preset-input-' + selected) - .text(t('inspector.radio.structure.type')); + .html(t('inspector.radio.structure.type')); typeEnter .append('div') @@ -174,7 +174,7 @@ export function uiFieldRadio(field, context) { .append('span') .attr('class', 'label structure-label-layer') .attr('for', 'preset-input-layer') - .text(t('inspector.radio.structure.layer')); + .html(t('inspector.radio.structure.layer')); layerEnter .append('div') @@ -290,16 +290,16 @@ export function uiFieldRadio(field, context) { }) .classed('mixed', isMixed) .attr('title', function(d) { - return isMixed(d) ? t('inspector.unshared_value_tooltip') : null; + return isMixed(d) ? t('inspector.unshared_value_tooltip', { html: false }) : null; }); var selection = radios.filter(function() { return this.checked; }); if (selection.empty()) { - placeholder.text(t('inspector.none')); + placeholder.html(t('inspector.none')); } else { - placeholder.text(selection.attr('value')); + placeholder.html(selection.attr('value')); _oldType[selection.datum()] = tags[selection.datum()]; } diff --git a/modules/ui/fields/restrictions.js b/modules/ui/fields/restrictions.js index af562d76d..84ddb139a 100644 --- a/modules/ui/fields/restrictions.js +++ b/modules/ui/fields/restrictions.js @@ -124,7 +124,7 @@ export function uiFieldRestrictions(field, context) { distControlEnter .append('span') .attr('class', 'restriction-control-label restriction-distance-label') - .text(t('restriction.controls.distance') + ':'); + .html(t('restriction.controls.distance') + ':'); distControlEnter .append('input') @@ -151,7 +151,7 @@ export function uiFieldRestrictions(field, context) { }); selection.selectAll('.restriction-distance-text') - .text(displayMaxDistance(_maxDistance)); + .html(displayMaxDistance(_maxDistance)); var viaControl = selection.selectAll('.restriction-via-way') @@ -167,7 +167,7 @@ export function uiFieldRestrictions(field, context) { viaControlEnter .append('span') .attr('class', 'restriction-control-label restriction-via-way-label') - .text(t('restriction.controls.via') + ':'); + .html(t('restriction.controls.via') + ':'); viaControlEnter .append('input') @@ -193,7 +193,7 @@ export function uiFieldRestrictions(field, context) { }); selection.selectAll('.restriction-via-way-text') - .text(displayMaxVia(_maxViaWay)); + .html(displayMaxVia(_maxViaWay)); } @@ -517,7 +517,7 @@ export function uiFieldRestrictions(field, context) { help .append('div') // "NO Right Turn (indirect)" .attr('class', 'qualifier ' + klass) - .text(turnText); + .html(turnText); help .append('div') // "FROM {fromName} TO {toName}" @@ -548,7 +548,7 @@ export function uiFieldRestrictions(field, context) { if (!indirect) { help .append('div') // Click for "No Right Turn" - .text(t('restriction.help.toggle', { turn: nextText.trim() })); + .html(t('restriction.help.toggle', { turn: nextText.trim() })); } highlightPathsFrom(null); diff --git a/modules/ui/fields/textarea.js b/modules/ui/fields/textarea.js index 31e792052..24ce418f2 100644 --- a/modules/ui/fields/textarea.js +++ b/modules/ui/fields/textarea.js @@ -61,7 +61,7 @@ export function uiFieldTextarea(field, context) { utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : '') .attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined) - .attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown'))) + .attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : (field.placeholder() || t('inspector.unknown', { html: false }))) .classed('mixed', isMixed); }; diff --git a/modules/ui/fields/wikidata.js b/modules/ui/fields/wikidata.js index 51586b55b..46b7dca66 100644 --- a/modules/ui/fields/wikidata.js +++ b/modules/ui/fields/wikidata.js @@ -93,7 +93,7 @@ export function uiFieldWikidata(field, context) { searchRowEnter .append('button') .attr('class', 'form-field-button wiki-link') - .attr('title', t('icons.view_on', { domain: 'wikidata.org' })) + .attr('title', t('icons.view_on', { domain: 'wikidata.org', html: false })) .attr('tabindex', -1) .call(svgIcon('#iD-icon-out-link')) .on('click', function() { @@ -118,7 +118,7 @@ export function uiFieldWikidata(field, context) { enter .append('span') .attr('class', 'label') - .text(function(d) { return t('wikidata.' + d); }); + .html(function(d) { return t('wikidata.' + d); }); enter .append('input') @@ -130,7 +130,7 @@ export function uiFieldWikidata(field, context) { enter .append('button') .attr('class', 'form-field-button') - .attr('title', t('icons.copy')) + .attr('title', t('icons.copy', { html: false })) .attr('tabindex', -1) .call(svgIcon('#iD-operation-copy')) .on('click', function() { @@ -292,7 +292,7 @@ export function uiFieldWikidata(field, context) { var isMixed = Array.isArray(tags[field.key]); _searchInput .attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : null) - .attr('placeholder', isMixed ? t('inspector.multiple_values') : '') + .attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : '') .classed('mixed', isMixed); _qid = typeof tags[field.key] === 'string' && tags[field.key] || ''; diff --git a/modules/ui/fields/wikipedia.js b/modules/ui/fields/wikipedia.js index 0db48abc7..8142bf6f5 100644 --- a/modules/ui/fields/wikipedia.js +++ b/modules/ui/fields/wikipedia.js @@ -87,7 +87,7 @@ export function uiFieldWikipedia(field, context) { .append('input') .attr('type', 'text') .attr('class', 'wiki-lang') - .attr('placeholder', t('translate.localized_translation_language')) + .attr('placeholder', t('translate.localized_translation_language', { html: false })) .call(utilNoAuto) .call(langCombo) .merge(_langInput); @@ -129,7 +129,7 @@ export function uiFieldWikipedia(field, context) { .append('button') .attr('class', 'form-field-button wiki-link') .attr('tabindex', -1) - .attr('title', t('icons.view_on', { domain: 'wikipedia.org' })) + .attr('title', t('icons.view_on', { domain: 'wikipedia.org', html: false })) .call(svgIcon('#iD-icon-out-link')) .merge(link); diff --git a/modules/ui/flash.js b/modules/ui/flash.js index d7ad2507d..152239c13 100644 --- a/modules/ui/flash.js +++ b/modules/ui/flash.js @@ -65,7 +65,7 @@ export function uiFlash(context) { content .selectAll('.flash-text') .attr('class', 'flash-text ' + (_textClass || '')) - .text(_text); + .html(_text); _flashTimer = d3_timeout(function() { diff --git a/modules/ui/form_fields.js b/modules/ui/form_fields.js index 035541afc..fb8559222 100644 --- a/modules/ui/form_fields.js +++ b/modules/ui/form_fields.js @@ -83,7 +83,7 @@ export function uiFormFields(context) { moreEnter .append('span') - .text(t('inspector.add_fields')); + .html(t('inspector.add_fields')); more = moreEnter .merge(more); diff --git a/modules/ui/full_screen.js b/modules/ui/full_screen.js index 9422afbf1..2589fc1f3 100644 --- a/modules/ui/full_screen.js +++ b/modules/ui/full_screen.js @@ -64,7 +64,7 @@ export function uiFullScreen(context) { if (!isSupported()) return; // button = selection.append('button') - // .attr('title', t('full_screen')) + // .attr('title', t('full_screen', { html: false })) // .attr('tabindex', -1) // .on('click', fullScreen) // .call(tooltip); diff --git a/modules/ui/geolocate.js b/modules/ui/geolocate.js index 8cc3e3961..58fe633f7 100644 --- a/modules/ui/geolocate.js +++ b/modules/ui/geolocate.js @@ -62,7 +62,7 @@ export function uiGeolocate(context) { zoomTo(); } else { context.ui().flash - .text(t('geolocate.location_unavailable')) + .html(t('geolocate.location_unavailable')) .iconName('#iD-icon-geolocate')(); } @@ -92,6 +92,6 @@ export function uiGeolocate(context) { .keys([t('geolocate.key')]) ); - context.keybinding().on(t('geolocate.key'), click); + context.keybinding().on(t('geolocate.key', { html: false }), click); }; } diff --git a/modules/ui/improveOSM_comments.js b/modules/ui/improveOSM_comments.js index e4ba9e779..1714942f0 100644 --- a/modules/ui/improveOSM_comments.js +++ b/modules/ui/improveOSM_comments.js @@ -56,19 +56,19 @@ export function uiImproveOsmComments() { .attr('target', '_blank'); } selection - .text(d => d.username); + .html(d => d.username); }); metadataEnter .append('div') .attr('class', 'comment-date') - .text(d => t('note.status.commented', { when: localeDateString(d.timestamp) })); + .html(d => t('note.status.commented', { when: localeDateString(d.timestamp) })); mainEnter .append('div') .attr('class', 'comment-text') .append('p') - .text(d => d.text); + .html(d => d.text); }) .catch(err => { console.log(err); // eslint-disable-line no-console diff --git a/modules/ui/improveOSM_details.js b/modules/ui/improveOSM_details.js index c5d39acf7..539bed16f 100644 --- a/modules/ui/improveOSM_details.js +++ b/modules/ui/improveOSM_details.js @@ -43,7 +43,7 @@ export function uiImproveOsmDetails(context) { descriptionEnter .append('h4') - .text(() => t('QA.keepRight.detail_description')); + .html(() => t('QA.keepRight.detail_description')); descriptionEnter .append('div') diff --git a/modules/ui/improveOSM_editor.js b/modules/ui/improveOSM_editor.js index 932f62f74..a9bd3a1b3 100644 --- a/modules/ui/improveOSM_editor.js +++ b/modules/ui/improveOSM_editor.js @@ -36,7 +36,7 @@ export function uiImproveOsmEditor(context) { headerEnter .append('h3') - .text(t('QA.improveOSM.title')); + .html(t('QA.improveOSM.title')); let body = selection.selectAll('.body') .data([0]); @@ -80,12 +80,12 @@ export function uiImproveOsmEditor(context) { saveSectionEnter .append('h4') .attr('class', '.qa-save-header') - .text(t('note.newComment')); + .html(t('note.newComment')); saveSectionEnter .append('textarea') .attr('class', 'new-comment-input') - .attr('placeholder', t('QA.keepRight.comment_placeholder')) + .attr('placeholder', t('QA.keepRight.comment_placeholder', { html: false })) .attr('maxlength', 1000) .property('value', d => d.newComment) .call(utilNoAuto) @@ -135,7 +135,7 @@ export function uiImproveOsmEditor(context) { buttonEnter .append('button') .attr('class', 'button comment-button action') - .text(t('QA.keepRight.save_comment')); + .html(t('QA.keepRight.save_comment')); buttonEnter .append('button') @@ -160,7 +160,7 @@ export function uiImproveOsmEditor(context) { }); buttonSection.select('.close-button') - .text(d => { + .html(d => { const andComment = (d.newComment ? '_comment' : ''); return t(`QA.keepRight.close${andComment}`); }) @@ -174,7 +174,7 @@ export function uiImproveOsmEditor(context) { }); buttonSection.select('.ignore-button') - .text(d => { + .html(d => { const andComment = (d.newComment ? '_comment' : ''); return t(`QA.keepRight.ignore${andComment}`); }) diff --git a/modules/ui/improveOSM_header.js b/modules/ui/improveOSM_header.js index 53c181671..60c0b85b3 100644 --- a/modules/ui/improveOSM_header.js +++ b/modules/ui/improveOSM_header.js @@ -62,7 +62,7 @@ export function uiImproveOsmHeader() { headerEnter .append('div') .attr('class', 'qa-header-label') - .text(issueTitle); + .html(issueTitle); } improveOsmHeader.issue = function(val) { diff --git a/modules/ui/info.js b/modules/ui/info.js index 29ce5afee..0bb414d42 100644 --- a/modules/ui/info.js +++ b/modules/ui/info.js @@ -59,7 +59,7 @@ export function uiInfo(context) { title .append('h3') - .text(function(d) { return panels[d].title; }); + .html(function(d) { return panels[d].title; }); title .append('button') @@ -123,10 +123,10 @@ export function uiInfo(context) { redraw(); context.keybinding() - .on(uiCmd('⌘' + t('info_panels.key')), info.toggle); + .on(uiCmd('⌘' + t('info_panels.key', { html: false })), info.toggle); ids.forEach(function(k) { - var key = t('info_panels.' + k + '.key', { default: null }); + var key = t('info_panels.' + k + '.key', { default: null, html: false }); if (!key) return; context.keybinding() .on(uiCmd('⌘⇧' + key), function() { info.toggle(k); }); diff --git a/modules/ui/init.js b/modules/ui/init.js index 6f51d89d3..69fa89396 100644 --- a/modules/ui/init.js +++ b/modules/ui/init.js @@ -126,7 +126,7 @@ export function uiInit(context) { map .on('hitMinZoom.ui', function() { - ui.flash.text(t('cannot_zoom'))(); + ui.flash.html(t('cannot_zoom'))(); }); container @@ -351,7 +351,7 @@ export function uiInit(context) { var panPixels = 80; context.keybinding() .on('⌫', function() { d3_event.preventDefault(); }) - .on([t('sidebar.key'), '`', '²', '@'], ui.sidebar.toggle) // #5663, #6864 - common QWERTY, AZERTY + .on([t('sidebar.key', { html: false }), '`', '²', '@'], ui.sidebar.toggle) // #5663, #6864 - common QWERTY, AZERTY .on('←', pan([panPixels, 0])) .on('↑', pan([0, panPixels])) .on('→', pan([-panPixels, 0])) @@ -360,7 +360,7 @@ export function uiInit(context) { .on(uiCmd('⌥↑'), pan([0, map.dimensions()[1]])) .on(uiCmd('⌥→'), pan([-map.dimensions()[0], 0])) .on(uiCmd('⌥↓'), pan([0, -map.dimensions()[1]])) - .on(uiCmd('⌘' + t('background.key')), function quickSwitch() { + .on(uiCmd('⌘' + t('background.key', { html: false })), function quickSwitch() { if (d3_event) { d3_event.stopImmediatePropagation(); d3_event.preventDefault(); @@ -373,12 +373,12 @@ export function uiInit(context) { context.background().baseLayerSource(previousBackground); } }) - .on(t('area_fill.wireframe.key'), function toggleWireframe() { + .on(t('area_fill.wireframe.key', { html: false }), function toggleWireframe() { d3_event.preventDefault(); d3_event.stopPropagation(); context.map().toggleWireframe(); }) - .on(uiCmd('⌥' + t('area_fill.wireframe.key')), function toggleOsmData() { + .on(uiCmd('⌥' + t('area_fill.wireframe.key', { html: false })), function toggleOsmData() { d3_event.preventDefault(); d3_event.stopPropagation(); @@ -394,7 +394,7 @@ export function uiInit(context) { } } }) - .on(t('map_data.highlight_edits.key'), function toggleHighlightEdited() { + .on(t('map_data.highlight_edits.key', { html: false }), function toggleHighlightEdited() { d3_event.preventDefault(); context.map().toggleHighlightEdited(); }); diff --git a/modules/ui/intro/helper.js b/modules/ui/intro/helper.js index 5094dffc9..36ed94d92 100644 --- a/modules/ui/intro/helper.js +++ b/modules/ui/intro/helper.js @@ -86,9 +86,9 @@ export function helpString(id, replacements) { return: uiCmd.display('↵'), esc: t('shortcuts.key.esc'), space: t('shortcuts.key.space'), - add_note_key: t('modes.add_note.key'), - help_key: t('help.key'), - shortcuts_key: t('shortcuts.toggle.key'), + add_note_key: t('modes.add_note.key', { html: false }), + help_key: t('help.key', { html: false }), + shortcuts_key: t('shortcuts.toggle.key', { html: false }), // reference localized UI labels directly so that they'll always match save: t('save.title'), diff --git a/modules/ui/intro/intro.js b/modules/ui/intro/intro.js index d8c47b361..4391fd7b7 100644 --- a/modules/ui/intro/intro.js +++ b/modules/ui/intro/intro.js @@ -191,7 +191,7 @@ export function uiIntro(context) { buttons .append('span') - .text(d => t(d.title)); + .html(d => t(d.title)); buttons .append('span') diff --git a/modules/ui/intro/navigation.js b/modules/ui/intro/navigation.js index cf1eae098..14a790022 100644 --- a/modules/ui/intro/navigation.js +++ b/modules/ui/intro/navigation.js @@ -406,7 +406,7 @@ export function uiIntroNavigation(context, reveal) { var firstName = first.select('.entity-name'); var name = t('intro.graph.name.spring-street'); - if (!firstName.empty() && firstName.text() === name) { + if (!firstName.empty() && firstName.html() === name) { reveal(first.node(), helpString('intro.navigation.choose_street', { name: name }), { duration: 300 } diff --git a/modules/ui/intro/start_editing.js b/modules/ui/intro/start_editing.js index 47ba615fe..d4ad7379e 100644 --- a/modules/ui/intro/start_editing.js +++ b/modules/ui/intro/start_editing.js @@ -72,7 +72,7 @@ export function uiIntroStartEditing(context, reveal) { startbutton .append('h2') - .text(t('intro.startediting.start')); + .html(t('intro.startediting.start')); dispatch.call('startEditing'); } diff --git a/modules/ui/issues_info.js b/modules/ui/issues_info.js index 147aba79d..4d1d0619c 100644 --- a/modules/ui/issues_info.js +++ b/modules/ui/issues_info.js @@ -84,7 +84,7 @@ export function uiIssuesInfo(context) { enter.merge(chips) .selectAll('span.count') - .text(function(d) { + .html(function(d) { return d.count.toString(); }); } diff --git a/modules/ui/keepRight_details.js b/modules/ui/keepRight_details.js index 23ca20fa3..994df1bb6 100644 --- a/modules/ui/keepRight_details.js +++ b/modules/ui/keepRight_details.js @@ -48,7 +48,7 @@ export function uiKeepRightDetails(context) { descriptionEnter .append('h4') - .text(() => t('QA.keepRight.detail_description')); + .html(() => t('QA.keepRight.detail_description')); descriptionEnter .append('div') diff --git a/modules/ui/keepRight_editor.js b/modules/ui/keepRight_editor.js index 1cf31797e..25a5a1809 100644 --- a/modules/ui/keepRight_editor.js +++ b/modules/ui/keepRight_editor.js @@ -35,7 +35,7 @@ export function uiKeepRightEditor(context) { headerEnter .append('h3') - .text(t('QA.keepRight.title')); + .html(t('QA.keepRight.title')); let body = selection.selectAll('.body') @@ -90,12 +90,12 @@ export function uiKeepRightEditor(context) { saveSectionEnter .append('h4') .attr('class', '.qa-save-header') - .text(t('QA.keepRight.comment')); + .html(t('QA.keepRight.comment')); saveSectionEnter .append('textarea') .attr('class', 'new-comment-input') - .attr('placeholder', t('QA.keepRight.comment_placeholder')) + .attr('placeholder', t('QA.keepRight.comment_placeholder', { html: false })) .attr('maxlength', 1000) .property('value', d => d.newComment || d.comment) .call(utilNoAuto) @@ -146,7 +146,7 @@ export function uiKeepRightEditor(context) { buttonEnter .append('button') .attr('class', 'button comment-button action') - .text(t('QA.keepRight.save_comment')); + .html(t('QA.keepRight.save_comment')); buttonEnter .append('button') @@ -171,7 +171,7 @@ export function uiKeepRightEditor(context) { }); buttonSection.select('.close-button') // select and propagate data - .text(d => { + .html(d => { const andComment = (d.newComment ? '_comment' : ''); return t(`QA.keepRight.close${andComment}`); }) @@ -185,7 +185,7 @@ export function uiKeepRightEditor(context) { }); buttonSection.select('.ignore-button') // select and propagate data - .text(d => { + .html(d => { const andComment = (d.newComment ? '_comment' : ''); return t(`QA.keepRight.ignore${andComment}`); }) diff --git a/modules/ui/keepRight_header.js b/modules/ui/keepRight_header.js index f574671f8..3bb79a893 100644 --- a/modules/ui/keepRight_header.js +++ b/modules/ui/keepRight_header.js @@ -47,7 +47,7 @@ export function uiKeepRightHeader() { headerEnter .append('div') .attr('class', 'qa-header-label') - .text(issueTitle); + .html(issueTitle); } diff --git a/modules/ui/loading.js b/modules/ui/loading.js index e55e470cd..6445dd93e 100644 --- a/modules/ui/loading.js +++ b/modules/ui/loading.js @@ -23,7 +23,7 @@ export function uiLoading(context) { loadertext .append('h3') - .text(_message); + .html(_message); _modalSelection.select('button.close') .attr('class', 'hide'); diff --git a/modules/ui/map_in_map.js b/modules/ui/map_in_map.js index ee5104854..c1a3f500c 100644 --- a/modules/ui/map_in_map.js +++ b/modules/ui/map_in_map.js @@ -320,7 +320,7 @@ export function uiMapInMap(context) { redraw(); context.keybinding() - .on(t('background.minimap.key'), toggle); + .on(t('background.minimap.key', { html: false }), toggle); } return mapInMap; diff --git a/modules/ui/note_comments.js b/modules/ui/note_comments.js index b8ea4ba5c..08e0f32e6 100644 --- a/modules/ui/note_comments.js +++ b/modules/ui/note_comments.js @@ -55,13 +55,13 @@ export function uiNoteComments() { .attr('target', '_blank'); } selection - .text(function(d) { return d.user || t('note.anonymous'); }); + .html(function(d) { return d.user || t('note.anonymous'); }); }); metadataEnter .append('div') .attr('class', 'comment-date') - .text(function(d) { + .html(function(d) { return t('note.status.' + d.action, { when: localeDateString(d.date) }); }); diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index c49dcdfaa..9e1f5a63f 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -54,7 +54,7 @@ export function uiNoteEditor(context) { headerEnter .append('h3') - .text(t('note.title')); + .html(t('note.title')); var body = selection.selectAll('.body') @@ -148,14 +148,14 @@ export function uiNoteEditor(context) { noteSaveEnter .append('h4') .attr('class', '.note-save-header') - .text(function() { + .html(function() { return _note.isNew() ? t('note.newDescription') : t('note.newComment'); }); var commentTextarea = noteSaveEnter .append('textarea') .attr('class', 'new-comment-input') - .attr('placeholder', t('note.inputPlaceholder')) + .attr('placeholder', t('note.inputPlaceholder', { html: false })) .attr('maxlength', 1000) .property('value', function(d) { return d.newComment; }) .call(utilNoAuto) @@ -256,14 +256,14 @@ export function uiNoteEditor(context) { authEnter .append('span') - .text(t('note.login')); + .html(t('note.login')); authEnter .append('a') .attr('target', '_blank') .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .text(t('login')) + .html(t('login')) .on('click.note-login', function() { d3_event.preventDefault(); osm.authenticate(); @@ -284,7 +284,7 @@ export function uiNoteEditor(context) { prose = prose.enter() .append('p') .attr('class', 'note-save-prose') - .text(t('note.upload_explanation')) + .html(t('note.upload_explanation')) .merge(prose); osm.userDetails(function(err, user) { @@ -302,7 +302,7 @@ export function uiNoteEditor(context) { userLink .append('a') .attr('class', 'user-info') - .text(user.display_name) + .html(user.display_name) .attr('href', osm.userURL(user.display_name)) .attr('tabindex', -1) .attr('target', '_blank'); @@ -334,12 +334,12 @@ export function uiNoteEditor(context) { buttonEnter .append('button') .attr('class', 'button cancel-button secondary-action') - .text(t('confirm.cancel')); + .html(t('confirm.cancel')); buttonEnter .append('button') .attr('class', 'button save-button action') - .text(t('note.save')); + .html(t('note.save')); } else { buttonEnter @@ -349,7 +349,7 @@ export function uiNoteEditor(context) { buttonEnter .append('button') .attr('class', 'button comment-button action') - .text(t('note.comment')); + .html(t('note.comment')); } @@ -366,7 +366,7 @@ export function uiNoteEditor(context) { buttonSection.select('.status-button') // select and propagate data .attr('disabled', (hasAuth ? null : true)) - .text(function(d) { + .html(function(d) { var action = (d.status === 'open' ? 'close' : 'open'); var andComment = (d.newComment ? '_comment' : ''); return t('note.' + action + andComment); diff --git a/modules/ui/note_header.js b/modules/ui/note_header.js index dc342c603..99b1d4c44 100644 --- a/modules/ui/note_header.js +++ b/modules/ui/note_header.js @@ -41,7 +41,7 @@ export function uiNoteHeader() { headerEnter .append('div') .attr('class', 'note-header-label') - .text(function(d) { + .html(function(d) { if (_note.isNew()) { return t('note.new'); } return t('note.note') + ' ' + d.id + ' ' + (d.status === 'closed' ? t('note.closed') : ''); diff --git a/modules/ui/note_report.js b/modules/ui/note_report.js index 56450b61c..64839c916 100644 --- a/modules/ui/note_report.js +++ b/modules/ui/note_report.js @@ -30,7 +30,7 @@ export function uiNoteReport() { linkEnter .append('span') - .text(t('note.report')); + .html(t('note.report')); } diff --git a/modules/ui/notice.js b/modules/ui/notice.js index a7944120e..64b4999c2 100644 --- a/modules/ui/notice.js +++ b/modules/ui/notice.js @@ -28,7 +28,7 @@ export function uiNotice(context) { .call(svgIcon('#iD-icon-plus', 'pre-text')) .append('span') .attr('class', 'label') - .text(t('zoom_in_edit')); + .html(t('zoom_in_edit')); function disableTooHigh() { diff --git a/modules/ui/osmose_details.js b/modules/ui/osmose_details.js index 739252187..ecc14e246 100644 --- a/modules/ui/osmose_details.js +++ b/modules/ui/osmose_details.js @@ -45,7 +45,7 @@ export function uiOsmoseDetails(context) { div .append('h4') - .text(() => t('QA.keepRight.detail_description')); + .html(() => t('QA.keepRight.detail_description')); div .append('p') @@ -73,7 +73,7 @@ export function uiOsmoseDetails(context) { div .append('h4') - .text(() => t('QA.osmose.fix_title')); + .html(() => t('QA.osmose.fix_title')); div .append('p') @@ -91,7 +91,7 @@ export function uiOsmoseDetails(context) { div .append('h4') - .text(() => t('QA.osmose.trap_title')); + .html(() => t('QA.osmose.trap_title')); div .append('p') @@ -118,7 +118,7 @@ export function uiOsmoseDetails(context) { if (d.detail) { detailsDiv .append('h4') - .text(() => t('QA.osmose.detail_title')); + .html(() => t('QA.osmose.detail_title')); detailsDiv .append('p') @@ -131,7 +131,7 @@ export function uiOsmoseDetails(context) { // Create list of linked issue elements elemsDiv .append('h4') - .text(() => t('QA.osmose.elems_title')); + .html(() => t('QA.osmose.elems_title')); elemsDiv .append('ul').selectAll('li') @@ -140,7 +140,7 @@ export function uiOsmoseDetails(context) { .append('li') .append('a') .attr('class', 'error_entity_link') - .text(d => d) + .html(d => d) .each(function() { const link = d3_select(this); const entityID = this.textContent; diff --git a/modules/ui/osmose_editor.js b/modules/ui/osmose_editor.js index 6423d23c1..bc7c7183b 100644 --- a/modules/ui/osmose_editor.js +++ b/modules/ui/osmose_editor.js @@ -35,7 +35,7 @@ export function uiOsmoseEditor(context) { headerEnter .append('h3') - .text(t('QA.osmose.title')); + .html(t('QA.osmose.title')); let body = selection.selectAll('.body') .data([0]); @@ -117,7 +117,7 @@ export function uiOsmoseEditor(context) { .merge(buttonEnter); buttonSection.select('.close-button') - .text(() => t('QA.keepRight.close')) + .html(() => t('QA.keepRight.close')) .on('click.close', function(d) { this.blur(); // avoid keeping focus on the button - #4641 const qaService = services.osmose; @@ -128,7 +128,7 @@ export function uiOsmoseEditor(context) { }); buttonSection.select('.ignore-button') - .text(() => t('QA.keepRight.ignore')) + .html(() => t('QA.keepRight.ignore')) .on('click.ignore', function(d) { this.blur(); // avoid keeping focus on the button - #4641 const qaService = services.osmose; diff --git a/modules/ui/osmose_header.js b/modules/ui/osmose_header.js index 5932a0438..8486df3a2 100644 --- a/modules/ui/osmose_header.js +++ b/modules/ui/osmose_header.js @@ -65,7 +65,7 @@ export function uiOsmoseHeader() { headerEnter .append('div') .attr('class', 'qa-header-label') - .text(issueTitle); + .html(issueTitle); } osmoseHeader.issue = function(val) { diff --git a/modules/ui/pane.js b/modules/ui/pane.js index b0eb839b3..4b00a0557 100644 --- a/modules/ui/pane.js +++ b/modules/ui/pane.js @@ -107,7 +107,7 @@ export function uiPane(id, context) { heading .append('h2') - .text(_title); + .html(_title); heading .append('button') diff --git a/modules/ui/panels/background.js b/modules/ui/panels/background.js index e5c52a2d5..b34451865 100644 --- a/modules/ui/panels/background.js +++ b/modules/ui/panels/background.js @@ -36,7 +36,7 @@ export function uiPanelBackground(context) { list .append('li') - .text(currSourceName); + .html(currSourceName); metadataKeys.forEach(function(k) { // DigitalGlobe vintage is available in raster layers for now. @@ -46,10 +46,10 @@ export function uiPanelBackground(context) { .append('li') .attr('class', 'background-info-list-' + k) .classed('hide', !metadata[k]) - .text(t('info_panels.background.' + k) + ':') + .html(t('info_panels.background.' + k) + ':') .append('span') .attr('class', 'background-info-span-' + k) - .text(metadata[k]); + .html(metadata[k]); }); debouncedGetMetadata(selection); @@ -58,7 +58,7 @@ export function uiPanelBackground(context) { selection .append('a') - .text(t('info_panels.background.' + toggleTiles)) + .html(t('info_panels.background.' + toggleTiles)) .attr('href', '#') .attr('class', 'button button-toggle-tiles') .on('click', function() { @@ -74,7 +74,7 @@ export function uiPanelBackground(context) { var toggleVintage = showsVintage ? 'hide_vintage' : 'show_vintage'; selection .append('a') - .text(t('info_panels.background.' + toggleVintage)) + .html(t('info_panels.background.' + toggleVintage)) .attr('href', '#') .attr('class', 'button button-toggle-vintage') .on('click', function() { @@ -113,7 +113,7 @@ export function uiPanelBackground(context) { selection.selectAll('.background-info-list-zoom') .classed('hide', false) .selectAll('.background-info-span-zoom') - .text(metadata.zoom); + .html(metadata.zoom); if (!d || !d.length >= 3) return; @@ -126,7 +126,7 @@ export function uiPanelBackground(context) { selection.selectAll('.background-info-list-vintage') .classed('hide', false) .selectAll('.background-info-span-vintage') - .text(metadata.vintage); + .html(metadata.vintage); // update other metadata metadataKeys.forEach(function(k) { @@ -136,7 +136,7 @@ export function uiPanelBackground(context) { selection.selectAll('.background-info-list-' + k) .classed('hide', !val) .selectAll('.background-info-span-' + k) - .text(val); + .html(val); }); }); } @@ -163,7 +163,7 @@ export function uiPanelBackground(context) { panel.id = 'background'; panel.title = t('info_panels.background.title'); - panel.key = t('info_panels.background.key'); + panel.key = t('info_panels.background.key', { html: false }); return panel; diff --git a/modules/ui/panels/history.js b/modules/ui/panels/history.js index 6ba0eea1f..a3c22a404 100644 --- a/modules/ui/panels/history.js +++ b/modules/ui/panels/history.js @@ -21,14 +21,14 @@ export function uiPanelHistory(context) { if (!userName) { selection .append('span') - .text(t('info_panels.history.unknown')); + .html(t('info_panels.history.unknown')); return; } selection .append('span') .attr('class', 'user-name') - .text(userName); + .html(userName); var links = selection .append('div') @@ -41,7 +41,7 @@ export function uiPanelHistory(context) { .attr('href', osm.userURL(userName)) .attr('target', '_blank') .attr('tabindex', -1) - .text('OSM'); + .html('OSM'); } links @@ -50,7 +50,7 @@ export function uiPanelHistory(context) { .attr('href', 'https://hdyc.neis-one.org/?' + userName) .attr('target', '_blank') .attr('tabindex', -1) - .text('HDYC'); + .html('HDYC'); } @@ -58,14 +58,14 @@ export function uiPanelHistory(context) { if (!changeset) { selection .append('span') - .text(t('info_panels.history.unknown')); + .html(t('info_panels.history.unknown')); return; } selection .append('span') .attr('class', 'changeset-id') - .text(changeset); + .html(changeset); var links = selection .append('div') @@ -78,7 +78,7 @@ export function uiPanelHistory(context) { .attr('href', osm.changesetURL(changeset)) .attr('target', '_blank') .attr('tabindex', -1) - .text('OSM'); + .html('OSM'); } links @@ -87,7 +87,7 @@ export function uiPanelHistory(context) { .attr('href', 'https://osmcha.org/changesets/' + changeset) .attr('target', '_blank') .attr('tabindex', -1) - .text('OSMCha'); + .html('OSMCha'); links .append('a') @@ -95,7 +95,7 @@ export function uiPanelHistory(context) { .attr('href', 'https://overpass-api.de/achavi/?changeset=' + changeset) .attr('target', '_blank') .attr('tabindex', -1) - .text('Achavi'); + .html('Achavi'); } @@ -122,7 +122,7 @@ export function uiPanelHistory(context) { selection .append('h4') .attr('class', 'history-heading') - .text(singular || t('info_panels.selected', { n: selected.length })); + .html(singular || t('info_panels.selected', { n: selected.length })); if (!singular) return; @@ -138,7 +138,7 @@ export function uiPanelHistory(context) { if (!note || note.isNew()) { selection .append('div') - .text(t('info_panels.history.note_no_history')); + .html(t('info_panels.history.note_no_history')); return; } @@ -147,20 +147,20 @@ export function uiPanelHistory(context) { list .append('li') - .text(t('info_panels.history.note_comments') + ':') + .html(t('info_panels.history.note_comments') + ':') .append('span') - .text(note.comments.length); + .html(note.comments.length); if (note.comments.length) { list .append('li') - .text(t('info_panels.history.note_created_date') + ':') + .html(t('info_panels.history.note_created_date') + ':') .append('span') - .text(displayTimestamp(note.comments[0].date)); + .html(displayTimestamp(note.comments[0].date)); list .append('li') - .text(t('info_panels.history.note_created_user') + ':') + .html(t('info_panels.history.note_created_user') + ':') .call(displayUser, note.comments[0].user); } @@ -173,7 +173,7 @@ export function uiPanelHistory(context) { .attr('href', osm.noteURL(note)) .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .text(t('info_panels.history.note_link_text')); + .html(t('info_panels.history.note_link_text')); } } @@ -182,7 +182,7 @@ export function uiPanelHistory(context) { if (!entity || entity.isNew()) { selection .append('div') - .text(t('info_panels.history.no_history')); + .html(t('info_panels.history.no_history')); return; } @@ -197,8 +197,8 @@ export function uiPanelHistory(context) { .attr('href', osm.historyURL(entity)) .attr('target', '_blank') .attr('tabindex', -1) - .attr('title', t('info_panels.history.link_text')) - .text('OSM'); + .attr('title', t('info_panels.history.link_text', { html: false })) + .html('OSM'); } links .append('a') @@ -206,31 +206,31 @@ export function uiPanelHistory(context) { .attr('href', 'https://pewu.github.io/osm-history/#/' + entity.type + '/' + entity.osmId()) .attr('target', '_blank') .attr('tabindex', -1) - .text('PeWu'); + .html('PeWu'); var list = selection .append('ul'); list .append('li') - .text(t('info_panels.history.version') + ':') + .html(t('info_panels.history.version') + ':') .append('span') - .text(entity.version); + .html(entity.version); list .append('li') - .text(t('info_panels.history.last_edit') + ':') + .html(t('info_panels.history.last_edit') + ':') .append('span') - .text(displayTimestamp(entity.timestamp)); + .html(displayTimestamp(entity.timestamp)); list .append('li') - .text(t('info_panels.history.edited_by') + ':') + .html(t('info_panels.history.edited_by') + ':') .call(displayUser, entity.user); list .append('li') - .text(t('info_panels.history.changeset') + ':') + .html(t('info_panels.history.changeset') + ':') .call(displayChangeset, entity.changeset); } @@ -256,7 +256,7 @@ export function uiPanelHistory(context) { panel.id = 'history'; panel.title = t('info_panels.history.title'); - panel.key = t('info_panels.history.key'); + panel.key = t('info_panels.history.key', { html: false }); return panel; diff --git a/modules/ui/panels/location.js b/modules/ui/panels/location.js index 21a7ae14f..50948363e 100644 --- a/modules/ui/panels/location.js +++ b/modules/ui/panels/location.js @@ -23,15 +23,15 @@ export function uiPanelLocation(context) { list .append('li') - .text(dmsCoordinatePair(coord)) + .html(dmsCoordinatePair(coord)) .append('li') - .text(decimalCoordinatePair(coord)); + .html(decimalCoordinatePair(coord)); // Location Info selection .append('div') .attr('class', 'location-info') - .text(currLocation || ' '); + .html(currLocation || ' '); debouncedGetLocation(selection, coord); } @@ -42,12 +42,12 @@ export function uiPanelLocation(context) { if (!services.geocoder) { currLocation = t('info_panels.location.unknown_location'); selection.selectAll('.location-info') - .text(currLocation); + .html(currLocation); } else { services.geocoder.reverse(coord, function(err, result) { currLocation = result ? result.display_name : t('info_panels.location.unknown_location'); selection.selectAll('.location-info') - .text(currLocation); + .html(currLocation); }); } } @@ -69,7 +69,7 @@ export function uiPanelLocation(context) { panel.id = 'location'; panel.title = t('info_panels.location.title'); - panel.key = t('info_panels.location.key'); + panel.key = t('info_panels.location.key', { html: false }); return panel; diff --git a/modules/ui/panels/measurement.js b/modules/ui/panels/measurement.js index dc50df1b0..4ef63dfe0 100644 --- a/modules/ui/panels/measurement.js +++ b/modules/ui/panels/measurement.js @@ -110,7 +110,7 @@ export function uiPanelMeasurement(context) { selection .append('h4') .attr('class', 'measurement-heading') - .text(heading); + .html(heading); } var list = selection @@ -120,9 +120,9 @@ export function uiPanelMeasurement(context) { if (geometry) { list .append('li') - .text(t('info_panels.measurement.geometry') + ':') + .html(t('info_panels.measurement.geometry') + ':') .append('span') - .text( + .html( closed ? t('info_panels.measurement.closed_' + geometry) : t('geometry.' + geometry) ); } @@ -130,63 +130,63 @@ export function uiPanelMeasurement(context) { if (totalNodeCount) { list .append('li') - .text(t('info_panels.measurement.node_count') + ':') + .html(t('info_panels.measurement.node_count') + ':') .append('span') - .text(totalNodeCount.toLocaleString(localeCode)); + .html(totalNodeCount.toLocaleString(localeCode)); } if (area) { list .append('li') - .text(t('info_panels.measurement.area') + ':') + .html(t('info_panels.measurement.area') + ':') .append('span') - .text(displayArea(area, isImperial)); + .html(displayArea(area, isImperial)); } if (length) { var lengthLabel = t('info_panels.measurement.' + (closed ? 'perimeter' : 'length')); list .append('li') - .text(lengthLabel + ':') + .html(lengthLabel + ':') .append('span') - .text(displayLength(length, isImperial)); + .html(displayLength(length, isImperial)); } if (location) { coordItem = list .append('li') - .text(t('info_panels.measurement.location') + ':'); + .html(t('info_panels.measurement.location') + ':'); coordItem.append('span') - .text(dmsCoordinatePair(location)); + .html(dmsCoordinatePair(location)); coordItem.append('span') - .text(decimalCoordinatePair(location)); + .html(decimalCoordinatePair(location)); } if (centroid) { coordItem = list .append('li') - .text(t('info_panels.measurement.centroid') + ':'); + .html(t('info_panels.measurement.centroid') + ':'); coordItem.append('span') - .text(dmsCoordinatePair(centroid)); + .html(dmsCoordinatePair(centroid)); coordItem.append('span') - .text(decimalCoordinatePair(centroid)); + .html(decimalCoordinatePair(centroid)); } if (center) { coordItem = list .append('li') - .text(t('info_panels.measurement.center') + ':'); + .html(t('info_panels.measurement.center') + ':'); coordItem.append('span') - .text(dmsCoordinatePair(center)); + .html(dmsCoordinatePair(center)); coordItem.append('span') - .text(decimalCoordinatePair(center)); + .html(decimalCoordinatePair(center)); } if (length || area) { var toggle = isImperial ? 'imperial' : 'metric'; selection .append('a') - .text(t('info_panels.measurement.' + toggle)) + .html(t('info_panels.measurement.' + toggle)) .attr('href', '#') .attr('class', 'button button-toggle-units') .on('click', function() { @@ -219,7 +219,7 @@ export function uiPanelMeasurement(context) { panel.id = 'measurement'; panel.title = t('info_panels.measurement.title'); - panel.key = t('info_panels.measurement.key'); + panel.key = t('info_panels.measurement.key', { html: false }); return panel; diff --git a/modules/ui/panes/background.js b/modules/ui/panes/background.js index 3310c7b9e..e66eb506f 100644 --- a/modules/ui/panes/background.js +++ b/modules/ui/panes/background.js @@ -10,7 +10,7 @@ import { uiSectionOverlayList } from '../sections/overlay_list'; export function uiPaneBackground(context) { var backgroundPane = uiPane('background', context) - .key(t('background.key')) + .key(t('background.key', { html: false })) .title(t('background.title')) .description(t('background.description')) .iconName('iD-icon-layers') diff --git a/modules/ui/panes/help.js b/modules/ui/panes/help.js index a77ef0c81..4fd2f6356 100644 --- a/modules/ui/panes/help.js +++ b/modules/ui/panes/help.js @@ -255,7 +255,7 @@ export function uiPaneHelp(context) { }); var helpPane = uiPane('help', context) - .key(t('help.key')) + .key(t('help.key', { html: false })) .title(t('help.title')) .description(t('help.title')) .iconName('iD-icon-help'); @@ -293,7 +293,7 @@ export function uiPaneHelp(context) { nextLink .append('span') - .text(docs[i + 1].title) + .html(docs[i + 1].title) .call(svgIcon((rtl ? '#iD-icon-backward' : '#iD-icon-forward'), 'inline')); } } @@ -311,7 +311,7 @@ export function uiPaneHelp(context) { prevLink .call(svgIcon((rtl ? '#iD-icon-forward' : '#iD-icon-backward'), 'inline')) .append('span') - .text(docs[i - 1].title); + .html(docs[i - 1].title); } } } @@ -353,7 +353,7 @@ export function uiPaneHelp(context) { shortcuts .append('div') - .text(t('shortcuts.title')); + .html(t('shortcuts.title')); var walkthrough = toc .append('li') @@ -369,7 +369,7 @@ export function uiPaneHelp(context) { walkthrough .append('div') - .text(t('splash.walkthrough')); + .html(t('splash.walkthrough')); var helpContent = content diff --git a/modules/ui/panes/issues.js b/modules/ui/panes/issues.js index 6d7dd2b00..99af16ca6 100644 --- a/modules/ui/panes/issues.js +++ b/modules/ui/panes/issues.js @@ -10,7 +10,7 @@ import { uiSectionValidationStatus } from '../sections/validation_status'; export function uiPaneIssues(context) { var issuesPane = uiPane('issues', context) - .key(t('issues.key')) + .key(t('issues.key', { html: false })) .title(t('issues.title')) .description(t('issues.title')) .iconName('iD-icon-alert') diff --git a/modules/ui/panes/map_data.js b/modules/ui/panes/map_data.js index de2eae909..db71f4f04 100644 --- a/modules/ui/panes/map_data.js +++ b/modules/ui/panes/map_data.js @@ -10,7 +10,7 @@ import { uiSectionPhotoOverlays } from '../sections/photo_overlays'; export function uiPaneMapData(context) { var mapDataPane = uiPane('map-data', context) - .key(t('map_data.key')) + .key(t('map_data.key', { html: false })) .title(t('map_data.title')) .description(t('map_data.description')) .iconName('iD-icon-data') diff --git a/modules/ui/panes/preferences.js b/modules/ui/panes/preferences.js index 78bc33af8..d48d23870 100644 --- a/modules/ui/panes/preferences.js +++ b/modules/ui/panes/preferences.js @@ -6,7 +6,7 @@ import { uiSectionPrivacy } from '../sections/privacy'; export function uiPanePreferences(context) { let preferencesPane = uiPane('preferences', context) - .key(t('preferences.key')) + .key(t('preferences.key', { html: false })) .title(t('preferences.title')) .description(t('preferences.description')) .iconName('fas-user-cog') diff --git a/modules/ui/preset_list.js b/modules/ui/preset_list.js index 3616f09c0..4cee38deb 100644 --- a/modules/ui/preset_list.js +++ b/modules/ui/preset_list.js @@ -38,7 +38,7 @@ export function uiPresetList(context) { var message = messagewrap .append('h3') - .text(t('inspector.choose')); + .html(t('inspector.choose')); messagewrap .append('button') @@ -110,7 +110,7 @@ export function uiPresetList(context) { messageText = t('inspector.choose'); } list.call(drawList, results); - message.text(messageText); + message.html(messageText); } var searchWrap = selection @@ -123,7 +123,7 @@ export function uiPresetList(context) { var search = searchWrap .append('input') .attr('class', 'preset-search-input') - .attr('placeholder', t('inspector.search')) + .attr('placeholder', t('inspector.search', { html: false })) .attr('type', 'search') .call(utilNoAuto) .on('keydown', initialKeydown) @@ -392,7 +392,7 @@ export function uiPresetList(context) { .enter() .append('div') .attr('class', 'namepart') - .text(function(d) { return d; }); + .html(function(d) { return d; }); wrap.call(item.reference.button); selection.call(item.reference.body); diff --git a/modules/ui/restore.js b/modules/ui/restore.js index 3e464cea3..f326eb374 100644 --- a/modules/ui/restore.js +++ b/modules/ui/restore.js @@ -17,13 +17,13 @@ export function uiRestore(context) { .append('div') .attr('class', 'modal-section') .append('h3') - .text(t('restore.heading')); + .html(t('restore.heading')); introModal .append('div') .attr('class','modal-section') .append('p') - .text(t('restore.description')); + .html(t('restore.description')); let buttonWrap = introModal .append('div') @@ -45,7 +45,7 @@ export function uiRestore(context) { restore .append('div') - .text(t('restore.restore')); + .html(t('restore.restore')); let reset = buttonWrap .append('button') @@ -63,7 +63,7 @@ export function uiRestore(context) { reset .append('div') - .text(t('restore.reset')); + .html(t('restore.reset')); restore.node().focus(); }; diff --git a/modules/ui/scale.js b/modules/ui/scale.js index c558e7ee4..40c7d0a80 100644 --- a/modules/ui/scale.js +++ b/modules/ui/scale.js @@ -55,7 +55,7 @@ export function uiScale(context) { selection.select('.scale-text') .style(localizer.textDirection() === 'ltr' ? 'left' : 'right', (scale.px + 16) + 'px') - .text(scale.text); + .html(scale.text); } diff --git a/modules/ui/sections/background_display_options.js b/modules/ui/sections/background_display_options.js index 03bfb9c26..21bec3a8a 100644 --- a/modules/ui/sections/background_display_options.js +++ b/modules/ui/sections/background_display_options.js @@ -70,7 +70,7 @@ export function uiSectionBackgroundDisplayOptions(context) { slidersEnter .append('h5') - .text(function(d) { return t('background.' + d); }) + .html(function(d) { return t('background.' + d); }) .append('span') .attr('class', function(d) { return 'display-option-value display-option-value-' + d; }); @@ -92,7 +92,7 @@ export function uiSectionBackgroundDisplayOptions(context) { sildersControlEnter .append('button') - .attr('title', t('background.reset')) + .attr('title', t('background.reset', { html: false })) .attr('class', function(d) { return 'display-option-reset display-option-reset-' + d; }) .on('click', function(d) { if (d3_event.button !== 0) return; @@ -105,7 +105,7 @@ export function uiSectionBackgroundDisplayOptions(context) { .append('a') .attr('class', 'display-option-resetlink') .attr('href', '#') - .text(t('background.reset_all')) + .html(t('background.reset_all')) .on('click', function() { for (var i = 0; i < _sliders.length; i++) { updateValue(_sliders[i],1); @@ -120,7 +120,7 @@ export function uiSectionBackgroundDisplayOptions(context) { .property('value', function(d) { return _options[d]; }); container.selectAll('.display-option-value') - .text(function(d) { return Math.floor(_options[d] * 100) + '%'; }); + .html(function(d) { return Math.floor(_options[d] * 100) + '%'; }); container.selectAll('.display-option-reset') .classed('disabled', function(d) { return _options[d] === 1; }); diff --git a/modules/ui/sections/background_list.js b/modules/ui/sections/background_list.js index 63f9cfaff..f9cc79ae3 100644 --- a/modules/ui/sections/background_list.js +++ b/modules/ui/sections/background_list.js @@ -57,7 +57,7 @@ export function uiSectionBackgroundList(context) { .append('label') .call(uiTooltip() .title(t('background.minimap.tooltip')) - .keys([t('background.minimap.key')]) + .keys([t('background.minimap.key', { html: false })]) .placement('top') ); @@ -71,7 +71,7 @@ export function uiSectionBackgroundList(context) { minimapLabelEnter .append('span') - .text(t('background.minimap.description')); + .html(t('background.minimap.description')); var panelLabelEnter = bgExtrasListEnter @@ -80,7 +80,7 @@ export function uiSectionBackgroundList(context) { .append('label') .call(uiTooltip() .title(t('background.panel.tooltip')) - .keys([uiCmd('⌘⇧' + t('info_panels.background.key'))]) + .keys([uiCmd('⌘⇧' + t('info_panels.background.key', { html: false }))]) .placement('top') ); @@ -94,7 +94,7 @@ export function uiSectionBackgroundList(context) { panelLabelEnter .append('span') - .text(t('background.panel.description')); + .html(t('background.panel.description')); var locPanelLabelEnter = bgExtrasListEnter .append('li') @@ -102,7 +102,7 @@ export function uiSectionBackgroundList(context) { .append('label') .call(uiTooltip() .title(t('background.location_panel.tooltip')) - .keys([uiCmd('⌘⇧' + t('info_panels.location.key'))]) + .keys([uiCmd('⌘⇧' + t('info_panels.location.key', { html: false }))]) .placement('top') ); @@ -116,7 +116,7 @@ export function uiSectionBackgroundList(context) { locPanelLabelEnter .append('span') - .text(t('background.location_panel.description')); + .html(t('background.location_panel.description')); // "Info / Report a Problem" link @@ -130,7 +130,7 @@ export function uiSectionBackgroundList(context) { .call(svgIcon('#iD-icon-out-link', 'inline')) .attr('href', 'https://github.com/openstreetmap/iD/blob/develop/FAQ.md#how-can-i-report-an-issue-with-background-imagery') .append('span') - .text(t('background.imagery_problem_faq')); + .html(t('background.imagery_problem_faq')); _backgroundList .call(drawListItems, 'radio', chooseBackground, function(d) { return !d.isHidden() && !d.overlay; }); @@ -150,7 +150,7 @@ export function uiSectionBackgroundList(context) { item.call(uiTooltip() .placement(placement) .title('
' + t('background.switch') + '
') - .keys([uiCmd('⌘' + t('background.key'))]) + .keys([uiCmd('⌘' + t('background.key', { html: false }))]) ); } else if (description || isOverflowing) { item.call(uiTooltip() @@ -188,7 +188,7 @@ export function uiSectionBackgroundList(context) { label .append('span') - .text(function(d) { return d.name(); }); + .html(function(d) { return d.name(); }); enter.filter(function(d) { return d.id === 'custom'; }) .append('button') diff --git a/modules/ui/sections/background_offset.js b/modules/ui/sections/background_offset.js index cdd12fe28..219fe5874 100644 --- a/modules/ui/sections/background_offset.js +++ b/modules/ui/sections/background_offset.js @@ -161,7 +161,7 @@ export function uiSectionBackgroundOffset(context) { containerEnter .append('div') .attr('class', 'nudge-instructions') - .text(t('background.offset')); + .html(t('background.offset')); var nudgeEnter = containerEnter .append('div') @@ -189,7 +189,7 @@ export function uiSectionBackgroundOffset(context) { containerEnter .append('button') - .attr('title', t('background.reset')) + .attr('title', t('background.reset', { html: false })) .attr('class', 'nudge-reset disabled') .on('contextmenu', cancelEvent) .on('click', function() { diff --git a/modules/ui/sections/changes.js b/modules/ui/sections/changes.js index c30bfce35..9bb317e4f 100644 --- a/modules/ui/sections/changes.js +++ b/modules/ui/sections/changes.js @@ -68,12 +68,12 @@ export function uiSectionChanges(context) { itemsEnter .append('span') .attr('class', 'change-type') - .text(function(d) { return t('commit.' + d.changeType) + ' '; }); + .html(function(d) { return t('commit.' + d.changeType) + ' '; }); itemsEnter .append('strong') .attr('class', 'entity-type') - .text(function(d) { + .html(function(d) { var matched = presetManager.match(d.entity, d.graph); return (matched && matched.name()) || utilDisplayType(d.entity.id); }); @@ -81,7 +81,7 @@ export function uiSectionChanges(context) { itemsEnter .append('span') .attr('class', 'entity-name') - .text(function(d) { + .html(function(d) { var name = utilDisplayName(d.entity) || '', string = ''; if (name !== '') { @@ -136,7 +136,7 @@ export function uiSectionChanges(context) { linkEnter .call(svgIcon('#iD-icon-load', 'inline')) .append('span') - .text(t('commit.download_changes')); + .html(t('commit.download_changes')); function mouseover(d) { diff --git a/modules/ui/sections/data_layers.js b/modules/ui/sections/data_layers.js index e8a0d43b8..ac7185a16 100644 --- a/modules/ui/sections/data_layers.js +++ b/modules/ui/sections/data_layers.js @@ -97,7 +97,7 @@ export function uiSectionDataLayers(context) { d3_select(this) .call(uiTooltip() .title(t('map_data.layers.' + d.id + '.tooltip')) - .keys([uiCmd('⌥' + t('area_fill.wireframe.key'))]) + .keys([uiCmd('⌥' + t('area_fill.wireframe.key', { html: false }))]) .placement('bottom') ); } else { @@ -116,7 +116,7 @@ export function uiSectionDataLayers(context) { labelEnter .append('span') - .text(function(d) { return t('map_data.layers.' + d.id + '.title'); }); + .html(function(d) { return t('map_data.layers.' + d.id + '.title'); }); // Update @@ -167,7 +167,7 @@ export function uiSectionDataLayers(context) { labelEnter .append('span') - .text(function(d) { return t('map_data.layers.' + d.id + '.title'); }); + .html(function(d) { return t('map_data.layers.' + d.id + '.title'); }); // Update @@ -218,7 +218,7 @@ export function uiSectionDataLayers(context) { containerEnter .append('h4') .attr('class', 'vectortile-header') - .text('Detroit Vector Tiles (Beta)'); + .html('Detroit Vector Tiles (Beta)'); containerEnter .append('ul') @@ -233,7 +233,7 @@ export function uiSectionDataLayers(context) { .call(svgIcon('#iD-icon-out-link', 'inline')) .attr('href', 'https://github.com/osmus/detroit-mapping-challenge') .append('span') - .text('About these layers'); + .html('About these layers'); container = container .merge(containerEnter); @@ -267,7 +267,7 @@ export function uiSectionDataLayers(context) { labelEnter .append('span') - .text(function(d) { return d.name; }); + .html(function(d) { return d.name; }); // Update li @@ -326,7 +326,7 @@ export function uiSectionDataLayers(context) { labelEnter .append('span') - .text(t('map_data.layers.custom.title')); + .html(t('map_data.layers.custom.title')); liEnter .append('button') @@ -394,7 +394,7 @@ export function uiSectionDataLayers(context) { .append('label') .call(uiTooltip() .title(t('map_data.history_panel.tooltip')) - .keys([uiCmd('⌘⇧' + t('info_panels.history.key'))]) + .keys([uiCmd('⌘⇧' + t('info_panels.history.key', { html: false }))]) .placement('top') ); @@ -408,7 +408,7 @@ export function uiSectionDataLayers(context) { historyPanelLabelEnter .append('span') - .text(t('map_data.history_panel.title')); + .html(t('map_data.history_panel.title')); var measurementPanelLabelEnter = panelsListEnter .append('li') @@ -416,7 +416,7 @@ export function uiSectionDataLayers(context) { .append('label') .call(uiTooltip() .title(t('map_data.measurement_panel.tooltip')) - .keys([uiCmd('⌘⇧' + t('info_panels.measurement.key'))]) + .keys([uiCmd('⌘⇧' + t('info_panels.measurement.key', { html: false }))]) .placement('top') ); @@ -430,7 +430,7 @@ export function uiSectionDataLayers(context) { measurementPanelLabelEnter .append('span') - .text(t('map_data.measurement_panel.title')); + .html(t('map_data.measurement_panel.title')); } context.layers().on('change.uiSectionDataLayers', section.reRender); diff --git a/modules/ui/sections/entity_issues.js b/modules/ui/sections/entity_issues.js index 1f2a45228..dbfd0e4a6 100644 --- a/modules/ui/sections/entity_issues.js +++ b/modules/ui/sections/entity_issues.js @@ -112,7 +112,7 @@ export function uiSectionEntityIssues(context) { var infoButton = labelsEnter .append('button') .attr('class', 'issue-info-button') - .attr('title', t('icons.information')) + .attr('title', t('icons.information', { html: false })) .attr('tabindex', -1) .call(svgIcon('#iD-icon-inspect')); @@ -163,7 +163,7 @@ export function uiSectionEntityIssues(context) { .call(d.reference); } else { d3_select(this) - .text(t('inspector.no_documentation_key')); + .html(t('inspector.no_documentation_key')); } }); @@ -174,7 +174,7 @@ export function uiSectionEntityIssues(context) { .classed('active', function(d) { return d.id === _activeIssueID; }); containers.selectAll('.issue-message') - .text(function(d) { + .html(function(d) { return d.message(context); }); @@ -235,7 +235,7 @@ export function uiSectionEntityIssues(context) { fixesEnter .append('span') .attr('class', 'fix-message') - .text(function(d) { return d.title; }); + .html(function(d) { return d.title; }); fixesEnter.merge(fixes) .classed('actionable', function(d) { diff --git a/modules/ui/sections/feature_type.js b/modules/ui/sections/feature_type.js index 50dc45892..b080ee8d9 100644 --- a/modules/ui/sections/feature_type.js +++ b/modules/ui/sections/feature_type.js @@ -109,7 +109,7 @@ export function uiSectionFeatureType(context) { .enter() .append('div') .attr('class', 'namepart') - .text(function(d) { return d; }); + .html(function(d) { return d; }); } section.entityIDs = function(val) { diff --git a/modules/ui/sections/map_features.js b/modules/ui/sections/map_features.js index 2bed5cd18..7dd77058f 100644 --- a/modules/ui/sections/map_features.js +++ b/modules/ui/sections/map_features.js @@ -32,7 +32,7 @@ export function uiSectionMapFeatures(context) { .append('a') .attr('class', 'feature-list-link') .attr('href', '#') - .text(t('issues.enable_all')) + .html(t('issues.enable_all')) .on('click', function() { context.features().enableAll(); }); @@ -41,7 +41,7 @@ export function uiSectionMapFeatures(context) { .append('a') .attr('class', 'feature-list-link') .attr('href', '#') - .text(t('issues.disable_all')) + .html(t('issues.disable_all')) .on('click', function() { context.features().disableAll(); }); @@ -88,7 +88,7 @@ export function uiSectionMapFeatures(context) { label .append('span') - .text(function(d) { return t(name + '.' + d + '.description'); }); + .html(function(d) { return t(name + '.' + d + '.description'); }); // Update items = items diff --git a/modules/ui/sections/map_style_options.js b/modules/ui/sections/map_style_options.js index f22df182f..53cc70ca1 100644 --- a/modules/ui/sections/map_style_options.js +++ b/modules/ui/sections/map_style_options.js @@ -51,8 +51,8 @@ export function uiSectionMapStyleOptions(context) { return t(name + '.' + d + '.tooltip'); }) .keys(function(d) { - var key = (d === 'wireframe' ? t('area_fill.wireframe.key') : null); - if (d === 'highlight_edits') key = t('map_data.highlight_edits.key'); + var key = (d === 'wireframe' ? t('area_fill.wireframe.key', { html: false }) : null); + if (d === 'highlight_edits') key = t('map_data.highlight_edits.key', { html: false }); return key ? [key] : null; }) .placement('top') @@ -69,7 +69,7 @@ export function uiSectionMapStyleOptions(context) { label .append('span') - .text(function(d) { return t(name + '.' + d + '.description'); }); + .html(function(d) { return t(name + '.' + d + '.description'); }); // Update items = items diff --git a/modules/ui/sections/overlay_list.js b/modules/ui/sections/overlay_list.js index e93dba8f6..751480734 100644 --- a/modules/ui/sections/overlay_list.js +++ b/modules/ui/sections/overlay_list.js @@ -81,7 +81,7 @@ export function uiSectionOverlayList(context) { label .append('span') - .text(function(d) { return d.name(); }); + .html(function(d) { return d.name(); }); layerList.selectAll('li') diff --git a/modules/ui/sections/photo_overlays.js b/modules/ui/sections/photo_overlays.js index b3c83f2b2..a59432f5b 100644 --- a/modules/ui/sections/photo_overlays.js +++ b/modules/ui/sections/photo_overlays.js @@ -86,7 +86,7 @@ export function uiSectionPhotoOverlays(context) { labelEnter .append('span') - .text(function(d) { + .html(function(d) { var id = d.id; if (id === 'mapillary-signs') id = 'photo_overlays.traffic_signs'; return t(id.replace(/-/g, '_') + '.title'); @@ -151,7 +151,7 @@ export function uiSectionPhotoOverlays(context) { labelEnter .append('span') - .text(function(d) { + .html(function(d) { return t('photo_overlays.photo_type.' + d + '.title'); }); diff --git a/modules/ui/sections/privacy.js b/modules/ui/sections/privacy.js index bfe3f12b6..60298c3b1 100644 --- a/modules/ui/sections/privacy.js +++ b/modules/ui/sections/privacy.js @@ -45,7 +45,7 @@ export function uiSectionPrivacy(context) { thirdPartyIconsEnter .append('span') - .text(t('preferences.privacy.third_party_icons.description')); + .html(t('preferences.privacy.third_party_icons.description')); // Privacy Policy link @@ -59,7 +59,7 @@ export function uiSectionPrivacy(context) { .call(svgIcon('#iD-icon-out-link', 'inline')) .attr('href', 'https://github.com/openstreetmap/iD/blob/release/PRIVACY.md') .append('span') - .text(t('preferences.privacy.privacy_link')); + .html(t('preferences.privacy.privacy_link')); update(); diff --git a/modules/ui/sections/raw_member_editor.js b/modules/ui/sections/raw_member_editor.js index 1d08585c3..7ae500faf 100644 --- a/modules/ui/sections/raw_member_editor.js +++ b/modules/ui/sections/raw_member_editor.js @@ -187,7 +187,7 @@ export function uiSectionRawMemberEditor(context) { labelLink .append('span') .attr('class', 'member-entity-type') - .text(function(d) { + .html(function(d) { var matched = presetManager.match(d.member, context.graph()); return (matched && matched.name()) || utilDisplayType(d.member.id); }); @@ -195,19 +195,19 @@ export function uiSectionRawMemberEditor(context) { labelLink .append('span') .attr('class', 'member-entity-name') - .text(function(d) { return utilDisplayName(d.member); }); + .html(function(d) { return utilDisplayName(d.member); }); label .append('button') .attr('tabindex', -1) - .attr('title', t('icons.remove')) + .attr('title', t('icons.remove', { html: false })) .attr('class', 'remove member-delete') .call(svgIcon('#iD-operation-delete')); label .append('button') .attr('class', 'member-zoom') - .attr('title', t('icons.zoom_to')) + .attr('title', t('icons.zoom_to', { html: false })) .call(svgIcon('#iD-icon-framed-dot', 'monochrome')) .on('click', zoomToMember); @@ -219,17 +219,17 @@ export function uiSectionRawMemberEditor(context) { labelText .append('span') .attr('class', 'member-entity-type') - .text(t('inspector.' + d.type, { id: d.id })); + .html(t('inspector.' + d.type, { id: d.id })); labelText .append('span') .attr('class', 'member-entity-name') - .text(t('inspector.incomplete', { id: d.id })); + .html(t('inspector.incomplete', { id: d.id })); label .append('button') .attr('class', 'member-download') - .attr('title', t('icons.download')) + .attr('title', t('icons.download', { html: false })) .attr('tabindex', -1) .call(svgIcon('#iD-icon-load')) .on('click', downloadMember); @@ -247,7 +247,7 @@ export function uiSectionRawMemberEditor(context) { return d.domId; }) .property('type', 'text') - .attr('placeholder', t('inspector.role')) + .attr('placeholder', t('inspector.role', { html: false })) .call(utilNoAuto); if (taginfo) { diff --git a/modules/ui/sections/raw_membership_editor.js b/modules/ui/sections/raw_membership_editor.js index 077d1e9d3..b2cc26c59 100644 --- a/modules/ui/sections/raw_membership_editor.js +++ b/modules/ui/sections/raw_membership_editor.js @@ -262,7 +262,7 @@ export function uiSectionRawMembershipEditor(context) { labelLink .append('span') .attr('class', 'member-entity-type') - .text(function(d) { + .html(function(d) { var matched = presetManager.match(d.relation, context.graph()); return (matched && matched.name()) || t('inspector.relation'); }); @@ -270,7 +270,7 @@ export function uiSectionRawMembershipEditor(context) { labelLink .append('span') .attr('class', 'member-entity-name') - .text(function(d) { return utilDisplayName(d.relation); }); + .html(function(d) { return utilDisplayName(d.relation); }); labelEnter .append('button') @@ -282,7 +282,7 @@ export function uiSectionRawMembershipEditor(context) { labelEnter .append('button') .attr('class', 'member-zoom') - .attr('title', t('icons.zoom_to')) + .attr('title', t('icons.zoom_to', { html: false })) .call(svgIcon('#iD-icon-framed-dot', 'monochrome')) .on('click', zoomToRelation); @@ -297,7 +297,7 @@ export function uiSectionRawMembershipEditor(context) { return d.domId; }) .property('type', 'text') - .attr('placeholder', t('inspector.role')) + .attr('placeholder', t('inspector.role', { html: false })) .call(utilNoAuto) .property('value', function(d) { return d.member.role; }) .on('blur', changeRole) @@ -326,7 +326,7 @@ export function uiSectionRawMembershipEditor(context) { newLabelEnter .append('input') - .attr('placeholder', t('inspector.choose_relation')) + .attr('placeholder', t('inspector.choose_relation', { html: false })) .attr('type', 'text') .attr('class', 'member-entity-input') .call(utilNoAuto); @@ -349,7 +349,7 @@ export function uiSectionRawMembershipEditor(context) { .append('input') .attr('class', 'member-role') .property('type', 'text') - .attr('placeholder', t('inspector.role')) + .attr('placeholder', t('inspector.role', { html: false })) .call(utilNoAuto); // Update diff --git a/modules/ui/sections/raw_tag_editor.js b/modules/ui/sections/raw_tag_editor.js index bdb012542..956f7c890 100644 --- a/modules/ui/sections/raw_tag_editor.js +++ b/modules/ui/sections/raw_tag_editor.js @@ -89,7 +89,7 @@ export function uiSectionRawTagEditor(id, context) { .attr('class', function(d) { return 'raw-tag-option raw-tag-option-' + d.id + (_tagView === d.id ? ' selected' : ''); }) - .attr('title', function(d) { return t('icons.' + d.id); }) + .attr('title', function(d) { return t('icons.' + d.id, { html: false }); }) .on('click', function(d) { _tagView = d.id; prefs('raw-tag-editor-view', d.id); @@ -119,7 +119,7 @@ export function uiSectionRawTagEditor(id, context) { .append('textarea') .attr('class', 'tag-text' + (_tagView !== 'text' ? ' hide' : '')) .call(utilNoAuto) - .attr('placeholder', t('inspector.key_value')) + .attr('placeholder', t('inspector.key_value', { html: false })) .attr('spellcheck', 'false') .merge(textarea); @@ -206,7 +206,7 @@ export function uiSectionRawTagEditor(id, context) { .append('button') .attr('tabindex', -1) .attr('class', 'form-field-button remove') - .attr('title', t('icons.remove')) + .attr('title', t('icons.remove', { html: false })) .call(svgIcon('#iD-operation-delete')); @@ -258,7 +258,7 @@ export function uiSectionRawTagEditor(id, context) { return Array.isArray(d.value); }) .attr('placeholder', function(d) { - return typeof d.value === 'string' ? null : t('inspector.multiple_values'); + return typeof d.value === 'string' ? null : t('inspector.multiple_values', { html: false }); }) .call(utilGetSetValue, function(d) { return typeof d.value === 'string' ? d.value : ''; diff --git a/modules/ui/sections/selection_list.js b/modules/ui/sections/selection_list.js index e639ac009..23eaad67d 100644 --- a/modules/ui/sections/selection_list.js +++ b/modules/ui/sections/selection_list.js @@ -92,7 +92,7 @@ export function uiSectionSelectionList(context) { enter .append('button') .attr('class', 'close') - .attr('title', t('icons.deselect')) + .attr('title', t('icons.deselect', { html: false })) .on('click', deselectEntity) .call(svgIcon('#iD-icon-close')); @@ -119,10 +119,10 @@ export function uiSectionSelectionList(context) { }); items.selectAll('.entity-type') - .text(function(entity) { return presetManager.match(entity, context.graph()).name(); }); + .html(function(entity) { return presetManager.match(entity, context.graph()).name(); }); items.selectAll('.entity-name') - .text(function(d) { + .html(function(d) { // fetch latest entity var entity = context.entity(d.id); return utilDisplayName(entity); diff --git a/modules/ui/sections/validation_issues.js b/modules/ui/sections/validation_issues.js index 8effe2217..d0c7e6c23 100644 --- a/modules/ui/sections/validation_issues.js +++ b/modules/ui/sections/validation_issues.js @@ -124,7 +124,7 @@ export function uiSectionValidationIssues(id, severity, context) { d3_select(this) .append('button') - .attr('title', t('issues.fix_one.title')) + .attr('title', t('issues.fix_one.title', { html: false })) .datum(d.autoFix) // set button datum to the autofix .attr('class', 'autofix action') .on('click', function(d) { @@ -147,7 +147,7 @@ export function uiSectionValidationIssues(id, severity, context) { .order(); items.selectAll('.issue-message') - .text(function(d) { + .html(function(d) { return d.message(context); }); @@ -175,7 +175,7 @@ export function uiSectionValidationIssues(id, severity, context) { linkEnter .append('span') .attr('class', 'autofix-all-link-text') - .text(t('issues.fix_all.title')); + .html(t('issues.fix_all.title')); linkEnter .append('span') diff --git a/modules/ui/sections/validation_options.js b/modules/ui/sections/validation_options.js index 77fe5a4cf..c95cc4087 100644 --- a/modules/ui/sections/validation_options.js +++ b/modules/ui/sections/validation_options.js @@ -36,7 +36,7 @@ export function uiSectionValidationOptions(context) { optionsEnter .append('div') .attr('class', 'issues-option-title') - .text(function(d) { return t('issues.options.' + d.key + '.title'); }); + .html(function(d) { return t('issues.options.' + d.key + '.title'); }); var valuesEnter = optionsEnter.selectAll('label') .data(function(d) { @@ -55,7 +55,7 @@ export function uiSectionValidationOptions(context) { valuesEnter .append('span') - .text(function(d) { return t('issues.options.' + d.key + '.' + d.value); }); + .html(function(d) { return t('issues.options.' + d.key + '.' + d.value); }); } function getOptions() { diff --git a/modules/ui/sections/validation_rules.js b/modules/ui/sections/validation_rules.js index 2be50e261..25b0230d1 100644 --- a/modules/ui/sections/validation_rules.js +++ b/modules/ui/sections/validation_rules.js @@ -46,7 +46,7 @@ export function uiSectionValidationRules(context) { .append('a') .attr('class', 'issue-rules-link') .attr('href', '#') - .text(t('issues.enable_all')) + .html(t('issues.enable_all')) .on('click', function() { context.validator().disableRules([]); }); @@ -55,7 +55,7 @@ export function uiSectionValidationRules(context) { .append('a') .attr('class', 'issue-rules-link') .attr('href', '#') - .text(t('issues.disable_all')) + .html(t('issues.disable_all')) .on('click', function() { context.validator().disableRules(_ruleKeys); }); diff --git a/modules/ui/sections/validation_status.js b/modules/ui/sections/validation_status.js index 702b07b8f..87afef901 100644 --- a/modules/ui/sections/validation_status.js +++ b/modules/ui/sections/validation_status.js @@ -78,7 +78,7 @@ export function uiSectionValidationStatus(context) { .merge(resetIgnoredEnter); resetIgnored.select('a') - .text(t('issues.reset_ignored', { count: ignoredIssues.length.toString() })); + .html(t('issues.reset_ignored', { count: ignoredIssues.length.toString() })); resetIgnored.on('click', function() { context.validator().resetIgnoredIssues(); @@ -95,7 +95,7 @@ export function uiSectionValidationStatus(context) { var hiddenIssues = context.validator().getIssues(hiddenOpts); if (hiddenIssues.length) { selection.select('.box .details') - .text(t( + .html(t( 'issues.no_issues.hidden_issues.' + type, { count: hiddenIssues.length.toString() } )); @@ -103,7 +103,7 @@ export function uiSectionValidationStatus(context) { } } selection.select('.box .details') - .text(t('issues.no_issues.hidden_issues.none')); + .html(t('issues.no_issues.hidden_issues.none')); } var messageType; @@ -158,7 +158,7 @@ export function uiSectionValidationStatus(context) { } selection.select('.box .message') - .text(t('issues.no_issues.message.' + messageType)); + .html(t('issues.no_issues.message.' + messageType)); } diff --git a/modules/ui/settings/custom_background.js b/modules/ui/settings/custom_background.js index eb1902857..f277ef522 100644 --- a/modules/ui/settings/custom_background.js +++ b/modules/ui/settings/custom_background.js @@ -27,7 +27,7 @@ export function uiSettingsCustomBackground() { modal.select('.modal-section.header') .append('h3') - .text(t('settings.custom_background.header')); + .html(t('settings.custom_background.header')); var textSection = modal.select('.modal-section.message-text'); @@ -59,7 +59,7 @@ export function uiSettingsCustomBackground() { textSection .append('textarea') .attr('class', 'field-template') - .attr('placeholder', t('settings.custom_background.template.placeholder')) + .attr('placeholder', t('settings.custom_background.template.placeholder', { html: false })) .call(utilNoAuto) .property('value', _currSettings.template); @@ -70,7 +70,7 @@ export function uiSettingsCustomBackground() { buttonSection .insert('button', '.ok-button') .attr('class', 'button cancel-button secondary-action') - .text(t('confirm.cancel')); + .html(t('confirm.cancel')); buttonSection.select('.cancel-button') diff --git a/modules/ui/settings/custom_data.js b/modules/ui/settings/custom_data.js index 923305928..b1cf7390f 100644 --- a/modules/ui/settings/custom_data.js +++ b/modules/ui/settings/custom_data.js @@ -31,7 +31,7 @@ export function uiSettingsCustomData(context) { modal.select('.modal-section.header') .append('h3') - .text(t('settings.custom_data.header')); + .html(t('settings.custom_data.header')); var textSection = modal.select('.modal-section.message-text'); @@ -39,7 +39,7 @@ export function uiSettingsCustomData(context) { textSection .append('pre') .attr('class', 'instructions-file') - .text(t('settings.custom_data.file.instructions')); + .html(t('settings.custom_data.file.instructions')); textSection .append('input') @@ -59,17 +59,17 @@ export function uiSettingsCustomData(context) { textSection .append('h4') - .text(t('settings.custom_data.or')); + .html(t('settings.custom_data.or')); textSection .append('pre') .attr('class', 'instructions-url') - .text(t('settings.custom_data.url.instructions')); + .html(t('settings.custom_data.url.instructions')); textSection .append('textarea') .attr('class', 'field-url') - .attr('placeholder', t('settings.custom_data.url.placeholder')) + .attr('placeholder', t('settings.custom_data.url.placeholder', { html: false })) .call(utilNoAuto) .property('value', _currSettings.url); @@ -80,7 +80,7 @@ export function uiSettingsCustomData(context) { buttonSection .insert('button', '.ok-button') .attr('class', 'button cancel-button secondary-action') - .text(t('confirm.cancel')); + .html(t('confirm.cancel')); buttonSection.select('.cancel-button') diff --git a/modules/ui/shortcuts.js b/modules/ui/shortcuts.js index 461268280..5e7d0b33c 100644 --- a/modules/ui/shortcuts.js +++ b/modules/ui/shortcuts.js @@ -17,7 +17,7 @@ export function uiShortcuts(context) { context.keybinding() - .on([t('shortcuts.toggle.key'), '?'], function () { + .on([t('shortcuts.toggle.key', { html: false }), '?'], function () { if (context.container().selectAll('.modal-shortcuts').size()) { // already showing if (_modalSelection) { _modalSelection.close(); @@ -40,7 +40,7 @@ export function uiShortcuts(context) { .append('div') .attr('class', 'modal-section') .append('h3') - .text(t('shortcuts.title')); + .html(t('shortcuts.title')); fileFetcher.get('shortcuts') .then(function(data) { content.call(render, data); }) @@ -83,7 +83,7 @@ export function uiShortcuts(context) { tabsEnter .append('span') - .text(function (d) { return t(d.text); }); + .html(function (d) { return t(d.text); }); tabs = tabs .merge(tabsEnter); @@ -129,7 +129,7 @@ export function uiShortcuts(context) { .append('td') .attr('class', 'shortcut-section') .append('h3') - .text(function (d) { return t(d.text); }); + .html(function (d) { return t(d.text); }); var shortcutRows = rowsEnter @@ -160,11 +160,11 @@ export function uiShortcuts(context) { selection .append('kbd') .attr('class', 'modifier') - .text(function (d) { return uiCmd.display(d); }); + .html(function (d) { return uiCmd.display(d); }); selection .append('span') - .text('+'); + .html('+'); }); @@ -209,17 +209,17 @@ export function uiShortcuts(context) { selection .append('kbd') .attr('class', 'shortcut') - .text(function (d) { return d.shortcut; }); + .html(function (d) { return d.shortcut; }); } if (i < nodes.length - 1) { selection .append('span') - .text(d.separator || '\u00a0' + t('shortcuts.or') + '\u00a0'); + .html(d.separator || '\u00a0' + t('shortcuts.or') + '\u00a0'); } else if (i === nodes.length - 1 && d.suffix) { selection .append('span') - .text(d.suffix); + .html(d.suffix); } }); @@ -231,19 +231,19 @@ export function uiShortcuts(context) { selection .append('span') - .text('+'); + .html('+'); selection .append('span') .attr('class', 'gesture') - .text(function (d) { return t(d.gesture); }); + .html(function (d) { return t(d.gesture); }); }); shortcutRows .append('td') .attr('class', 'shortcut-desc') - .text(function (d) { return d.text ? t(d.text) : '\u00a0'; }); + .html(function (d) { return d.text ? t(d.text) : '\u00a0'; }); shortcuts = shortcuts diff --git a/modules/ui/source_switch.js b/modules/ui/source_switch.js index ebd94ad85..6ea6cfb78 100644 --- a/modules/ui/source_switch.js +++ b/modules/ui/source_switch.js @@ -31,7 +31,7 @@ export function uiSourceSwitch(context) { context.flush(); // remove stored data d3_select(this) - .text(isLive ? t('source_switch.live') : t('source_switch.dev')) + .html(isLive ? t('source_switch.live') : t('source_switch.dev')) .classed('live', isLive) .classed('chip', isLive); @@ -42,7 +42,7 @@ export function uiSourceSwitch(context) { selection .append('a') .attr('href', '#') - .text(t('source_switch.live')) + .html(t('source_switch.live')) .attr('class', 'live chip') .on('click', click); }; diff --git a/modules/ui/splash.js b/modules/ui/splash.js index 5d8fbca38..8eddd22e3 100644 --- a/modules/ui/splash.js +++ b/modules/ui/splash.js @@ -42,7 +42,7 @@ export function uiSplash(context) { .append('div') .attr('class','modal-section') .append('h3') - .text(t('splash.welcome')); + .html(t('splash.welcome')); let modalSection = introModal .append('div') @@ -84,7 +84,7 @@ export function uiSplash(context) { walkthrough .append('div') - .text(t('splash.walkthrough')); + .html(t('splash.walkthrough')); let startEditing = buttonWrap .append('button') @@ -99,7 +99,7 @@ export function uiSplash(context) { startEditing .append('div') - .text(t('splash.start')); + .html(t('splash.start')); modalSelection.select('button.close') .attr('class','hide'); diff --git a/modules/ui/status.js b/modules/ui/status.js index 3f33d1e24..8c93f6688 100644 --- a/modules/ui/status.js +++ b/modules/ui/status.js @@ -23,13 +23,13 @@ export function uiStatus(context) { } else if (apiStatus === 'rateLimited') { selection - .text(t('osm_api_status.message.rateLimit')) + .html(t('osm_api_status.message.rateLimit')) .append('a') .attr('class', 'api-status-login') .attr('target', '_blank') .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .text(t('login')) + .html(t('login')) .on('click.login', function() { d3_event.preventDefault(); osm.authenticate(); @@ -47,10 +47,10 @@ export function uiStatus(context) { // eslint-disable-next-line no-warning-comments // TODO: nice messages for different error types selection - .text(t('osm_api_status.message.error') + ' ') + .html(t('osm_api_status.message.error') + ' ') .append('a') // let the user manually retry their connection directly - .text(t('osm_api_status.retry')) + .html(t('osm_api_status.retry')) .on('click.retry', function() { d3_event.preventDefault(); throttledRetry(); @@ -58,9 +58,9 @@ export function uiStatus(context) { } } else if (apiStatus === 'readonly') { - selection.text(t('osm_api_status.message.readonly')); + selection.html(t('osm_api_status.message.readonly')); } else if (apiStatus === 'offline') { - selection.text(t('osm_api_status.message.offline')); + selection.html(t('osm_api_status.message.offline')); } selection.attr('class', 'api-status ' + (err ? 'error' : apiStatus)); diff --git a/modules/ui/success.js b/modules/ui/success.js index 46454d7e2..e2c5a62da 100644 --- a/modules/ui/success.js +++ b/modules/ui/success.js @@ -74,7 +74,7 @@ export function uiSuccess(context) { header .append('h3') - .text(t('success.just_edited')); + .html(t('success.just_edited')); header .append('button') @@ -92,11 +92,11 @@ export function uiSuccess(context) { summary .append('h3') - .text(t('success.thank_you' + (_location ? '_location' : ''), { where: _location })); + .html(t('success.thank_you' + (_location ? '_location' : ''), { where: _location })); summary .append('p') - .text(t('success.help_html')) + .html(t('success.help_html')) .append('a') .attr('class', 'link-out') .attr('target', '_blank') @@ -104,7 +104,7 @@ export function uiSuccess(context) { .attr('href', t('success.help_link_url')) .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .text(t('success.help_link_text')); + .html(t('success.help_link_text')); let osm = context.connection(); if (!osm) return; @@ -139,7 +139,7 @@ export function uiSuccess(context) { .attr('class', 'cell-detail summary-view-on-osm') .attr('target', '_blank') .attr('href', changesetURL) - .text(t('success.view_on_osm')); + .html(t('success.view_on_osm')); summaryDetail .append('div') @@ -183,7 +183,7 @@ export function uiSuccess(context) { communityLinks .append('h3') - .text(t('success.like_osm')); + .html(t('success.like_osm')); let table = communityLinks .append('table') @@ -217,7 +217,7 @@ export function uiSuccess(context) { communityLinks .append('div') .attr('class', 'community-missing') - .text(t('success.missing')) + .html(t('success.missing')) .append('a') .attr('class', 'link-out') .attr('target', '_blank') @@ -225,7 +225,7 @@ export function uiSuccess(context) { .call(svgIcon('#iD-icon-out-link', 'inline')) .attr('href', 'https://github.com/osmlab/osm-community-index/issues') .append('span') - .text(t('success.tell_us')); + .html(t('success.tell_us')); } @@ -243,7 +243,7 @@ export function uiSuccess(context) { .append('a') .attr('target', '_blank') .attr('href', d.url) - .text(t(`community.${d.id}.name`)); + .html(t(`community.${d.id}.name`)); let descriptionHTML = t(`community.${d.id}.description`, replacements); @@ -295,7 +295,7 @@ export function uiSuccess(context) { .select('.hide-toggle') .append('span') .attr('class', 'badge-text') - .text(nextEvents.length); + .html(nextEvents.length); } @@ -322,7 +322,7 @@ export function uiSuccess(context) { moreEnter .append('div') .attr('class', 'community-languages') - .text(t('success.languages', { languages: languageList })); + .html(t('success.languages', { languages: languageList })); } } @@ -345,7 +345,7 @@ export function uiSuccess(context) { .append('a') .attr('target', '_blank') .attr('href', d => d.url) - .text(d => { + .html(d => { let name = d.name; if (d.i18n && d.id) { name = t(`community.${communityID}.events.${d.id}.name`, { default: name }); @@ -356,7 +356,7 @@ export function uiSuccess(context) { itemEnter .append('div') .attr('class', 'community-event-when') - .text(d => { + .html(d => { let options = { weekday: 'short', day: 'numeric', month: 'short', year: 'numeric' }; if (d.date.getHours() || d.date.getMinutes()) { // include time if it has one options.hour = 'numeric'; @@ -368,7 +368,7 @@ export function uiSuccess(context) { itemEnter .append('div') .attr('class', 'community-event-where') - .text(d => { + .html(d => { let where = d.where; if (d.i18n && d.id) { where = t(`community.${communityID}.events.${d.id}.where`, { default: where }); @@ -379,7 +379,7 @@ export function uiSuccess(context) { itemEnter .append('div') .attr('class', 'community-event-description') - .text(d => { + .html(d => { let description = d.description; if (d.i18n && d.id) { description = t(`community.${communityID}.events.${d.id}.description`, { default: description }); diff --git a/modules/ui/tag_reference.js b/modules/ui/tag_reference.js index fafaeb70f..a81761291 100644 --- a/modules/ui/tag_reference.js +++ b/modules/ui/tag_reference.js @@ -45,7 +45,7 @@ export function uiTagReference(what) { _body .append('p') .attr('class', 'tag-reference-description') - .text(t('inspector.no_documentation_key')); + .html(t('inspector.no_documentation_key')); done(); return; } @@ -64,12 +64,12 @@ export function uiTagReference(what) { _body .append('p') .attr('class', 'tag-reference-description') - .text(docs.description || t('inspector.no_documentation_key')) + .html(docs.description || t('inspector.no_documentation_key')) .append('a') .attr('class', 'tag-reference-edit') .attr('target', '_blank') .attr('tabindex', -1) - .attr('title', t('inspector.edit_reference')) + .attr('title', t('inspector.edit_reference', { html: false })) .attr('href', docs.editURL) .call(svgIcon('#iD-icon-edit', 'inline')); @@ -82,7 +82,7 @@ export function uiTagReference(what) { .attr('href', docs.wiki.url) .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .text(t(docs.wiki.text)); + .html(t(docs.wiki.text)); } // Add link to info about "good changeset comments" - #2923 @@ -95,7 +95,7 @@ export function uiTagReference(what) { .call(svgIcon('#iD-icon-out-link', 'inline')) .attr('href', t('commit.about_changeset_comments_link')) .append('span') - .text(t('commit.about_changeset_comments')); + .html(t('commit.about_changeset_comments')); } } @@ -153,7 +153,7 @@ export function uiTagReference(what) { _button = _button.enter() .append('button') .attr('class', 'tag-reference-button ' + klass) - .attr('title', t('icons.information')) + .attr('title', t('icons.information', { html: false })) .attr('tabindex', -1) .call(svgIcon('#iD-icon-' + (iconName || 'inspect'))) .merge(_button); diff --git a/modules/ui/tools/modes.js b/modules/ui/tools/modes.js index 9bcfa4776..c89759b11 100644 --- a/modules/ui/tools/modes.js +++ b/modules/ui/tools/modes.js @@ -127,7 +127,7 @@ export function uiToolOldDrawModes(context) { buttonsEnter .append('span') .attr('class', 'label') - .text(function(mode) { return mode.title; }); + .html(function(mode) { return mode.title; }); // if we are adding/removing the buttons, check if toolbar has overflowed if (buttons.enter().size() || buttons.exit().size()) { diff --git a/modules/ui/tools/save.js b/modules/ui/tools/save.js index 001cdd3a7..00333944d 100644 --- a/modules/ui/tools/save.js +++ b/modules/ui/tools/save.js @@ -68,7 +68,7 @@ export function uiToolSave(context) { .style('background', bgColor(_numChanges)); button.select('span.count') - .text(_numChanges); + .html(_numChanges); } } @@ -102,7 +102,7 @@ export function uiToolSave(context) { .duration(2000) .iconName('#iD-icon-save') .iconClass('disabled') - .text(t('save.no_changes'))(); + .html(t('save.no_changes'))(); } lastPointerUpType = null; }) @@ -115,7 +115,7 @@ export function uiToolSave(context) { .append('span') .attr('class', 'count') .attr('aria-hidden', 'true') - .text('0'); + .html('0'); updateCount(); diff --git a/modules/ui/tools/sidebar_toggle.js b/modules/ui/tools/sidebar_toggle.js index 1cd3588f2..d4412cc3a 100644 --- a/modules/ui/tools/sidebar_toggle.js +++ b/modules/ui/tools/sidebar_toggle.js @@ -19,7 +19,7 @@ export function uiToolSidebarToggle(context) { .call(uiTooltip() .placement('bottom') .title(t('sidebar.tooltip')) - .keys([t('sidebar.key')]) + .keys([t('sidebar.key', { html: false })]) .scrollContainer(context.container().select('.top-toolbar')) ) .call(svgIcon('#iD-icon-sidebar-' + (localizer.textDirection() === 'rtl' ? 'right' : 'left'))); diff --git a/modules/ui/tools/undo_redo.js b/modules/ui/tools/undo_redo.js index cb7b38540..55d3c278e 100644 --- a/modules/ui/tools/undo_redo.js +++ b/modules/ui/tools/undo_redo.js @@ -92,7 +92,7 @@ export function uiToolUndoRedo(context) { .duration(2000) .iconName('#' + d.icon) .iconClass(annotation ? '' : 'disabled') - .text(text)(); + .html(text)(); } lastPointerUpType = null; }) diff --git a/modules/ui/top_toolbar.js b/modules/ui/top_toolbar.js index 5b35fac22..60b67427e 100644 --- a/modules/ui/top_toolbar.js +++ b/modules/ui/top_toolbar.js @@ -87,7 +87,7 @@ export function uiTopToolbar(context) { actionableItems .append('div') .attr('class', 'item-label') - .text(function(d) { + .html(function(d) { return d.label; }); } diff --git a/modules/ui/version.js b/modules/ui/version.js index 36d2effd0..4809656b8 100644 --- a/modules/ui/version.js +++ b/modules/ui/version.js @@ -32,7 +32,7 @@ export function uiVersion(context) { .append('a') .attr('target', '_blank') .attr('href', 'https://github.com/openstreetmap/iD') - .text(currVersion); + .html(currVersion); // only show new version indicator to users that have used iD before if (isNewVersion && !isNewUser) { diff --git a/modules/ui/view_on_keepRight.js b/modules/ui/view_on_keepRight.js index 9397d9d36..08e90cf26 100644 --- a/modules/ui/view_on_keepRight.js +++ b/modules/ui/view_on_keepRight.js @@ -30,7 +30,7 @@ export function uiViewOnKeepRight() { linkEnter .append('span') - .text(t('inspector.view_on_keepRight')); + .html(t('inspector.view_on_keepRight')); } viewOnKeepRight.what = function(val) { diff --git a/modules/ui/view_on_osm.js b/modules/ui/view_on_osm.js index b9a6761b8..dff50c5ff 100644 --- a/modules/ui/view_on_osm.js +++ b/modules/ui/view_on_osm.js @@ -33,7 +33,7 @@ export function uiViewOnOSM(context) { linkEnter .append('span') - .text(t('inspector.view_on_osm')); + .html(t('inspector.view_on_osm')); } diff --git a/modules/ui/view_on_osmose.js b/modules/ui/view_on_osmose.js index 589eb2fb3..362fb93a0 100644 --- a/modules/ui/view_on_osmose.js +++ b/modules/ui/view_on_osmose.js @@ -30,7 +30,7 @@ export function uiViewOnOsmose() { linkEnter .append('span') - .text(t('inspector.view_on_osmose')); + .html(t('inspector.view_on_osmose')); } viewOnOsmose.what = function(val) { diff --git a/modules/ui/zoom.js b/modules/ui/zoom.js index 1a1cc4c55..bf3e0fb56 100644 --- a/modules/ui/zoom.js +++ b/modules/ui/zoom.js @@ -84,7 +84,7 @@ export function uiZoom(context) { .duration(2000) .iconName('#' + d.icon) .iconClass('disabled') - .text(d.disabledTitle)(); + .html(d.disabledTitle)(); } lastPointerUpType = null; }) diff --git a/modules/ui/zoom_to_selection.js b/modules/ui/zoom_to_selection.js index 7a60befbe..12c64333c 100644 --- a/modules/ui/zoom_to_selection.js +++ b/modules/ui/zoom_to_selection.js @@ -26,7 +26,7 @@ export function uiZoomToSelection(context) { .duration(2000) .iconName('#iD-icon-framed-dot') .iconClass('disabled') - .text(t('inspector.zoom_to.no_selection'))(); + .html(t('inspector.zoom_to.no_selection'))(); } } else { var mode = context.mode(); @@ -48,7 +48,7 @@ export function uiZoomToSelection(context) { } return t('inspector.zoom_to.title'); }) - .keys([t('inspector.zoom_to.key')]); + .keys([t('inspector.zoom_to.key', { html: false })]); var button = selection .append('button') diff --git a/modules/validations/almost_junction.js b/modules/validations/almost_junction.js index 866b0ed2e..3b4fdcb06 100644 --- a/modules/validations/almost_junction.js +++ b/modules/validations/almost_junction.js @@ -157,7 +157,7 @@ export function validationAlmostJunction(context) { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.almost_junction.highway-highway.reference')); + .html(t('issues.almost_junction.highway-highway.reference')); } function isExtendableCandidate(node, way) { diff --git a/modules/validations/close_nodes.js b/modules/validations/close_nodes.js index 3f9af1079..3eae44fb9 100644 --- a/modules/validations/close_nodes.js +++ b/modules/validations/close_nodes.js @@ -200,7 +200,7 @@ export function validationCloseNodes(context) { .enter() .append('div') .attr('class', 'issue-reference') - .text(referenceText); + .html(referenceText); } } @@ -264,7 +264,7 @@ export function validationCloseNodes(context) { .enter() .append('div') .attr('class', 'issue-reference') - .text(referenceText); + .html(referenceText); } } diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index f04649021..d33bc86d8 100644 --- a/modules/validations/crossing_ways.js +++ b/modules/validations/crossing_ways.js @@ -486,7 +486,7 @@ export function validationCrossingWays(context) { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.crossing_ways.' + crossingTypeID + '.reference')); + .html(t('issues.crossing_ways.' + crossingTypeID + '.reference')); } } diff --git a/modules/validations/disconnected_way.js b/modules/validations/disconnected_way.js index 159c1f7c5..9fa88337a 100644 --- a/modules/validations/disconnected_way.js +++ b/modules/validations/disconnected_way.js @@ -85,7 +85,7 @@ export function validationDisconnectedWay() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.disconnected_way.routable.reference')); + .html(t('issues.disconnected_way.routable.reference')); } function routingIslandForEntity(entity) { diff --git a/modules/validations/help_request.js b/modules/validations/help_request.js index 85d5cec32..6cef0d6f2 100644 --- a/modules/validations/help_request.js +++ b/modules/validations/help_request.js @@ -44,7 +44,7 @@ export function validationHelpRequest(context) { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.fixme_tag.reference')); + .html(t('issues.fixme_tag.reference')); } }; diff --git a/modules/validations/impossible_oneway.js b/modules/validations/impossible_oneway.js index 66443757a..289c83ee9 100644 --- a/modules/validations/impossible_oneway.js +++ b/modules/validations/impossible_oneway.js @@ -213,7 +213,7 @@ export function validationImpossibleOneway() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.impossible_oneway.' + referenceID + '.reference')); + .html(t('issues.impossible_oneway.' + referenceID + '.reference')); }; } } diff --git a/modules/validations/incompatible_source.js b/modules/validations/incompatible_source.js index 772b9e44a..93c57e9d2 100644 --- a/modules/validations/incompatible_source.js +++ b/modules/validations/incompatible_source.js @@ -60,7 +60,7 @@ export function validationIncompatibleSource() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.incompatible_source.' + id + '.reference')); + .html(t('issues.incompatible_source.' + id + '.reference')); }; } }; diff --git a/modules/validations/invalid_format.js b/modules/validations/invalid_format.js index dccf9bede..44996e9cc 100644 --- a/modules/validations/invalid_format.js +++ b/modules/validations/invalid_format.js @@ -28,7 +28,7 @@ export function validationFormatting() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.invalid_format.email.reference')); + .html(t('issues.invalid_format.email.reference')); } /* function showReferenceWebsite(selection) { @@ -37,7 +37,7 @@ export function validationFormatting() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.invalid_format.website.reference')); + .html(t('issues.invalid_format.website.reference')); } if (entity.tags.website) { diff --git a/modules/validations/mismatched_geometry.js b/modules/validations/mismatched_geometry.js index e4e7fac02..91d52db4c 100644 --- a/modules/validations/mismatched_geometry.js +++ b/modules/validations/mismatched_geometry.js @@ -135,7 +135,7 @@ export function validationMismatchedGeometry() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.tag_suggests_area.reference')); + .html(t('issues.tag_suggests_area.reference')); } } @@ -170,7 +170,7 @@ export function validationMismatchedGeometry() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.vertex_as_point.reference')); + .html(t('issues.vertex_as_point.reference')); }, entityIds: [entity.id] }); @@ -193,7 +193,7 @@ export function validationMismatchedGeometry() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.point_as_vertex.reference')); + .html(t('issues.point_as_vertex.reference')); }, entityIds: [entity.id], dynamicFixes: function(context) { @@ -280,7 +280,7 @@ export function validationMismatchedGeometry() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.unclosed_multipolygon_part.reference')); + .html(t('issues.unclosed_multipolygon_part.reference')); } } diff --git a/modules/validations/missing_role.js b/modules/validations/missing_role.js index 95bf2143f..eac0b09e1 100644 --- a/modules/validations/missing_role.js +++ b/modules/validations/missing_role.js @@ -80,7 +80,7 @@ export function validationMissingRole() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.missing_role.multipolygon.reference')); + .html(t('issues.missing_role.multipolygon.reference')); } } diff --git a/modules/validations/missing_tag.js b/modules/validations/missing_tag.js index 460cd352a..48768a540 100644 --- a/modules/validations/missing_tag.js +++ b/modules/validations/missing_tag.js @@ -138,7 +138,7 @@ export function validationMissingTag(context) { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.' + referenceID + '.reference')); + .html(t('issues.' + referenceID + '.reference')); } }; diff --git a/modules/validations/outdated_tags.js b/modules/validations/outdated_tags.js index 9074b4d3e..fbc6292d0 100644 --- a/modules/validations/outdated_tags.js +++ b/modules/validations/outdated_tags.js @@ -227,11 +227,11 @@ export function validationOutdatedTags() { enter .append('div') .attr('class', 'issue-reference') - .text(t(`issues.outdated_tags.${prefix}reference`)); + .html(t(`issues.outdated_tags.${prefix}reference`)); enter .append('strong') - .text(t('issues.suggested')); + .html(t('issues.suggested')); enter .append('table') @@ -246,7 +246,7 @@ export function validationOutdatedTags() { let klass = d.type === '+' ? 'add' : 'remove'; return `tagDiff-cell tagDiff-cell-${klass}`; }) - .text(d => d.display); + .html(d => d.display); } } @@ -313,7 +313,7 @@ export function validationOutdatedTags() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.old_multipolygon.reference')); + .html(t('issues.old_multipolygon.reference')); } } diff --git a/modules/validations/private_data.js b/modules/validations/private_data.js index db9a788d0..c87279abb 100644 --- a/modules/validations/private_data.js +++ b/modules/validations/private_data.js @@ -112,11 +112,11 @@ export function validationPrivateData() { enter .append('div') .attr('class', 'issue-reference') - .text(t('issues.private_data.reference')); + .html(t('issues.private_data.reference')); enter .append('strong') - .text(t('issues.suggested')); + .html(t('issues.suggested')); enter .append('table') @@ -131,7 +131,7 @@ export function validationPrivateData() { var klass = d.type === '+' ? 'add' : 'remove'; return 'tagDiff-cell tagDiff-cell-' + klass; }) - .text(function(d) { return d.display; }); + .html(function(d) { return d.display; }); } }; diff --git a/modules/validations/suspicious_name.js b/modules/validations/suspicious_name.js index 63c0be0f7..c903054e5 100644 --- a/modules/validations/suspicious_name.js +++ b/modules/validations/suspicious_name.js @@ -96,7 +96,7 @@ export function validationSuspiciousName() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.generic_name.reference')); + .html(t('issues.generic_name.reference')); } } @@ -142,7 +142,7 @@ export function validationSuspiciousName() { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.generic_name.reference')); + .html(t('issues.generic_name.reference')); } } diff --git a/modules/validations/unsquare_way.js b/modules/validations/unsquare_way.js index 6b608243c..d6babc2ff 100644 --- a/modules/validations/unsquare_way.js +++ b/modules/validations/unsquare_way.js @@ -123,7 +123,7 @@ export function validationUnsquareWay(context) { .enter() .append('div') .attr('class', 'issue-reference') - .text(t('issues.unsquare_way.buildings.reference')); + .html(t('issues.unsquare_way.buildings.reference')); } };