diff --git a/modules/core/localizer.js b/modules/core/localizer.js index a4063debb..3f31c95a3 100644 --- a/modules/core/localizer.js +++ b/modules/core/localizer.js @@ -8,7 +8,7 @@ let _t = _mainLocalizer.t; export { _mainLocalizer as localizer, - // export `t` function for ease-of-use + // export `t` functions for ease-of-use _t as t }; @@ -221,20 +221,17 @@ 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 - * with locale `en` if a string can not be found in the requested language. + * Try to find that string in `locale` or the current `_localeCode` matching + * the given `stringId`. If no string can be found in the requested locale, + * we'll recurse down all the `_localeCodes` until one is found. * * @param {string} stringId string identifier * @param {object?} replacements token replacements and default string * @param {string?} locale locale to use (defaults to currentLocale) * @return {string?} localized string */ - localizer.t = function(stringId, replacements, locale) { - _lastUsedTCode = null; + localizer.tInfo = function(stringId, replacements, locale) { locale = locale || _localeCode; @@ -291,11 +288,10 @@ export function coreLocalizer() { } if (typeof result === 'string') { // found a localized string! - _lastUsedTCode = locale; - if (replacements && replacements.html === false) { - return result; - } - return `${result}`; + return { + text: result, + locale: locale + }; } } // no localized string found... @@ -305,21 +301,36 @@ export function coreLocalizer() { if (index >= 0 && index < _localeCodes.length - 1) { // eventually this will be 'en' or another locale with 100% coverage let fallback = _localeCodes[index + 1]; - return localizer.t(stringId, replacements, fallback); + return localizer.tInfo(stringId, replacements, fallback); } if (replacements && 'default' in replacements) { // Fallback to a default value if one is specified in `replacements` - return replacements.default; + return { + text: replacements.default, + locale: null + }; } const missing = `Missing ${locale} translation: ${stringId}`; if (typeof console !== 'undefined') console.error(missing); // eslint-disable-line - return missing; + return { + text: missing, + locale: 'en' + }; }; - localizer.t.lastCode = () => _lastUsedTCode; + // Returns only the localized text, discarding the locale info + localizer.t = function(stringId, replacements, locale) { + return localizer.tInfo(stringId, replacements, locale).text; + }; + + // Returns the localized text wrapped in an HTML element encoding the locale info + localizer.t.html = function(stringId, replacements, locale) { + const info = localizer.tInfo(stringId, replacements, locale); + return `${info.text}`; + }; localizer.languageName = (code, options) => { diff --git a/modules/modes/add_note.js b/modules/modes/add_note.js index db48bdbce..b257663cd 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', { html: false }) + key: t('modes.add_note.key') }; var behavior = behaviorDraw(context) diff --git a/modules/modes/select.js b/modules/modes/select.js index 2d0c633bd..4bbebe361 100644 --- a/modules/modes/select.js +++ b/modules/modes/select.js @@ -231,7 +231,7 @@ export function modeSelect(context, selectedIDs) { _behaviors.forEach(context.install); keybinding - .on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected) + .on(t('inspector.zoom_to.key'), 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 adfa7ac6d..a631798c9 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', { html: false }), mode.zoomToSelected) + .on(t('inspector.zoom_to.key'), mode.zoomToSelected) .on('⎋', esc, true); d3_select(document) diff --git a/modules/modes/select_error.js b/modules/modes/select_error.js index 61a4e8ec2..4a7cb8e80 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', { html: false }), mode.zoomToSelected) + .on(t('inspector.zoom_to.key'), mode.zoomToSelected) .on('⎋', esc, true); d3_select(document) diff --git a/modules/modes/select_note.js b/modules/modes/select_note.js index a29a8fa68..d8f6cbd9f 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', { html: false }), mode.zoomToSelected) + .on(t('inspector.zoom_to.key'), mode.zoomToSelected) .on('⎋', esc, true); d3_select(document) diff --git a/modules/operations/circularize.js b/modules/operations/circularize.js index a08ef0ccd..b7497c045 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', { html: false })]; + operation.keys = [t('operations.circularize.key')]; 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 bf7755c4e..90bc32fb1 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', { html: false })]; + operation.keys = [t('operations.continue.key')]; 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 a1b4c7e5d..b62c325c7 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', { html: false })]; + operation.keys = [t('operations.disconnect.key')]; 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 2b9fbbf4d..b8a3309c6 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', { html: false })]; + operation.keys = [t('operations.extract.key')]; 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 d2d50c111..fc0d0d50d 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', { html: false })]; + operation.keys = [t('operations.merge.key')]; 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 c65b78e68..4078714c8 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', { html: false })]; + operation.keys = [t('operations.move.key')]; 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 157dc280f..c8b89445d 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', { html: false })]; + operation.keys = [t('operations.orthogonalize.key')]; 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 772e4736b..55ad14c2d 100644 --- a/modules/operations/reverse.js +++ b/modules/operations/reverse.js @@ -69,7 +69,7 @@ export function operationReverse(context, selectedIDs) { operation.id = 'reverse'; - operation.keys = [t('operations.reverse.key', { html: false })]; + operation.keys = [t('operations.reverse.key')]; 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 072808d7c..b8a4c5ea6 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', { html: false })]; + operation.keys = [t('operations.rotate.key')]; 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 171b8e0ed..e5527b84b 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', { html: false })]; + operation.keys = [t('operations.split.key')]; 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 e44baf817..56b5b4050 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', { html: false })]; + operation.keys = [t('operations.straighten.key')]; 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 2e46f4b8b..05b280f05 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, html: false }); + _this.name = () => t(`presets.categories.${categoryID}.name`, { 'default': categoryID }); _this.terms = () => []; diff --git a/modules/presets/field.js b/modules/presets/field.js index e7b205523..d97938d4f 100644 --- a/modules/presets/field.js +++ b/modules/presets/field.js @@ -21,15 +21,16 @@ export function presetField(fieldID, field) { }; _this.t = (scope, options) => t(`presets.fields.${fieldID}.${scope}`, options); + _this.t.html = (scope, options) => t.html(`presets.fields.${fieldID}.${scope}`, options); - _this.label = () => _this.overrideLabel || _this.t('label', { 'default': fieldID, html: false }); + _this.label = () => _this.overrideLabel || _this.t('label', { 'default': fieldID }); const _placeholder = _this.placeholder; - _this.placeholder = () => _this.t('placeholder', { 'default': _placeholder, html: false }); + _this.placeholder = () => _this.t('placeholder', { 'default': _placeholder }); _this.originalTerms = (_this.terms || []).join(); - _this.terms = () => _this.t('terms', { 'default': _this.originalTerms, html: false }) + _this.terms = () => _this.t('terms', { 'default': _this.originalTerms }) .toLowerCase().trim().split(/\s*,+\s*/); diff --git a/modules/presets/preset.js b/modules/presets/preset.js index d1336acf5..5993f89c3 100644 --- a/modules/presets/preset.js +++ b/modules/presets/preset.js @@ -84,19 +84,24 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { return t(textID, options); }; + _this.t.html = (scope, options) => { + const textID = `presets.presets.${presetID}.${scope}`; + return t.html(textID, options); + }; + _this.name = () => { if (_this.suggestion) { 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', { html: false }); + return _this.originalName + ' – ' + t('presets.presets.' + path.join('/') + '.name'); } - return _this.t('name', { 'default': _this.originalName, html: false }); + return _this.t('name', { 'default': _this.originalName }); }; - _this.terms = () => _this.t('terms', { 'default': _this.originalTerms, html: false }) + _this.terms = () => _this.t('terms', { 'default': _this.originalTerms }) .toLowerCase().trim().split(/\s*,+\s*/); diff --git a/modules/services/streetside.js b/modules/services/streetside.js index c3e232f8c..0f538dee8 100644 --- a/modules/services/streetside.js +++ b/modules/services/streetside.js @@ -789,7 +789,7 @@ export default { label .append('span') - .html(t('streetside.hires')); + .html(t.html('streetside.hires')); let captureInfo = line1 @@ -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') - .html(t('streetside.view_on_bing')); + .html(t.html('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') - .html(t('streetside.report')); + .html(t.html('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 45b00e9b3..d0b8b77da 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, { html: false }); + return t('mapillary_map_features.' + id); }); enter diff --git a/modules/ui/account.js b/modules/ui/account.js index 6ca578175..2cb8fb369 100644 --- a/modules/ui/account.js +++ b/modules/ui/account.js @@ -52,7 +52,7 @@ export function uiAccount(context) { logoutLink.append('a') .attr('class', 'logout') .attr('href', '#') - .html(t('logout')) + .html(t.html('logout')) .on('click.logout', function() { d3_event.preventDefault(); osm.logout(); diff --git a/modules/ui/changeset_editor.js b/modules/ui/changeset_editor.js index 63b2d84f5..d9b8d37df 100644 --- a/modules/ui/changeset_editor.js +++ b/modules/ui/changeset_editor.js @@ -107,7 +107,7 @@ export function uiChangesetEditor(context) { .call(svgIcon('#iD-icon-alert', 'inline')) .attr('href', t('commit.google_warning_link')) .append('span') - .html(t('commit.google_warning')); + .html(t.html('commit.google_warning')); commentEnter .transition() diff --git a/modules/ui/commit.js b/modules/ui/commit.js index c34bc6706..c7a894920 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') - .html(t('commit.title')); + .html(t.html('commit.title')); headerTitle .append('div') @@ -283,7 +283,7 @@ export function uiCommit(context) { prose = prose.enter() .append('p') .attr('class', 'commit-info') - .html(t('commit.upload_explanation')) + .html(t.html('commit.upload_explanation')) .merge(prose); // always check if this has changed, but only update prose.html() @@ -311,7 +311,7 @@ export function uiCommit(context) { .attr('target', '_blank'); prose - .html(t('commit.upload_explanation_with_user', { user: userLink.html() })); + .html(t.html('commit.upload_explanation_with_user', { user: userLink.html() })); }); @@ -337,7 +337,7 @@ export function uiCommit(context) { labelEnter .append('span') - .html(t('commit.request_review')); + .html(t.html('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') - .html(t('commit.cancel')); + .html(t.html('commit.cancel')); var uploadButton = buttonEnter .append('button') @@ -370,7 +370,7 @@ export function uiCommit(context) { uploadButton.append('span') .attr('class', 'label') - .html(t('commit.save')); + .html(t.html('commit.save')); var uploadBlockerTooltipText = getUploadBlockerMessage(); diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index 576ee8b2a..1279a5605 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -27,7 +27,7 @@ export function uiCommitWarnings(context) { containerEnter .append('h3') - .html(severity === 'warning' ? t('commit.warnings') : t('commit.errors')); + .html(severity === 'warning' ? t.html('commit.warnings') : t.html('commit.errors')); containerEnter .append('ul') diff --git a/modules/ui/confirm.js b/modules/ui/confirm.js index bd47d4e64..7857719e2 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(); }) - .html(t('confirm.okay')) + .html(t.html('confirm.okay')) .node() .focus(); diff --git a/modules/ui/conflicts.js b/modules/ui/conflicts.js index b0c5a866e..2f7455be9 100644 --- a/modules/ui/conflicts.js +++ b/modules/ui/conflicts.js @@ -66,7 +66,7 @@ export function uiConflicts(context) { headerEnter .append('h3') - .html(t('save.conflict.header')); + .html(t.html('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') - .html(t('save.conflict.help')); + .html(t.html('save.conflict.help')); // Download changes link @@ -110,7 +110,7 @@ export function uiConflicts(context) { linkEnter .call(svgIcon('#iD-icon-load', 'inline')) .append('span') - .html(t('save.conflict.download_changes')); + .html(t.html('save.conflict.download_changes')); bodyEnter @@ -123,7 +123,7 @@ export function uiConflicts(context) { .attr('class', 'conflicts-done') .attr('opacity', 0) .style('display', 'none') - .html(t('save.conflict.done')); + .html(t.html('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') - .html(t('save.title')) + .html(t.html('save.title')) .on('click.try_again', tryAgain); buttonsEnter .append('button') .attr('class', 'secondary-action conflicts-button col6') - .html(t('confirm.cancel')) + .html(t.html('confirm.cancel')) .on('click.cancel', cancel); } @@ -177,7 +177,7 @@ export function uiConflicts(context) { conflictEnter .append('h4') .attr('class', 'conflict-count') - .html(t('save.conflict.count', { num: index + 1, total: _conflictList.length })); + .html(t.html('save.conflict.count', { num: index + 1, total: _conflictList.length })); conflictEnter .append('a') @@ -215,7 +215,7 @@ export function uiConflicts(context) { .data(['previous', 'next']) .enter() .append('button') - .html(function(d) { return t('save.conflict.' + d); }) + .html(function(d) { return t.html('save.conflict.' + d); }) .attr('class', 'conflict-nav-button action col6') .attr('disabled', function(d, i) { return (i === 0 && index === 0) || diff --git a/modules/ui/contributors.js b/modules/ui/contributors.js index 7adb6db15..1006fa03f 100644 --- a/modules/ui/contributors.js +++ b/modules/ui/contributors.js @@ -54,11 +54,11 @@ export function uiContributors(context) { .html(othersNum); wrap.append('span') - .html(t('contributors.truncated_list', { n: othersNum, users: userList.html(), count: count.html() })); + .html(t.html('contributors.truncated_list', { n: othersNum, users: userList.html(), count: count.html() })); } else { wrap.append('span') - .html(t('contributors.list', { users: userList.html() })); + .html(t.html('contributors.list', { users: userList.html() })); } if (!u.length) { diff --git a/modules/ui/data_editor.js b/modules/ui/data_editor.js index 6dcd60842..0fe80cad4 100644 --- a/modules/ui/data_editor.js +++ b/modules/ui/data_editor.js @@ -33,7 +33,7 @@ export function uiDataEditor(context) { headerEnter .append('h3') - .html(t('map_data.title')); + .html(t.html('map_data.title')); var body = selection.selectAll('.body') diff --git a/modules/ui/data_header.js b/modules/ui/data_header.js index e7c38e5d9..0c7b43b7b 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') - .html(t('map_data.layers.custom.title')); + .html(t.html('map_data.layers.custom.title')); } diff --git a/modules/ui/entity_editor.js b/modules/ui/entity_editor.js index b905af80c..cff80b89e 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') - .html(_entityIDs.length === 1 ? t('inspector.edit') : t('inspector.edit_features')); + .html(_entityIDs.length === 1 ? t.html('inspector.edit') : t.html('inspector.edit_features')); header.selectAll('.preset-reset') .on('click', function() { diff --git a/modules/ui/feature_info.js b/modules/ui/feature_info.js index f4fecc933..04b605f14 100644 --- a/modules/ui/feature_info.js +++ b/modules/ui/feature_info.js @@ -28,7 +28,7 @@ export function uiFeatureInfo(context) { selection.append('a') .attr('class', 'chip') .attr('href', '#') - .html(t('feature_info.hidden_warning', { count: count })) + .html(t.html('feature_info.hidden_warning', { count: count })) .call(tooltipBehavior) .on('click', function() { tooltipBehavior.hide(); diff --git a/modules/ui/feature_list.js b/modules/ui/feature_list.js index aa99d75a7..70fbff134 100644 --- a/modules/ui/feature_list.js +++ b/modules/ui/feature_list.js @@ -35,7 +35,7 @@ export function uiFeatureList(context) { header .append('h3') - .html(t('inspector.feature_list')); + .html(t.html('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', { html: false })) + .attr('placeholder', t('inspector.search')) .attr('type', 'search') .call(utilNoAuto) .on('keypress', keypress) @@ -256,7 +256,7 @@ export function uiFeatureList(context) { .attr('class', 'entity-name'); list.selectAll('.no-results-item .entity-name') - .html(t('geocoder.no_results_worldwide')); + .html(t.html('geocoder.no_results_worldwide')); if (services.geocoder) { list.selectAll('.geocode-item') @@ -269,7 +269,7 @@ export function uiFeatureList(context) { .attr('class', 'label') .append('span') .attr('class', 'entity-name') - .html(t('geocoder.search')); + .html(t.html('geocoder.search')); } list.selectAll('.no-results-item') diff --git a/modules/ui/field.js b/modules/ui/field.js index d6bd10629..a6bb07766 100644 --- a/modules/ui/field.js +++ b/modules/ui/field.js @@ -142,7 +142,7 @@ export function uiField(context, presetField, entityIDs, options) { labelEnter .append('button') .attr('class', 'remove-icon') - .attr('title', t('icons.remove', { html: false })) + .attr('title', t('icons.remove')) .call(svgIcon('#iD-operation-delete')); } @@ -150,7 +150,7 @@ export function uiField(context, presetField, entityIDs, options) { labelEnter .append('button') .attr('class', 'modified-icon') - .attr('title', t('icons.undo', { html: false })) + .attr('title', t('icons.undo')) .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 e1b6ab5ab..2f4d35dda 100644 --- a/modules/ui/field_help.js +++ b/modules/ui/field_help.js @@ -197,7 +197,7 @@ export function uiFieldHelp(context, fieldName) { titleEnter .append('h2') .attr('class', ((localizer.textDirection() === 'rtl') ? 'fr' : 'fl')) - .html(t('help.field.' + fieldName + '.title')); + .html(t.html('help.field.' + fieldName + '.title')); titleEnter .append('button') diff --git a/modules/ui/fields/access.js b/modules/ui/fields/access.js index 8e6823f09..5cb60305c 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; }) - .html(function(d) { return field.t('types.' + d); }); + .html(function(d) { return field.t.html('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', { html: false }); + return t('inspector.multiple_values'); } if (d === 'access') { return 'yes'; diff --git a/modules/ui/fields/address.js b/modules/ui/fields/address.js index d292f736c..6564e1f2b 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', { html: false }); + return t('inspector.multiple_values'); } if (_countryCode) { var localkey = subfield.id + '!' + _countryCode; var tkey = addrField.strings.placeholders[localkey] ? localkey : subfield.id; - return addrField.t('placeholders.' + tkey, { html: false }); + return addrField.t('placeholders.' + tkey); } }); } diff --git a/modules/ui/fields/check.js b/modules/ui/fields/check.js index f33beca99..e5c305d36 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') - .html(t('inspector.check.reverser')) + .html(t.html('inspector.check.reverser')) .call(svgIcon(icon, 'inline')); return selection; @@ -212,7 +212,7 @@ export function uiFieldCheck(field, context) { .property('checked', isChecked(_value)); text - .html(isMixed ? t('inspector.multiple_values') : textFor(_value)) + .html(isMixed ? t.html('inspector.multiple_values') : textFor(_value)) .classed('mixed', isMixed); label diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index 4ba8ecafd..6bc7400a3 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -147,7 +147,7 @@ export function uiFieldCombo(field, context) { if (_optstrings) { _comboData = Object.keys(_optstrings).map(function(k) { - var v = field.t('options.' + k, { 'default': _optstrings[k], html: false }); + var v = field.t('options.' + k, { 'default': _optstrings[k] }); return { key: k, value: v, @@ -240,7 +240,7 @@ export function uiFieldCombo(field, context) { function setPlaceholder(values) { if (_isMulti || _isSemi) { - _staticPlaceholder = field.placeholder() || t('inspector.add', { html: false }); + _staticPlaceholder = field.placeholder() || t('inspector.add'); } else { var vals = values .map(function(d) { return d.value; }) @@ -256,7 +256,7 @@ export function uiFieldCombo(field, context) { var ph; if (!_isMulti && !_isSemi && _tags && Array.isArray(_tags[field.key])) { - ph = t('inspector.multiple_values', { html: false }); + ph = t('inspector.multiple_values'); } else { ph = _staticPlaceholder; } @@ -530,7 +530,7 @@ export function uiFieldCombo(field, context) { return d.isMixed; }) .attr('title', function(d) { - return d.isMixed ? t('inspector.unshared_value_tooltip', { html: false }) : null; + return d.isMixed ? t('inspector.unshared_value_tooltip') : null; }); if (allowDragAndDrop) { @@ -554,7 +554,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', { html: false }) : _staticPlaceholder || '') + .attr('placeholder', isMixed ? t('inspector.multiple_values') : _staticPlaceholder || '') .classed('mixed', isMixed); } }; diff --git a/modules/ui/fields/cycleway.js b/modules/ui/fields/cycleway.js index 0ee8d32f1..a0d3738cb 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); }) - .html(function(d) { return field.t('types.' + d); }); + .html(function(d) { return field.t.html('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', { html: false }); + return t('inspector.multiple_values'); } return field.placeholder(); }) diff --git a/modules/ui/fields/input.js b/modules/ui/fields/input.js index fdcaa6d19..4482f081c 100644 --- a/modules/ui/fields/input.js +++ b/modules/ui/fields/input.js @@ -111,7 +111,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, html: false }); + return t('icons.view_on', { domain: domain }); } return ''; }) @@ -200,7 +200,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', { html: false }) : (field.placeholder() || t('inspector.unknown', { html: false }))) + .attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown'))) .classed('mixed', isMixed); if (outlinkButton && !outlinkButton.empty()) { diff --git a/modules/ui/fields/localized.js b/modules/ui/fields/localized.js index 2b112381c..13d7688a5 100644 --- a/modules/ui/fields/localized.js +++ b/modules/ui/fields/localized.js @@ -512,7 +512,7 @@ export function uiFieldLocalized(field, context) { text .append('span') .attr('class', 'label-textvalue') - .html(t('translate.localized_translation_label')); + .html(t.html('translate.localized_translation_label')); text .append('span') @@ -543,7 +543,7 @@ export function uiFieldLocalized(field, context) { .attr('class', 'localized-lang') .attr('id', domId) .attr('type', 'text') - .attr('placeholder', t('translate.localized_translation_language', { html: false })) + .attr('placeholder', t('translate.localized_translation_language')) .on('blur', changeLang) .on('change', changeLang) .call(langCombo); @@ -590,7 +590,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', { html: false }) : t('translate.localized_translation_name', { html: false }); + return Array.isArray(d.value) ? t('inspector.multiple_values') : t('translate.localized_translation_name'); }) .classed('mixed', function(d) { return Array.isArray(d.value); @@ -617,7 +617,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', { html: false }) : field.placeholder()) + .attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder()) .classed('mixed', isMixed); calcMultilingual(tags); diff --git a/modules/ui/fields/maxspeed.js b/modules/ui/fields/maxspeed.js index 0983ea4fc..982b2eb0f 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', { html: false }) : field.placeholder()) + .attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder()) .classed('mixed', isMixed); }; diff --git a/modules/ui/fields/radio.js b/modules/ui/fields/radio.js index 2e9a94dde..6b035c7bd 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, html: false }); }) + .attr('value', function(d) { return field.t('options.' + d, { 'default': d }); }) .attr('checked', false); enter .append('span') - .html(function(d) { return field.t('options.' + d, { 'default': d }); }); + .html(function(d) { return field.t.html('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) - .html(t('inspector.radio.structure.type')); + .html(t.html('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') - .html(t('inspector.radio.structure.layer')); + .html(t.html('inspector.radio.structure.layer')); layerEnter .append('div') @@ -290,14 +290,14 @@ export function uiFieldRadio(field, context) { }) .classed('mixed', isMixed) .attr('title', function(d) { - return isMixed(d) ? t('inspector.unshared_value_tooltip', { html: false }) : null; + return isMixed(d) ? t('inspector.unshared_value_tooltip') : null; }); var selection = radios.filter(function() { return this.checked; }); if (selection.empty()) { - placeholder.html(t('inspector.none')); + placeholder.html(t.html('inspector.none')); } else { 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 84ddb139a..6f3bd4a02 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') - .html(t('restriction.controls.distance') + ':'); + .html(t.html('restriction.controls.distance') + ':'); distControlEnter .append('input') @@ -167,7 +167,7 @@ export function uiFieldRestrictions(field, context) { viaControlEnter .append('span') .attr('class', 'restriction-control-label restriction-via-way-label') - .html(t('restriction.controls.via') + ':'); + .html(t.html('restriction.controls.via') + ':'); viaControlEnter .append('input') @@ -487,7 +487,7 @@ export function uiFieldRestrictions(field, context) { var clickSelect = (!_fromWayID || _fromWayID !== way.id); help .append('div') // "Click to select FROM {fromName}." / "FROM {fromName}" - .html(t('restriction.help.' + (clickSelect ? 'select_from_name' : 'from_name'), { + .html(t.html('restriction.help.' + (clickSelect ? 'select_from_name' : 'from_name'), { from: placeholders.from, fromName: displayName(way.id, vgraph) })); @@ -521,7 +521,7 @@ export function uiFieldRestrictions(field, context) { help .append('div') // "FROM {fromName} TO {toName}" - .html(t('restriction.help.from_name_to_name', { + .html(t.html('restriction.help.from_name_to_name', { from: placeholders.from, fromName: displayName(datum.from.way, vgraph), to: placeholders.to, @@ -539,7 +539,7 @@ export function uiFieldRestrictions(field, context) { help .append('div') // "VIA {viaNames}" - .html(t('restriction.help.via_names', { + .html(t.html('restriction.help.via_names', { via: placeholders.via, viaNames: names.join(', ') })); @@ -548,7 +548,7 @@ export function uiFieldRestrictions(field, context) { if (!indirect) { help .append('div') // Click for "No Right Turn" - .html(t('restriction.help.toggle', { turn: nextText.trim() })); + .html(t.html('restriction.help.toggle', { turn: nextText.trim() })); } highlightPathsFrom(null); @@ -566,7 +566,7 @@ export function uiFieldRestrictions(field, context) { if (_fromWayID) { help .append('div') // "FROM {fromName}" - .html(t('restriction.help.from_name', { + .html(t.html('restriction.help.from_name', { from: placeholders.from, fromName: displayName(_fromWayID, vgraph) })); @@ -574,7 +574,7 @@ export function uiFieldRestrictions(field, context) { } else { help .append('div') // "Click to select a FROM segment." - .html(t('restriction.help.select_from', { + .html(t.html('restriction.help.select_from', { from: placeholders.from })); } diff --git a/modules/ui/fields/textarea.js b/modules/ui/fields/textarea.js index 24ce418f2..31e792052 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', { html: false }) : (field.placeholder() || t('inspector.unknown', { html: false }))) + .attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown'))) .classed('mixed', isMixed); }; diff --git a/modules/ui/fields/wikidata.js b/modules/ui/fields/wikidata.js index 6e7ae8c59..5de081165 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', html: false })) + .attr('title', t('icons.view_on', { domain: 'wikidata.org' })) .call(svgIcon('#iD-icon-out-link')) .on('click', function() { d3_event.preventDefault(); @@ -117,7 +117,7 @@ export function uiFieldWikidata(field, context) { enter .append('span') .attr('class', 'label') - .html(function(d) { return t('wikidata.' + d); }); + .html(function(d) { return t.html('wikidata.' + d); }); enter .append('input') @@ -129,7 +129,7 @@ export function uiFieldWikidata(field, context) { enter .append('button') .attr('class', 'form-field-button') - .attr('title', t('icons.copy', { html: false })) + .attr('title', t('icons.copy')) .call(svgIcon('#iD-operation-copy')) .on('click', function() { d3_event.preventDefault(); @@ -290,7 +290,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', { html: false }) : '') + .attr('placeholder', isMixed ? t('inspector.multiple_values') : '') .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 dd6ce17a8..97ec971a1 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', { html: false })) + .attr('placeholder', t('translate.localized_translation_language')) .call(utilNoAuto) .call(langCombo) .merge(_langInput); @@ -128,7 +128,7 @@ export function uiFieldWikipedia(field, context) { link = link.enter() .append('button') .attr('class', 'form-field-button wiki-link') - .attr('title', t('icons.view_on', { domain: 'wikipedia.org', html: false })) + .attr('title', t('icons.view_on', { domain: 'wikipedia.org' })) .call(svgIcon('#iD-icon-out-link')) .merge(link); diff --git a/modules/ui/form_fields.js b/modules/ui/form_fields.js index fb8559222..6dbb1f5b9 100644 --- a/modules/ui/form_fields.js +++ b/modules/ui/form_fields.js @@ -83,7 +83,7 @@ export function uiFormFields(context) { moreEnter .append('span') - .html(t('inspector.add_fields')); + .html(t.html('inspector.add_fields')); more = moreEnter .merge(more); diff --git a/modules/ui/full_screen.js b/modules/ui/full_screen.js index 02ecba26b..296d35e02 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', { html: false })) + // .attr('title', t('full_screen')) // .on('click', fullScreen) // .call(tooltip); diff --git a/modules/ui/geolocate.js b/modules/ui/geolocate.js index 58fe633f7..433b1e97f 100644 --- a/modules/ui/geolocate.js +++ b/modules/ui/geolocate.js @@ -62,7 +62,7 @@ export function uiGeolocate(context) { zoomTo(); } else { context.ui().flash - .html(t('geolocate.location_unavailable')) + .html(t.html('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', { html: false }), click); + context.keybinding().on(t('geolocate.key'), click); }; } diff --git a/modules/ui/improveOSM_comments.js b/modules/ui/improveOSM_comments.js index 888ce7541..c00493056 100644 --- a/modules/ui/improveOSM_comments.js +++ b/modules/ui/improveOSM_comments.js @@ -61,7 +61,7 @@ export function uiImproveOsmComments() { metadataEnter .append('div') .attr('class', 'comment-date') - .html(d => t('note.status.commented', { when: localeDateString(d.timestamp) })); + .html(d => t.html('note.status.commented', { when: localeDateString(d.timestamp) })); mainEnter .append('div') diff --git a/modules/ui/improveOSM_details.js b/modules/ui/improveOSM_details.js index 539bed16f..98cd841a9 100644 --- a/modules/ui/improveOSM_details.js +++ b/modules/ui/improveOSM_details.js @@ -43,7 +43,7 @@ export function uiImproveOsmDetails(context) { descriptionEnter .append('h4') - .html(() => t('QA.keepRight.detail_description')); + .html(t.html('QA.keepRight.detail_description')); descriptionEnter .append('div') diff --git a/modules/ui/improveOSM_editor.js b/modules/ui/improveOSM_editor.js index a9bd3a1b3..948360089 100644 --- a/modules/ui/improveOSM_editor.js +++ b/modules/ui/improveOSM_editor.js @@ -36,7 +36,7 @@ export function uiImproveOsmEditor(context) { headerEnter .append('h3') - .html(t('QA.improveOSM.title')); + .html(t.html('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') - .html(t('note.newComment')); + .html(t.html('note.newComment')); saveSectionEnter .append('textarea') .attr('class', 'new-comment-input') - .attr('placeholder', t('QA.keepRight.comment_placeholder', { html: false })) + .attr('placeholder', t('QA.keepRight.comment_placeholder')) .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') - .html(t('QA.keepRight.save_comment')); + .html(t.html('QA.keepRight.save_comment')); buttonEnter .append('button') diff --git a/modules/ui/info.js b/modules/ui/info.js index 0bb414d42..882930ed6 100644 --- a/modules/ui/info.js +++ b/modules/ui/info.js @@ -123,10 +123,10 @@ export function uiInfo(context) { redraw(); context.keybinding() - .on(uiCmd('⌘' + t('info_panels.key', { html: false })), info.toggle); + .on(uiCmd('⌘' + t('info_panels.key')), info.toggle); ids.forEach(function(k) { - var key = t('info_panels.' + k + '.key', { default: null, html: false }); + var key = t('info_panels.' + k + '.key', { default: null }); 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 123ddbb19..b6c18feed 100644 --- a/modules/ui/init.js +++ b/modules/ui/init.js @@ -127,7 +127,7 @@ export function uiInit(context) { map .on('hitMinZoom.ui', function() { - ui.flash.html(t('cannot_zoom'))(); + ui.flash.html(t.html('cannot_zoom'))(); }); container @@ -348,7 +348,7 @@ export function uiInit(context) { var panPixels = 80; context.keybinding() .on('⌫', function() { d3_event.preventDefault(); }) - .on([t('sidebar.key', { html: false }), '`', '²', '@'], ui.sidebar.toggle) // #5663, #6864 - common QWERTY, AZERTY + .on([t('sidebar.key'), '`', '²', '@'], ui.sidebar.toggle) // #5663, #6864 - common QWERTY, AZERTY .on('←', pan([panPixels, 0])) .on('↑', pan([0, panPixels])) .on('→', pan([-panPixels, 0])) @@ -357,7 +357,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', { html: false })), function quickSwitch() { + .on(uiCmd('⌘' + t('background.key')), function quickSwitch() { if (d3_event) { d3_event.stopImmediatePropagation(); d3_event.preventDefault(); @@ -370,12 +370,12 @@ export function uiInit(context) { context.background().baseLayerSource(previousBackground); } }) - .on(t('area_fill.wireframe.key', { html: false }), function toggleWireframe() { + .on(t('area_fill.wireframe.key'), function toggleWireframe() { d3_event.preventDefault(); d3_event.stopPropagation(); context.map().toggleWireframe(); }) - .on(uiCmd('⌥' + t('area_fill.wireframe.key', { html: false })), function toggleOsmData() { + .on(uiCmd('⌥' + t('area_fill.wireframe.key')), function toggleOsmData() { d3_event.preventDefault(); d3_event.stopPropagation(); @@ -391,7 +391,7 @@ export function uiInit(context) { } } }) - .on(t('map_data.highlight_edits.key', { html: false }), function toggleHighlightEdited() { + .on(t('map_data.highlight_edits.key'), function toggleHighlightEdited() { d3_event.preventDefault(); context.map().toggleHighlightEdited(); }); diff --git a/modules/ui/intro/area.js b/modules/ui/intro/area.js index 8aa539126..df0eb9b69 100644 --- a/modules/ui/intro/area.js +++ b/modules/ui/intro/area.js @@ -13,7 +13,7 @@ import { t } from '../../core/localizer'; import { modeBrowse } from '../../modes/browse'; import { modeSelect } from '../../modes/select'; import { utilRebind } from '../../util/rebind'; -import { helpString, icon, pad, transitionTime } from './helper'; +import { helpHtml, icon, pad, transitionTime } from './helper'; export function uiIntroArea(context, reveal) { @@ -60,7 +60,7 @@ export function uiIntroArea(context, reveal) { timeout(function() { var tooltip = reveal('button.add-area', - helpString('intro.areas.add_playground')); + helpHtml('intro.areas.add_playground')); tooltip.selectAll('.popover-inner') .insert('svg', 'span') @@ -91,7 +91,7 @@ export function uiIntroArea(context, reveal) { timeout(function() { var textId = context.lastPointerType() === 'mouse' ? 'starting_node_click' : 'starting_node_tap'; - var startDrawString = helpString('intro.areas.start_playground') + helpString('intro.areas.' + textId); + var startDrawString = helpHtml('intro.areas.start_playground') + helpHtml('intro.areas.' + textId); revealPlayground(playground, startDrawString, { duration: 250 } ); @@ -125,14 +125,14 @@ export function uiIntroArea(context, reveal) { _areaID = null; revealPlayground(playground, - helpString('intro.areas.continue_playground'), + helpHtml('intro.areas.continue_playground'), { duration: 250 } ); timeout(function() { context.map().on('move.intro drawn.intro', function() { revealPlayground(playground, - helpString('intro.areas.continue_playground'), + helpHtml('intro.areas.continue_playground'), { duration: 0 } ); }); @@ -169,8 +169,8 @@ export function uiIntroArea(context, reveal) { _areaID = null; - var finishString = helpString('intro.areas.finish_area_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + - helpString('intro.areas.finish_playground'); + var finishString = helpHtml('intro.areas.finish_area_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + + helpHtml('intro.areas.finish_playground'); revealPlayground(playground, finishString, { duration: 250 } ); @@ -223,7 +223,7 @@ export function uiIntroArea(context, reveal) { .on('keyup.intro', checkPresetSearch); reveal('.preset-search-input', - helpString('intro.areas.search_playground', { preset: playgroundPreset.name() }) + helpHtml('intro.areas.search_playground', { preset: playgroundPreset.name() }) ); }, 400); // after preset list pane visible.. @@ -247,7 +247,7 @@ export function uiIntroArea(context, reveal) { .on('keyup.intro', checkPresetSearch); reveal('.preset-search-input', - helpString('intro.areas.search_playground', { preset: playgroundPreset.name() }) + helpHtml('intro.areas.search_playground', { preset: playgroundPreset.name() }) ); context.history().on('change.intro', null); @@ -259,7 +259,7 @@ export function uiIntroArea(context, reveal) { if (first.classed('preset-leisure-playground')) { reveal(first.select('.preset-list-button').node(), - helpString('intro.areas.choose_playground', { preset: playgroundPreset.name() }), + helpHtml('intro.areas.choose_playground', { preset: playgroundPreset.name() }), { duration: 300 } ); @@ -331,7 +331,7 @@ export function uiIntroArea(context, reveal) { timeout(function() { reveal('.more-fields .combobox-input', - helpString('intro.areas.add_field', { + helpHtml('intro.areas.add_field', { name: nameField.label(), description: descriptionField.label() }), @@ -399,7 +399,7 @@ export function uiIntroArea(context, reveal) { }, 300); reveal('div.combobox', - helpString('intro.areas.choose_field', { field: descriptionField.label() }), + helpHtml('intro.areas.choose_field', { field: descriptionField.label() }), { duration: 300 } ); @@ -436,7 +436,7 @@ export function uiIntroArea(context, reveal) { }); reveal('.entity-editor-pane', - helpString('intro.areas.describe_playground', { button: icon('#iD-icon-close', 'inline') }), + helpHtml('intro.areas.describe_playground', { button: icon('#iD-icon-close', 'inline') }), { duration: 300 } ); @@ -460,8 +460,8 @@ export function uiIntroArea(context, reveal) { context.container().select('.inspector-wrap .panewrap').style('right', '0%'); reveal('.entity-editor-pane', - helpString('intro.areas.retry_add_field', { field: descriptionField.label() }), { - buttonText: t('intro.ok'), + helpHtml('intro.areas.retry_add_field', { field: descriptionField.label() }), { + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(clickAddField); } }); @@ -479,9 +479,9 @@ export function uiIntroArea(context, reveal) { function play() { dispatch.call('done'); reveal('.ideditor', - helpString('intro.areas.play', { next: t('intro.lines.title') }), { + helpHtml('intro.areas.play', { next: t('intro.lines.title') }), { tooltipBox: '.intro-nav-wrap .chapter-line', - buttonText: t('intro.ok'), + buttonText: t.html('intro.ok'), buttonCallback: function() { reveal('.ideditor'); } } ); diff --git a/modules/ui/intro/building.js b/modules/ui/intro/building.js index 1fc26ce23..3645738bb 100644 --- a/modules/ui/intro/building.js +++ b/modules/ui/intro/building.js @@ -9,7 +9,7 @@ import { t } from '../../core/localizer'; import { modeBrowse } from '../../modes/browse'; import { modeSelect } from '../../modes/select'; import { utilArrayUniq, utilRebind } from '../../util'; -import { helpString, icon, pad, isMostlySquare, selectMenuItem, transitionTime } from './helper'; +import { helpHtml, icon, pad, isMostlySquare, selectMenuItem, transitionTime } from './helper'; export function uiIntroBuilding(context, reveal) { @@ -65,7 +65,7 @@ export function uiIntroBuilding(context, reveal) { timeout(function() { var tooltip = reveal('button.add-area', - helpString('intro.buildings.add_building')); + helpHtml('intro.buildings.add_building')); tooltip.selectAll('.popover-inner') .insert('svg', 'span') @@ -95,8 +95,8 @@ export function uiIntroBuilding(context, reveal) { context.map().zoomEase(20, 500); timeout(function() { - var startString = helpString('intro.buildings.start_building') + - helpString('intro.buildings.building_corner_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')); + var startString = helpHtml('intro.buildings.start_building') + + helpHtml('intro.buildings.building_corner_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')); revealHouse(house, startString); context.map().on('move.intro drawn.intro', function() { @@ -125,9 +125,9 @@ export function uiIntroBuilding(context, reveal) { _houseID = null; - var continueString = helpString('intro.buildings.continue_building') + '{br}' + - helpString('intro.areas.finish_area_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + - helpString('intro.buildings.finish_building'); + var continueString = helpHtml('intro.buildings.continue_building') + '{br}' + + helpHtml('intro.areas.finish_area_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + + helpHtml('intro.buildings.finish_building'); revealHouse(house, continueString); @@ -168,13 +168,13 @@ export function uiIntroBuilding(context, reveal) { function retryHouse() { var onClick = function() { continueTo(addHouse); }; - revealHouse(house, helpString('intro.buildings.retry_building'), - { buttonText: t('intro.ok'), buttonCallback: onClick } + revealHouse(house, helpHtml('intro.buildings.retry_building'), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.map().on('move.intro drawn.intro', function() { - revealHouse(house, helpString('intro.buildings.retry_building'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: onClick } + revealHouse(house, helpHtml('intro.buildings.retry_building'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: onClick } ); }); @@ -204,7 +204,7 @@ export function uiIntroBuilding(context, reveal) { var button = context.container().select('.preset-category-building .preset-list-button'); reveal(button.node(), - helpString('intro.buildings.choose_category_building', { category: buildingCatetory.name() }) + helpHtml('intro.buildings.choose_category_building', { category: buildingCatetory.name() }) ); button.on('click.intro', function() { @@ -253,7 +253,7 @@ export function uiIntroBuilding(context, reveal) { var button = context.container().select('.preset-building-house .preset-list-button'); reveal(button.node(), - helpString('intro.buildings.choose_preset_house', { preset: housePreset.name() }), + helpHtml('intro.buildings.choose_preset_house', { preset: housePreset.name() }), { duration: 300 } ); @@ -300,7 +300,7 @@ export function uiIntroBuilding(context, reveal) { timeout(function() { reveal('.entity-editor-pane', - helpString('intro.buildings.close', { button: icon('#iD-icon-close', 'inline') }) + helpHtml('intro.buildings.close', { button: icon('#iD-icon-close', 'inline') }) ); }, 500); @@ -335,7 +335,7 @@ export function uiIntroBuilding(context, reveal) { }); context.map().on('move.intro drawn.intro', function() { - var rightclickString = helpString('intro.buildings.' + (context.lastPointerType() === 'mouse' ? 'rightclick_building' : 'edit_menu_building_touch')); + var rightclickString = helpHtml('intro.buildings.' + (context.lastPointerType() === 'mouse' ? 'rightclick_building' : 'edit_menu_building_touch')); revealHouse(house, rightclickString, { duration: 0 }); }); @@ -363,7 +363,7 @@ export function uiIntroBuilding(context, reveal) { var wasChanged = false; reveal('.edit-menu', - helpString('intro.buildings.square_building'), + helpHtml('intro.buildings.square_building'), { padding: 50 } ); @@ -380,7 +380,7 @@ export function uiIntroBuilding(context, reveal) { if (!wasChanged && !node) { return continueTo(rightClickHouse); } reveal('.edit-menu', - helpString('intro.buildings.square_building'), + helpHtml('intro.buildings.square_building'), { duration: 0, padding: 50 } ); }); @@ -411,8 +411,8 @@ export function uiIntroBuilding(context, reveal) { function retryClickSquare() { context.enter(modeBrowse(context)); - revealHouse(house, helpString('intro.buildings.retry_square'), { - buttonText: t('intro.ok'), + revealHouse(house, helpHtml('intro.buildings.retry_square'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(rightClickHouse); } }); @@ -425,8 +425,8 @@ export function uiIntroBuilding(context, reveal) { function doneSquare() { context.history().checkpoint('doneSquare'); - revealHouse(house, helpString('intro.buildings.done_square'), { - buttonText: t('intro.ok'), + revealHouse(house, helpHtml('intro.buildings.done_square'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(addTank); } }); @@ -447,7 +447,7 @@ export function uiIntroBuilding(context, reveal) { timeout(function() { reveal('button.add-area', - helpString('intro.buildings.add_tank') + helpHtml('intro.buildings.add_tank') ); context.on('enter.intro', function(mode) { @@ -471,8 +471,8 @@ export function uiIntroBuilding(context, reveal) { _tankID = null; timeout(function() { - var startString = helpString('intro.buildings.start_tank') + - helpString('intro.buildings.tank_edge_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')); + var startString = helpHtml('intro.buildings.start_tank') + + helpHtml('intro.buildings.tank_edge_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')); revealTank(tank, startString); context.map().on('move.intro drawn.intro', function() { @@ -501,9 +501,9 @@ export function uiIntroBuilding(context, reveal) { _tankID = null; - var continueString = helpString('intro.buildings.continue_tank') + '{br}' + - helpString('intro.areas.finish_area_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + - helpString('intro.buildings.finish_tank'); + var continueString = helpHtml('intro.buildings.continue_tank') + '{br}' + + helpHtml('intro.areas.finish_area_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + + helpHtml('intro.buildings.finish_tank'); revealTank(tank, continueString); @@ -551,7 +551,7 @@ export function uiIntroBuilding(context, reveal) { .on('keyup.intro', checkPresetSearch); reveal('.preset-search-input', - helpString('intro.buildings.search_tank', { preset: tankPreset.name() }) + helpHtml('intro.buildings.search_tank', { preset: tankPreset.name() }) ); }, 400); // after preset list pane visible.. @@ -575,7 +575,7 @@ export function uiIntroBuilding(context, reveal) { .on('keyup.intro', checkPresetSearch); reveal('.preset-search-input', - helpString('intro.buildings.search_tank', { preset: tankPreset.name() }) + helpHtml('intro.buildings.search_tank', { preset: tankPreset.name() }) ); context.history().on('change.intro', null); @@ -587,7 +587,7 @@ export function uiIntroBuilding(context, reveal) { if (first.classed('preset-man_made-storage_tank')) { reveal(first.select('.preset-list-button').node(), - helpString('intro.buildings.choose_tank', { preset: tankPreset.name() }), + helpHtml('intro.buildings.choose_tank', { preset: tankPreset.name() }), { duration: 300 } ); @@ -628,7 +628,7 @@ export function uiIntroBuilding(context, reveal) { timeout(function() { reveal('.entity-editor-pane', - helpString('intro.buildings.close', { button: icon('#iD-icon-close', 'inline') }) + helpHtml('intro.buildings.close', { button: icon('#iD-icon-close', 'inline') }) ); }, 500); @@ -659,7 +659,7 @@ export function uiIntroBuilding(context, reveal) { }, 50); // after menu visible }); - var rightclickString = helpString('intro.buildings.' + (context.lastPointerType() === 'mouse' ? 'rightclick_tank' : 'edit_menu_tank_touch')); + var rightclickString = helpHtml('intro.buildings.' + (context.lastPointerType() === 'mouse' ? 'rightclick_tank' : 'edit_menu_tank_touch')); revealTank(tank, rightclickString); @@ -693,7 +693,7 @@ export function uiIntroBuilding(context, reveal) { var wasChanged = false; reveal('.edit-menu', - helpString('intro.buildings.circle_tank'), + helpHtml('intro.buildings.circle_tank'), { padding: 50 } ); @@ -710,7 +710,7 @@ export function uiIntroBuilding(context, reveal) { if (!wasChanged && !node) { return continueTo(rightClickTank); } reveal('.edit-menu', - helpString('intro.buildings.circle_tank'), + helpHtml('intro.buildings.circle_tank'), { duration: 0, padding: 50 } ); }); @@ -741,8 +741,8 @@ export function uiIntroBuilding(context, reveal) { function retryClickCircle() { context.enter(modeBrowse(context)); - revealTank(tank, helpString('intro.buildings.retry_circle'), { - buttonText: t('intro.ok'), + revealTank(tank, helpHtml('intro.buildings.retry_circle'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(rightClickTank); } }); @@ -755,9 +755,9 @@ export function uiIntroBuilding(context, reveal) { function play() { dispatch.call('done'); reveal('.ideditor', - helpString('intro.buildings.play', { next: t('intro.startediting.title') }), { + helpHtml('intro.buildings.play', { next: t('intro.startediting.title') }), { tooltipBox: '.intro-nav-wrap .chapter-startEditing', - buttonText: t('intro.ok'), + buttonText: t.html('intro.ok'), buttonCallback: function() { reveal('.ideditor'); } } ); diff --git a/modules/ui/intro/helper.js b/modules/ui/intro/helper.js index 36ed94d92..f543ae888 100644 --- a/modules/ui/intro/helper.js +++ b/modules/ui/intro/helper.js @@ -44,10 +44,10 @@ export function icon(name, svgklass, useklass) { var helpStringReplacements; -// Returns the localized string for `id` with a standardized set of icon, key, and +// Returns the localized HTML element for `id` with a standardized set of icon, key, and // label replacements suitable for tutorials and documentation. Optionally supplemented // with custom `replacements` -export function helpString(id, replacements) { +export function helpHtml(id, replacements) { // only load these the first time if (!helpStringReplacements) helpStringReplacements = { // insert icons corresponding to various UI elements @@ -84,40 +84,40 @@ export function helpString(id, replacements) { shift: uiCmd.display('⇧'), alt: uiCmd.display('⌥'), return: uiCmd.display('↵'), - esc: t('shortcuts.key.esc'), - space: t('shortcuts.key.space'), - 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 }), + esc: t.html('shortcuts.key.esc'), + space: t.html('shortcuts.key.space'), + add_note_key: t.html('modes.add_note.key'), + help_key: t.html('help.key'), + shortcuts_key: t.html('shortcuts.toggle.key'), // reference localized UI labels directly so that they'll always match - save: t('save.title'), - undo: t('undo.title'), - redo: t('redo.title'), - upload: t('commit.save'), - point: t('modes.add_point.title'), - line: t('modes.add_line.title'), - area: t('modes.add_area.title'), - note: t('modes.add_note.label'), - delete: t('operations.delete.title'), - move: t('operations.move.title'), - orthogonalize: t('operations.orthogonalize.title'), - circularize: t('operations.circularize.title'), - merge: t('operations.merge.title'), - disconnect: t('operations.disconnect.title'), - split: t('operations.split.title'), - map_data: t('map_data.title'), - osm_notes: t('map_data.layers.notes.title'), - fields: t('inspector.fields'), - tags: t('inspector.tags'), - relations: t('inspector.relations'), - new_relation: t('inspector.new_relation'), - turn_restrictions: t('presets.fields.restrictions.label'), - background_settings: t('background.description'), - imagery_offset: t('background.fix_misalignment'), - start_the_walkthrough: t('splash.walkthrough'), - help: t('help.title'), - ok: t('intro.ok') + save: t.html('save.title'), + undo: t.html('undo.title'), + redo: t.html('redo.title'), + upload: t.html('commit.save'), + point: t.html('modes.add_point.title'), + line: t.html('modes.add_line.title'), + area: t.html('modes.add_area.title'), + note: t.html('modes.add_note.label'), + delete: t.html('operations.delete.title'), + move: t.html('operations.move.title'), + orthogonalize: t.html('operations.orthogonalize.title'), + circularize: t.html('operations.circularize.title'), + merge: t.html('operations.merge.title'), + disconnect: t.html('operations.disconnect.title'), + split: t.html('operations.split.title'), + map_data: t.html('map_data.title'), + osm_notes: t.html('map_data.layers.notes.title'), + fields: t.html('inspector.fields'), + tags: t.html('inspector.tags'), + relations: t.html('inspector.relations'), + new_relation: t.html('inspector.new_relation'), + turn_restrictions: t.html('presets.fields.restrictions.label'), + background_settings: t.html('background.description'), + imagery_offset: t.html('background.fix_misalignment'), + start_the_walkthrough: t.html('splash.walkthrough'), + help: t.html('help.title'), + ok: t.html('intro.ok') }; var reps; @@ -127,7 +127,7 @@ export function helpString(id, replacements) { reps = helpStringReplacements; } - return t(id, reps) + return t.html(id, reps) // use keyboard key styling for shortcuts .replace(/\`(.*?)\`/g, '$1'); } diff --git a/modules/ui/intro/intro.js b/modules/ui/intro/intro.js index 4391fd7b7..d316805b9 100644 --- a/modules/ui/intro/intro.js +++ b/modules/ui/intro/intro.js @@ -191,7 +191,7 @@ export function uiIntro(context) { buttons .append('span') - .html(d => t(d.title)); + .html(d => t.html(d.title)); buttons .append('span') diff --git a/modules/ui/intro/line.js b/modules/ui/intro/line.js index 72340fa9c..ba81244de 100644 --- a/modules/ui/intro/line.js +++ b/modules/ui/intro/line.js @@ -11,7 +11,7 @@ import { geoSphericalDistance } from '../../geo'; import { modeBrowse } from '../../modes/browse'; import { modeSelect } from '../../modes/select'; import { utilRebind } from '../../util/rebind'; -import { helpString, icon, pad, selectMenuItem, transitionTime } from './helper'; +import { helpHtml, icon, pad, selectMenuItem, transitionTime } from './helper'; export function uiIntroLine(context, reveal) { @@ -66,7 +66,7 @@ export function uiIntroLine(context, reveal) { timeout(function() { var tooltip = reveal('button.add-line', - helpString('intro.lines.add_line')); + helpHtml('intro.lines.add_line')); tooltip.selectAll('.popover-inner') .insert('svg', 'span') @@ -97,9 +97,9 @@ export function uiIntroLine(context, reveal) { box.height = box.height + 100; var textId = context.lastPointerType() === 'mouse' ? 'start_line' : 'start_line_tap'; - var startLineString = helpString('intro.lines.missing_road') + '{br}' + - helpString('intro.lines.line_draw_info') + - helpString('intro.lines.' + textId); + var startLineString = helpHtml('intro.lines.missing_road') + '{br}' + + helpHtml('intro.lines.line_draw_info') + + helpHtml('intro.lines.' + textId); reveal(box, startLineString); context.map().on('move.intro drawn.intro', function() { @@ -133,7 +133,7 @@ export function uiIntroLine(context, reveal) { var box = pad(tulipRoadMidpoint, padding, context); box.height = box.height * 2; reveal(box, - helpString('intro.lines.intersect', { name: t('intro.graph.name.flower-street') }) + helpHtml('intro.lines.intersect', { name: t('intro.graph.name.flower-street') }) ); context.map().on('move.intro drawn.intro', function() { @@ -141,7 +141,7 @@ export function uiIntroLine(context, reveal) { box = pad(tulipRoadMidpoint, padding, context); box.height = box.height * 2; reveal(box, - helpString('intro.lines.intersect', { name: t('intro.graph.name.flower-street') }), + helpHtml('intro.lines.intersect', { name: t('intro.graph.name.flower-street') }), { duration: 0 } ); }); @@ -191,7 +191,7 @@ export function uiIntroLine(context, reveal) { var box = pad(tulipRoadIntersection, 80, context); reveal(box, - helpString('intro.lines.retry_intersect', { name: t('intro.graph.name.flower-street') }) + helpHtml('intro.lines.retry_intersect', { name: t('intro.graph.name.flower-street') }) ); timeout(chapter.restart, 3000); @@ -205,9 +205,9 @@ export function uiIntroLine(context, reveal) { context.map().centerEase(tulipRoadIntersection, 500); - var continueLineText = helpString('intro.lines.continue_line') + '{br}' + - helpString('intro.lines.finish_line_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + - helpString('intro.lines.finish_road'); + var continueLineText = helpHtml('intro.lines.continue_line') + '{br}' + + helpHtml('intro.lines.finish_line_' + (context.lastPointerType() === 'mouse' ? 'click' : 'tap')) + + helpHtml('intro.lines.finish_road'); reveal('.surface', continueLineText); @@ -245,7 +245,7 @@ export function uiIntroLine(context, reveal) { context.container().select('.inspector-wrap .panewrap').style('right', '-100%'); reveal(button.node(), - helpString('intro.lines.choose_category_road', { category: roadCategory.name() }) + helpHtml('intro.lines.choose_category_road', { category: roadCategory.name() }) ); button.on('click.intro', function() { @@ -285,7 +285,7 @@ export function uiIntroLine(context, reveal) { timeout(function() { reveal(subgrid.node(), - helpString('intro.lines.choose_preset_residential', { preset: residentialPreset.name() }), + helpHtml('intro.lines.choose_preset_residential', { preset: residentialPreset.name() }), { tooltipBox: '.preset-highway-residential .preset-list-button', duration: 300 } ); }, 300); @@ -313,7 +313,7 @@ export function uiIntroLine(context, reveal) { var button = context.container().select('.entity-editor-pane .preset-list-button'); reveal(button.node(), - helpString('intro.lines.retry_preset_residential', { preset: residentialPreset.name() }) + helpHtml('intro.lines.retry_preset_residential', { preset: residentialPreset.name() }) ); button.on('click.intro', function() { @@ -338,7 +338,7 @@ export function uiIntroLine(context, reveal) { timeout(function() { reveal('.entity-editor-pane', - helpString('intro.lines.name_road', { button: icon('#iD-icon-close', 'inline') }), + helpHtml('intro.lines.name_road', { button: icon('#iD-icon-close', 'inline') }), { tooltipClass: 'intro-lines-name_road' } ); }, 500); @@ -354,8 +354,8 @@ export function uiIntroLine(context, reveal) { context.history().checkpoint('doneAddLine'); timeout(function() { - reveal('.surface', helpString('intro.lines.did_name_road'), { - buttonText: t('intro.ok'), + reveal('.surface', helpHtml('intro.lines.did_name_road'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(updateLine); } }); }, 500); @@ -381,15 +381,15 @@ export function uiIntroLine(context, reveal) { var box = pad(woodRoadDragMidpoint, padding, context); var advance = function() { continueTo(addNode); }; - reveal(box, helpString('intro.lines.update_line'), - { buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.update_line'), + { buttonText: t.html('intro.ok'), buttonCallback: advance } ); context.map().on('move.intro drawn.intro', function() { var padding = 250 * Math.pow(2, context.map().zoom() - 19); var box = pad(woodRoadDragMidpoint, padding, context); - reveal(box, helpString('intro.lines.update_line'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.update_line'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: advance } ); }); }, msec + 100); @@ -409,7 +409,7 @@ export function uiIntroLine(context, reveal) { var padding = 40 * Math.pow(2, context.map().zoom() - 19); var box = pad(woodRoadAddNode, padding, context); - var addNodeString = helpString('intro.lines.add_node' + (context.lastPointerType() === 'mouse' ? '' : '_touch')); + var addNodeString = helpHtml('intro.lines.add_node' + (context.lastPointerType() === 'mouse' ? '' : '_touch')); reveal(box, addNodeString); context.map().on('move.intro drawn.intro', function() { @@ -448,8 +448,8 @@ export function uiIntroLine(context, reveal) { } var padding = 100 * Math.pow(2, context.map().zoom() - 19); var box = pad(woodRoadDragEndpoint, padding, context); - var startDragString = helpString('intro.lines.start_drag_endpoint' + (context.lastPointerType() === 'mouse' ? '' : '_touch')) + - helpString('intro.lines.drag_to_intersection'); + var startDragString = helpHtml('intro.lines.start_drag_endpoint' + (context.lastPointerType() === 'mouse' ? '' : '_touch')) + + helpHtml('intro.lines.drag_to_intersection'); reveal(box, startDragString); context.map().on('move.intro drawn.intro', function() { @@ -480,8 +480,8 @@ export function uiIntroLine(context, reveal) { var padding = 100 * Math.pow(2, context.map().zoom() - 19); var box = pad(woodRoadDragEndpoint, padding, context); - var finishDragString = helpString('intro.lines.spot_looks_good') + - helpString('intro.lines.finish_drag_endpoint' + (context.lastPointerType() === 'mouse' ? '' : '_touch')); + var finishDragString = helpHtml('intro.lines.spot_looks_good') + + helpHtml('intro.lines.finish_drag_endpoint' + (context.lastPointerType() === 'mouse' ? '' : '_touch')); reveal(box, finishDragString); context.map().on('move.intro drawn.intro', function() { @@ -520,7 +520,7 @@ export function uiIntroLine(context, reveal) { var padding = 80 * Math.pow(2, context.map().zoom() - 19); var box = pad(woodRoadDragMidpoint, padding, context); - reveal(box, helpString('intro.lines.start_drag_midpoint')); + reveal(box, helpHtml('intro.lines.start_drag_midpoint')); context.map().on('move.intro drawn.intro', function() { if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) { @@ -528,7 +528,7 @@ export function uiIntroLine(context, reveal) { } var padding = 80 * Math.pow(2, context.map().zoom() - 19); var box = pad(woodRoadDragMidpoint, padding, context); - reveal(box, helpString('intro.lines.start_drag_midpoint'), { duration: 0 }); + reveal(box, helpHtml('intro.lines.start_drag_midpoint'), { duration: 0 }); }); context.history().on('change.intro', function(changed) { @@ -567,8 +567,8 @@ export function uiIntroLine(context, reveal) { continueTo(deleteLines); }; - reveal(box, helpString('intro.lines.continue_drag_midpoint'), - { buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.continue_drag_midpoint'), + { buttonText: t.html('intro.ok'), buttonCallback: advance } ); context.map().on('move.intro drawn.intro', function() { @@ -578,8 +578,8 @@ export function uiIntroLine(context, reveal) { var padding = 100 * Math.pow(2, context.map().zoom() - 19); var box = pad(woodRoadDragEndpoint, padding, context); box.height += 400; - reveal(box, helpString('intro.lines.continue_drag_midpoint'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.continue_drag_midpoint'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: advance } ); }); @@ -611,8 +611,8 @@ export function uiIntroLine(context, reveal) { box.height += 400; var advance = function() { continueTo(rightClickIntersection); }; - reveal(box, helpString('intro.lines.delete_lines', { street: t('intro.graph.name.12th-avenue') }), - { buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.delete_lines', { street: t('intro.graph.name.12th-avenue') }), + { buttonText: t.html('intro.ok'), buttonCallback: advance } ); context.map().on('move.intro drawn.intro', function() { @@ -620,8 +620,8 @@ export function uiIntroLine(context, reveal) { var box = pad(deleteLinesLoc, padding, context); box.top -= 200; box.height += 400; - reveal(box, helpString('intro.lines.delete_lines', { street: t('intro.graph.name.12th-avenue') }), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.delete_lines', { street: t('intro.graph.name.12th-avenue') }), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: advance } ); }); @@ -647,11 +647,11 @@ export function uiIntroLine(context, reveal) { context.map().centerZoomEase(eleventhAvenueEnd, 18, 500); - var rightClickString = helpString('intro.lines.split_street', { + var rightClickString = helpHtml('intro.lines.split_street', { street1: t('intro.graph.name.11th-avenue'), street2: t('intro.graph.name.washington-street') }) + - helpString('intro.lines.' + (context.lastPointerType() === 'mouse' ? 'rightclick_intersection' : 'edit_menu_intersection_touch')); + helpHtml('intro.lines.' + (context.lastPointerType() === 'mouse' ? 'rightclick_intersection' : 'edit_menu_intersection_touch')); timeout(function() { var padding = 60 * Math.pow(2, context.map().zoom() - 18); @@ -708,7 +708,7 @@ export function uiIntroLine(context, reveal) { var wasChanged = false; _washingtonSegmentID = null; - reveal('.edit-menu', helpString('intro.lines.split_intersection', + reveal('.edit-menu', helpHtml('intro.lines.split_intersection', { street: t('intro.graph.name.washington-street') }), { padding: 50 } ); @@ -717,7 +717,7 @@ export function uiIntroLine(context, reveal) { var node = selectMenuItem(context, 'split').node(); if (!wasChanged && !node) { return continueTo(rightClickIntersection); } - reveal('.edit-menu', helpString('intro.lines.split_intersection', + reveal('.edit-menu', helpHtml('intro.lines.split_intersection', { street: t('intro.graph.name.washington-street') }), { duration: 0, padding: 50 } ); @@ -751,15 +751,15 @@ export function uiIntroLine(context, reveal) { var padding = 60 * Math.pow(2, context.map().zoom() - 18); var box = pad(eleventhAvenueEnd, padding, context); - reveal(box, helpString('intro.lines.retry_split'), - { buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.retry_split'), + { buttonText: t.html('intro.ok'), buttonCallback: advance } ); context.map().on('move.intro drawn.intro', function() { var padding = 60 * Math.pow(2, context.map().zoom() - 18); var box = pad(eleventhAvenueEnd, padding, context); - reveal(box, helpString('intro.lines.retry_split'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: advance } + reveal(box, helpHtml('intro.lines.retry_split'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: advance } ); }); @@ -786,7 +786,7 @@ export function uiIntroLine(context, reveal) { var padding = 200 * Math.pow(2, context.map().zoom() - 18); var box = pad(twelfthAvenue, padding, context); box.width = box.width / 2; - reveal(box, helpString(string, { street1: street, street2: street }), + reveal(box, helpHtml(string, { street1: street, street2: street }), { duration: 500 } ); @@ -797,7 +797,7 @@ export function uiIntroLine(context, reveal) { var padding = 200 * Math.pow(2, context.map().zoom() - 18); var box = pad(twelfthAvenue, padding, context); box.width = box.width / 2; - reveal(box, helpString(string, { street1: street, street2: street }), + reveal(box, helpHtml(string, { street1: street, street2: street }), { duration: 0 } ); }); @@ -867,9 +867,9 @@ export function uiIntroLine(context, reveal) { } reveal(box, - helpString('intro.lines.multi_select', + helpHtml('intro.lines.multi_select', { selected: selected, other1: other }) + ' ' + - helpString('intro.lines.add_to_selection_' + (context.lastPointerType() === 'mouse' ? 'click' : 'touch'), + helpHtml('intro.lines.add_to_selection_' + (context.lastPointerType() === 'mouse' ? 'click' : 'touch'), { selected: selected, other2: other }) ); @@ -889,9 +889,9 @@ export function uiIntroLine(context, reveal) { } reveal(box, - helpString('intro.lines.multi_select', + helpHtml('intro.lines.multi_select', { selected: selected, other1: other }) + ' ' + - helpString('intro.lines.add_to_selection_' + (context.lastPointerType() === 'mouse' ? 'click' : 'touch'), + helpHtml('intro.lines.add_to_selection_' + (context.lastPointerType() === 'mouse' ? 'click' : 'touch'), { selected: selected, other2: other }), { duration: 0 } ); @@ -933,8 +933,8 @@ export function uiIntroLine(context, reveal) { var padding = 200 * Math.pow(2, context.map().zoom() - 18); var box = pad(twelfthAvenue, padding, context); - var rightClickString = helpString('intro.lines.multi_select_success') + - helpString('intro.lines.multi_' + (context.lastPointerType() === 'mouse' ? 'rightclick' : 'edit_menu_touch')); + var rightClickString = helpHtml('intro.lines.multi_select_success') + + helpHtml('intro.lines.multi_' + (context.lastPointerType() === 'mouse' ? 'rightclick' : 'edit_menu_touch')); reveal(box, rightClickString); context.map().on('move.intro drawn.intro', function() { @@ -995,13 +995,13 @@ export function uiIntroLine(context, reveal) { if (!node) return continueTo(multiRightClick); reveal('.edit-menu', - helpString('intro.lines.multi_delete'), + helpHtml('intro.lines.multi_delete'), { padding: 50 } ); context.map().on('move.intro drawn.intro', function() { reveal('.edit-menu', - helpString('intro.lines.multi_delete'), + helpHtml('intro.lines.multi_delete'), { duration: 0, padding: 50 } ); }); @@ -1034,8 +1034,8 @@ export function uiIntroLine(context, reveal) { var padding = 200 * Math.pow(2, context.map().zoom() - 18); var box = pad(twelfthAvenue, padding, context); - reveal(box, helpString('intro.lines.retry_delete'), { - buttonText: t('intro.ok'), + reveal(box, helpHtml('intro.lines.retry_delete'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(multiSelect); } }); @@ -1048,9 +1048,9 @@ export function uiIntroLine(context, reveal) { function play() { dispatch.call('done'); reveal('.ideditor', - helpString('intro.lines.play', { next: t('intro.buildings.title') }), { + helpHtml('intro.lines.play', { next: t('intro.buildings.title') }), { tooltipBox: '.intro-nav-wrap .chapter-building', - buttonText: t('intro.ok'), + buttonText: t.html('intro.ok'), buttonCallback: function() { reveal('.ideditor'); } } ); diff --git a/modules/ui/intro/navigation.js b/modules/ui/intro/navigation.js index 14a790022..b7841b09d 100644 --- a/modules/ui/intro/navigation.js +++ b/modules/ui/intro/navigation.js @@ -10,7 +10,7 @@ import { t } from '../../core/localizer'; import { modeBrowse } from '../../modes/browse'; import { modeSelect } from '../../modes/select'; import { utilRebind } from '../../util/rebind'; -import { helpString, icon, pointBox, transitionTime } from './helper'; +import { helpHtml, icon, pointBox, transitionTime } from './helper'; export function uiIntroNavigation(context, reveal) { @@ -59,7 +59,7 @@ export function uiIntroNavigation(context, reveal) { var centerStart = context.map().center(); var textId = context.lastPointerType() === 'mouse' ? 'drag' : 'drag_touch'; - var dragString = helpString('intro.navigation.map_info') + '{br}' + helpString('intro.navigation.' + textId); + var dragString = helpHtml('intro.navigation.map_info') + '{br}' + helpHtml('intro.navigation.' + textId); reveal('.surface', dragString); context.map().on('drawn.intro', function() { reveal('.surface', dragString, { duration: 0 }); @@ -86,7 +86,7 @@ export function uiIntroNavigation(context, reveal) { var zoomStart = context.map().zoom(); var textId = context.lastPointerType() === 'mouse' ? 'zoom' : 'zoom_touch'; - var zoomString = helpString('intro.navigation.' + textId); + var zoomString = helpHtml('intro.navigation.' + textId); reveal('.surface', zoomString); @@ -111,13 +111,13 @@ export function uiIntroNavigation(context, reveal) { function features() { var onClick = function() { continueTo(pointsLinesAreas); }; - reveal('.surface', helpString('intro.navigation.features'), - { buttonText: t('intro.ok'), buttonCallback: onClick } + reveal('.surface', helpHtml('intro.navigation.features'), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.map().on('drawn.intro', function() { - reveal('.surface', helpString('intro.navigation.features'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: onClick } + reveal('.surface', helpHtml('intro.navigation.features'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: onClick } ); }); @@ -130,13 +130,13 @@ export function uiIntroNavigation(context, reveal) { function pointsLinesAreas() { var onClick = function() { continueTo(nodesWays); }; - reveal('.surface', helpString('intro.navigation.points_lines_areas'), - { buttonText: t('intro.ok'), buttonCallback: onClick } + reveal('.surface', helpHtml('intro.navigation.points_lines_areas'), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.map().on('drawn.intro', function() { - reveal('.surface', helpString('intro.navigation.points_lines_areas'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: onClick } + reveal('.surface', helpHtml('intro.navigation.points_lines_areas'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: onClick } ); }); @@ -149,13 +149,13 @@ export function uiIntroNavigation(context, reveal) { function nodesWays() { var onClick = function() { continueTo(clickTownHall); }; - reveal('.surface', helpString('intro.navigation.nodes_ways'), - { buttonText: t('intro.ok'), buttonCallback: onClick } + reveal('.surface', helpHtml('intro.navigation.nodes_ways'), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.map().on('drawn.intro', function() { - reveal('.surface', helpString('intro.navigation.nodes_ways'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: onClick } + reveal('.surface', helpHtml('intro.navigation.nodes_ways'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: onClick } ); }); @@ -179,13 +179,13 @@ export function uiIntroNavigation(context, reveal) { if (!entity) return; var box = pointBox(entity.loc, context); var textId = context.lastPointerType() === 'mouse' ? 'click_townhall' : 'tap_townhall'; - reveal(box, helpString('intro.navigation.' + textId)); + reveal(box, helpHtml('intro.navigation.' + textId)); context.map().on('move.intro drawn.intro', function() { var entity = context.hasEntity(hallId); if (!entity) return; var box = pointBox(entity.loc, context); - reveal(box, helpString('intro.navigation.' + textId), { duration: 0 }); + reveal(box, helpHtml('intro.navigation.' + textId), { duration: 0 }); }); context.on('enter.intro', function() { @@ -218,16 +218,16 @@ export function uiIntroNavigation(context, reveal) { var box = pointBox(entity.loc, context); var onClick = function() { continueTo(editorTownHall); }; - reveal(box, helpString('intro.navigation.selected_townhall'), - { buttonText: t('intro.ok'), buttonCallback: onClick } + reveal(box, helpHtml('intro.navigation.selected_townhall'), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.map().on('move.intro drawn.intro', function() { var entity = context.hasEntity(hallId); if (!entity) return; var box = pointBox(entity.loc, context); - reveal(box, helpString('intro.navigation.selected_townhall'), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: onClick } + reveal(box, helpHtml('intro.navigation.selected_townhall'), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: onClick } ); }); @@ -254,8 +254,8 @@ export function uiIntroNavigation(context, reveal) { var onClick = function() { continueTo(presetTownHall); }; reveal('.entity-editor-pane', - helpString('intro.navigation.editor_townhall'), - { buttonText: t('intro.ok'), buttonCallback: onClick } + helpHtml('intro.navigation.editor_townhall'), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.on('exit.intro', function() { @@ -292,8 +292,8 @@ export function uiIntroNavigation(context, reveal) { var onClick = function() { continueTo(fieldsTownHall); }; reveal('.entity-editor-pane .section-feature-type', - helpString('intro.navigation.preset_townhall', { preset: preset.name() }), - { buttonText: t('intro.ok'), buttonCallback: onClick } + helpHtml('intro.navigation.preset_townhall', { preset: preset.name() }), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.on('exit.intro', function() { @@ -326,8 +326,8 @@ export function uiIntroNavigation(context, reveal) { var onClick = function() { continueTo(closeTownHall); }; reveal('.entity-editor-pane .section-preset-fields', - helpString('intro.navigation.fields_townhall'), - { buttonText: t('intro.ok'), buttonCallback: onClick } + helpHtml('intro.navigation.fields_townhall'), + { buttonText: t.html('intro.ok'), buttonCallback: onClick } ); context.on('exit.intro', function() { @@ -356,7 +356,7 @@ export function uiIntroNavigation(context, reveal) { var href = d3_select(selector).attr('href') || '#iD-icon-close'; reveal('.entity-editor-pane', - helpString('intro.navigation.close_townhall', { button: icon(href, 'inline') }) + helpHtml('intro.navigation.close_townhall', { button: icon(href, 'inline') }) ); context.on('exit.intro', function() { @@ -369,7 +369,7 @@ export function uiIntroNavigation(context, reveal) { var href = d3_select(selector).attr('href') || '#iD-icon-close'; reveal('.entity-editor-pane', - helpString('intro.navigation.close_townhall', { button: icon(href, 'inline') }), + helpHtml('intro.navigation.close_townhall', { button: icon(href, 'inline') }), { duration: 0 } ); }); @@ -392,7 +392,7 @@ export function uiIntroNavigation(context, reveal) { timeout(function() { reveal('.search-header input', - helpString('intro.navigation.search_street', { name: t('intro.graph.name.spring-street') }) + helpHtml('intro.navigation.search_street', { name: t('intro.graph.name.spring-street') }) ); context.container().select('.search-header input') @@ -408,7 +408,7 @@ export function uiIntroNavigation(context, reveal) { if (!firstName.empty() && firstName.html() === name) { reveal(first.node(), - helpString('intro.navigation.choose_street', { name: name }), + helpHtml('intro.navigation.choose_street', { name: name }), { duration: 300 } ); @@ -442,8 +442,8 @@ export function uiIntroNavigation(context, reveal) { box.height = 500; reveal(box, - helpString('intro.navigation.selected_street', { name: t('intro.graph.name.spring-street') }), - { duration: 600, buttonText: t('intro.ok'), buttonCallback: onClick } + helpHtml('intro.navigation.selected_street', { name: t('intro.graph.name.spring-street') }), + { duration: 600, buttonText: t.html('intro.ok'), buttonCallback: onClick } ); timeout(function() { @@ -453,8 +453,8 @@ export function uiIntroNavigation(context, reveal) { var box = pointBox(entity.loc, context); box.height = 500; reveal(box, - helpString('intro.navigation.selected_street', { name: t('intro.graph.name.spring-street') }), - { duration: 0, buttonText: t('intro.ok'), buttonCallback: onClick } + helpHtml('intro.navigation.selected_street', { name: t('intro.graph.name.spring-street') }), + { duration: 0, buttonText: t.html('intro.ok'), buttonCallback: onClick } ); }); }, 600); // after reveal. @@ -491,8 +491,8 @@ export function uiIntroNavigation(context, reveal) { var selector = '.entity-editor-pane button.close svg use'; var href = d3_select(selector).attr('href') || '#iD-icon-close'; - reveal('.entity-editor-pane', helpString('intro.navigation.street_different_fields') + '{br}' + - helpString('intro.navigation.editor_street', { + reveal('.entity-editor-pane', helpHtml('intro.navigation.street_different_fields') + '{br}' + + helpHtml('intro.navigation.editor_street', { button: icon(href, 'inline'), field1: onewayField.label(), field2: maxspeedField.label() @@ -507,8 +507,8 @@ export function uiIntroNavigation(context, reveal) { var selector = '.entity-editor-pane button.close svg use'; var href = d3_select(selector).attr('href') || '#iD-icon-close'; - reveal('.entity-editor-pane', helpString('intro.navigation.street_different_fields') + '{br}' + - helpString('intro.navigation.editor_street', { + reveal('.entity-editor-pane', helpHtml('intro.navigation.street_different_fields') + '{br}' + + helpHtml('intro.navigation.editor_street', { button: icon(href, 'inline'), field1: onewayField.label(), field2: maxspeedField.label() @@ -527,9 +527,9 @@ export function uiIntroNavigation(context, reveal) { function play() { dispatch.call('done'); reveal('.ideditor', - helpString('intro.navigation.play', { next: t('intro.points.title') }), { + helpHtml('intro.navigation.play', { next: t('intro.points.title') }), { tooltipBox: '.intro-nav-wrap .chapter-point', - buttonText: t('intro.ok'), + buttonText: t.html('intro.ok'), buttonCallback: function() { reveal('.ideditor'); } } ); diff --git a/modules/ui/intro/point.js b/modules/ui/intro/point.js index 19c871320..d0b75da5f 100644 --- a/modules/ui/intro/point.js +++ b/modules/ui/intro/point.js @@ -10,7 +10,7 @@ import { actionChangePreset } from '../../actions/change_preset'; import { modeBrowse } from '../../modes/browse'; import { modeSelect } from '../../modes/select'; import { utilRebind } from '../../util/rebind'; -import { helpString, icon, pointBox, pad, selectMenuItem, transitionTime } from './helper'; +import { helpHtml, icon, pointBox, pad, selectMenuItem, transitionTime } from './helper'; export function uiIntroPoint(context, reveal) { @@ -48,7 +48,7 @@ export function uiIntroPoint(context, reveal) { timeout(function() { var tooltip = reveal('button.add-point', - helpString('intro.points.points_info') + '{br}' + helpString('intro.points.add_point')); + helpHtml('intro.points.points_info') + '{br}' + helpHtml('intro.points.add_point')); _pointID = null; @@ -78,11 +78,11 @@ export function uiIntroPoint(context, reveal) { var pointBox = pad(building, 150, context); var textId = context.lastPointerType() === 'mouse' ? 'place_point' : 'place_point_touch'; - reveal(pointBox, helpString('intro.points.' + textId)); + reveal(pointBox, helpHtml('intro.points.' + textId)); context.map().on('move.intro drawn.intro', function() { pointBox = pad(building, 150, context); - reveal(pointBox, helpString('intro.points.' + textId), { duration: 0 }); + reveal(pointBox, helpHtml('intro.points.' + textId), { duration: 0 }); }); context.on('enter.intro', function(mode) { @@ -112,7 +112,7 @@ export function uiIntroPoint(context, reveal) { .on('keyup.intro', checkPresetSearch); reveal('.preset-search-input', - helpString('intro.points.search_cafe', { preset: cafePreset.name() }) + helpHtml('intro.points.search_cafe', { preset: cafePreset.name() }) ); context.on('enter.intro', function(mode) { @@ -133,7 +133,7 @@ export function uiIntroPoint(context, reveal) { .on('keyup.intro', checkPresetSearch); reveal('.preset-search-input', - helpString('intro.points.search_cafe', { preset: cafePreset.name() }) + helpHtml('intro.points.search_cafe', { preset: cafePreset.name() }) ); context.history().on('change.intro', null); @@ -150,7 +150,7 @@ export function uiIntroPoint(context, reveal) { .on('keyup.intro', null); reveal(first.select('.preset-list-button').node(), - helpString('intro.points.choose_cafe', { preset: cafePreset.name() }), + helpHtml('intro.points.choose_cafe', { preset: cafePreset.name() }), { duration: 300 } ); @@ -176,9 +176,9 @@ export function uiIntroPoint(context, reveal) { } timeout(function() { - reveal('.entity-editor-pane', helpString('intro.points.feature_editor'), { + reveal('.entity-editor-pane', helpHtml('intro.points.feature_editor'), { tooltipClass: 'intro-points-describe', - buttonText: t('intro.ok'), + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(addName); } }); }, 400); @@ -203,7 +203,7 @@ export function uiIntroPoint(context, reveal) { // reset pane, in case user happened to change it.. context.container().select('.inspector-wrap .panewrap').style('right', '0%'); - var addNameString = helpString('intro.points.fields_info') + '{br}' + helpString('intro.points.add_name'); + var addNameString = helpHtml('intro.points.fields_info') + '{br}' + helpHtml('intro.points.add_name'); timeout(function() { // It's possible for the user to add a name in a previous step.. @@ -213,7 +213,7 @@ export function uiIntroPoint(context, reveal) { if (entity.tags.name) { var tooltip = reveal('.entity-editor-pane', addNameString, { tooltipClass: 'intro-points-describe', - buttonText: t('intro.ok'), + buttonText: t.html('intro.ok'), buttonCallback: function() { continueTo(addCloseEditor); } }); tooltip.select('.instruction').style('display', 'none'); @@ -254,7 +254,7 @@ export function uiIntroPoint(context, reveal) { }); reveal('.entity-editor-pane', - helpString('intro.points.add_close', { button: icon(href, 'inline') }) + helpHtml('intro.points.add_close', { button: icon(href, 'inline') }) ); function continueTo(nextStep) { @@ -281,14 +281,14 @@ export function uiIntroPoint(context, reveal) { timeout(function() { var box = pointBox(entity.loc, context); - reveal(box, helpString('intro.points.reselect'), { duration: 600 }); + reveal(box, helpHtml('intro.points.reselect'), { duration: 600 }); timeout(function() { context.map().on('move.intro drawn.intro', function() { var entity = context.hasEntity(_pointID); if (!entity) return chapter.restart(); var box = pointBox(entity.loc, context); - reveal(box, helpString('intro.points.reselect'), { duration: 0 }); + reveal(box, helpHtml('intro.points.reselect'), { duration: 0 }); }); }, 600); // after reveal.. @@ -324,7 +324,7 @@ export function uiIntroPoint(context, reveal) { }); timeout(function() { - reveal('.entity-editor-pane', helpString('intro.points.update'), + reveal('.entity-editor-pane', helpHtml('intro.points.update'), { tooltipClass: 'intro-points-describe' } ); }, 400); @@ -351,7 +351,7 @@ export function uiIntroPoint(context, reveal) { timeout(function() { reveal('.entity-editor-pane', - helpString('intro.points.update_close', { button: icon('#iD-icon-close', 'inline') }) + helpHtml('intro.points.update_close', { button: icon('#iD-icon-close', 'inline') }) ); }, 500); @@ -371,14 +371,14 @@ export function uiIntroPoint(context, reveal) { var box = pointBox(entity.loc, context); var textId = context.lastPointerType() === 'mouse' ? 'rightclick' : 'edit_menu_touch'; - reveal(box, helpString('intro.points.' + textId), { duration: 600 }); + reveal(box, helpHtml('intro.points.' + textId), { duration: 600 }); timeout(function() { context.map().on('move.intro', function() { var entity = context.hasEntity(_pointID); if (!entity) return chapter.restart(); var box = pointBox(entity.loc, context); - reveal(box, helpString('intro.points.' + textId), { duration: 0 }); + reveal(box, helpHtml('intro.points.' + textId), { duration: 0 }); }); }, 600); // after reveal @@ -411,14 +411,14 @@ export function uiIntroPoint(context, reveal) { if (!node) { return continueTo(rightClickPoint); } reveal('.edit-menu', - helpString('intro.points.delete'), + helpHtml('intro.points.delete'), { padding: 50 } ); timeout(function() { context.map().on('move.intro', function() { reveal('.edit-menu', - helpString('intro.points.delete'), + helpHtml('intro.points.delete'), { duration: 0, padding: 50 } ); }); @@ -451,7 +451,7 @@ export function uiIntroPoint(context, reveal) { }); reveal('.top-toolbar button.undo-button', - helpString('intro.points.undo') + helpHtml('intro.points.undo') ); function continueTo(nextStep) { @@ -464,9 +464,9 @@ export function uiIntroPoint(context, reveal) { function play() { dispatch.call('done'); reveal('.ideditor', - helpString('intro.points.play', { next: t('intro.areas.title') }), { + helpHtml('intro.points.play', { next: t('intro.areas.title') }), { tooltipBox: '.intro-nav-wrap .chapter-area', - buttonText: t('intro.ok'), + buttonText: t.html('intro.ok'), buttonCallback: function() { reveal('.ideditor'); } } ); diff --git a/modules/ui/intro/start_editing.js b/modules/ui/intro/start_editing.js index d4ad7379e..fc28d11f6 100644 --- a/modules/ui/intro/start_editing.js +++ b/modules/ui/intro/start_editing.js @@ -4,7 +4,7 @@ import { } from 'd3-selection'; import { t } from '../../core/localizer'; -import { helpString } from './helper'; +import { helpHtml } from './helper'; import { uiModal } from '../modal'; import { utilRebind } from '../../util/rebind'; @@ -20,8 +20,8 @@ export function uiIntroStartEditing(context, reveal) { function showHelp() { reveal('.map-control.help-control', - helpString('intro.startediting.help'), { - buttonText: t('intro.ok'), + helpHtml('intro.startediting.help'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { shortcuts(); } } ); @@ -29,8 +29,8 @@ export function uiIntroStartEditing(context, reveal) { function shortcuts() { reveal('.map-control.help-control', - helpString('intro.startediting.shortcuts'), { - buttonText: t('intro.ok'), + helpHtml('intro.startediting.shortcuts'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { showSave(); } } ); @@ -39,8 +39,8 @@ export function uiIntroStartEditing(context, reveal) { function showSave() { context.container().selectAll('.shaded').remove(); // in case user opened keyboard shortcuts reveal('.top-toolbar button.save', - helpString('intro.startediting.save'), { - buttonText: t('intro.ok'), + helpHtml('intro.startediting.save'), { + buttonText: t.html('intro.ok'), buttonCallback: function() { showStart(); } } ); @@ -72,7 +72,7 @@ export function uiIntroStartEditing(context, reveal) { startbutton .append('h2') - .html(t('intro.startediting.start')); + .html(t.html('intro.startediting.start')); dispatch.call('startEditing'); } diff --git a/modules/ui/intro/welcome.js b/modules/ui/intro/welcome.js index d4300748d..31950c7d4 100644 --- a/modules/ui/intro/welcome.js +++ b/modules/ui/intro/welcome.js @@ -1,6 +1,6 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { helpString } from './helper'; +import { helpHtml } from './helper'; import { t } from '../../core/localizer'; import { utilRebind } from '../../util/rebind'; @@ -16,22 +16,22 @@ export function uiIntroWelcome(context, reveal) { function welcome() { context.map().centerZoom([-85.63591, 41.94285], 19); reveal('.intro-nav-wrap .chapter-welcome', - helpString('intro.welcome.welcome'), - { buttonText: t('intro.ok'), buttonCallback: practice } + helpHtml('intro.welcome.welcome'), + { buttonText: t.html('intro.ok'), buttonCallback: practice } ); } function practice() { reveal('.intro-nav-wrap .chapter-welcome', - helpString('intro.welcome.practice'), - { buttonText: t('intro.ok'), buttonCallback: words } + helpHtml('intro.welcome.practice'), + { buttonText: t.html('intro.ok'), buttonCallback: words } ); } function words() { reveal('.intro-nav-wrap .chapter-welcome', - helpString('intro.welcome.words'), - { buttonText: t('intro.ok'), buttonCallback: chapters } + helpHtml('intro.welcome.words'), + { buttonText: t.html('intro.ok'), buttonCallback: chapters } ); } @@ -39,7 +39,7 @@ export function uiIntroWelcome(context, reveal) { function chapters() { dispatch.call('done'); reveal('.intro-nav-wrap .chapter-navigation', - helpString('intro.welcome.chapters', { next: t('intro.navigation.title') }) + helpHtml('intro.welcome.chapters', { next: t('intro.navigation.title') }) ); } diff --git a/modules/ui/keepRight_details.js b/modules/ui/keepRight_details.js index 994df1bb6..9e46069fc 100644 --- a/modules/ui/keepRight_details.js +++ b/modules/ui/keepRight_details.js @@ -48,7 +48,7 @@ export function uiKeepRightDetails(context) { descriptionEnter .append('h4') - .html(() => t('QA.keepRight.detail_description')); + .html(t.html('QA.keepRight.detail_description')); descriptionEnter .append('div') diff --git a/modules/ui/keepRight_editor.js b/modules/ui/keepRight_editor.js index 25a5a1809..158929c23 100644 --- a/modules/ui/keepRight_editor.js +++ b/modules/ui/keepRight_editor.js @@ -35,7 +35,7 @@ export function uiKeepRightEditor(context) { headerEnter .append('h3') - .html(t('QA.keepRight.title')); + .html(t.html('QA.keepRight.title')); let body = selection.selectAll('.body') @@ -90,12 +90,12 @@ export function uiKeepRightEditor(context) { saveSectionEnter .append('h4') .attr('class', '.qa-save-header') - .html(t('QA.keepRight.comment')); + .html(t.html('QA.keepRight.comment')); saveSectionEnter .append('textarea') .attr('class', 'new-comment-input') - .attr('placeholder', t('QA.keepRight.comment_placeholder', { html: false })) + .attr('placeholder', t('QA.keepRight.comment_placeholder')) .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') - .html(t('QA.keepRight.save_comment')); + .html(t.html('QA.keepRight.save_comment')); buttonEnter .append('button') diff --git a/modules/ui/map_in_map.js b/modules/ui/map_in_map.js index c1a3f500c..ee5104854 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', { html: false }), toggle); + .on(t('background.minimap.key'), toggle); } return mapInMap; diff --git a/modules/ui/note_comments.js b/modules/ui/note_comments.js index 970bbfcc6..7c11bae57 100644 --- a/modules/ui/note_comments.js +++ b/modules/ui/note_comments.js @@ -54,7 +54,7 @@ export function uiNoteComments() { .attr('target', '_blank'); } selection - .html(function(d) { return d.user || t('note.anonymous'); }); + .html(function(d) { return d.user || t.html('note.anonymous'); }); }); metadataEnter diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index 3315b0aac..42ab69faf 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -54,7 +54,7 @@ export function uiNoteEditor(context) { headerEnter .append('h3') - .html(t('note.title')); + .html(t.html('note.title')); var body = selection.selectAll('.body') @@ -155,7 +155,7 @@ export function uiNoteEditor(context) { var commentTextarea = noteSaveEnter .append('textarea') .attr('class', 'new-comment-input') - .attr('placeholder', t('note.inputPlaceholder', { html: false })) + .attr('placeholder', t('note.inputPlaceholder')) .attr('maxlength', 1000) .property('value', function(d) { return d.newComment; }) .call(utilNoAuto) @@ -257,14 +257,14 @@ export function uiNoteEditor(context) { authEnter .append('span') - .html(t('note.login')); + .html(t.html('note.login')); authEnter .append('a') .attr('target', '_blank') .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .html(t('login')) + .html(t.html('login')) .on('click.note-login', function() { d3_event.preventDefault(); osm.authenticate(); @@ -285,7 +285,7 @@ export function uiNoteEditor(context) { prose = prose.enter() .append('p') .attr('class', 'note-save-prose') - .html(t('note.upload_explanation')) + .html(t.html('note.upload_explanation')) .merge(prose); osm.userDetails(function(err, user) { @@ -308,7 +308,7 @@ export function uiNoteEditor(context) { .attr('target', '_blank'); prose - .html(t('note.upload_explanation_with_user', { user: userLink.html() })); + .html(t.html('note.upload_explanation_with_user', { user: userLink.html() })); }); } @@ -334,12 +334,12 @@ export function uiNoteEditor(context) { buttonEnter .append('button') .attr('class', 'button cancel-button secondary-action') - .html(t('confirm.cancel')); + .html(t.html('confirm.cancel')); buttonEnter .append('button') .attr('class', 'button save-button action') - .html(t('note.save')); + .html(t.html('note.save')); } else { buttonEnter @@ -349,7 +349,7 @@ export function uiNoteEditor(context) { buttonEnter .append('button') .attr('class', 'button comment-button action') - .html(t('note.comment')); + .html(t.html('note.comment')); } diff --git a/modules/ui/note_report.js b/modules/ui/note_report.js index 64839c916..1f83355f3 100644 --- a/modules/ui/note_report.js +++ b/modules/ui/note_report.js @@ -30,7 +30,7 @@ export function uiNoteReport() { linkEnter .append('span') - .html(t('note.report')); + .html(t.html('note.report')); } diff --git a/modules/ui/notice.js b/modules/ui/notice.js index 64b4999c2..fcca76e49 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') - .html(t('zoom_in_edit')); + .html(t.html('zoom_in_edit')); function disableTooHigh() { diff --git a/modules/ui/osmose_details.js b/modules/ui/osmose_details.js index ecc14e246..fa6ee3af6 100644 --- a/modules/ui/osmose_details.js +++ b/modules/ui/osmose_details.js @@ -45,7 +45,7 @@ export function uiOsmoseDetails(context) { div .append('h4') - .html(() => t('QA.keepRight.detail_description')); + .html(t.html('QA.keepRight.detail_description')); div .append('p') @@ -73,7 +73,7 @@ export function uiOsmoseDetails(context) { div .append('h4') - .html(() => t('QA.osmose.fix_title')); + .html(t.html('QA.osmose.fix_title')); div .append('p') @@ -91,7 +91,7 @@ export function uiOsmoseDetails(context) { div .append('h4') - .html(() => t('QA.osmose.trap_title')); + .html(t.html('QA.osmose.trap_title')); div .append('p') @@ -118,7 +118,7 @@ export function uiOsmoseDetails(context) { if (d.detail) { detailsDiv .append('h4') - .html(() => t('QA.osmose.detail_title')); + .html(t.html('QA.osmose.detail_title')); detailsDiv .append('p') @@ -131,7 +131,7 @@ export function uiOsmoseDetails(context) { // Create list of linked issue elements elemsDiv .append('h4') - .html(() => t('QA.osmose.elems_title')); + .html(t.html('QA.osmose.elems_title')); elemsDiv .append('ul').selectAll('li') diff --git a/modules/ui/osmose_editor.js b/modules/ui/osmose_editor.js index bc7c7183b..17bdf8f22 100644 --- a/modules/ui/osmose_editor.js +++ b/modules/ui/osmose_editor.js @@ -35,7 +35,7 @@ export function uiOsmoseEditor(context) { headerEnter .append('h3') - .html(t('QA.osmose.title')); + .html(t.html('QA.osmose.title')); let body = selection.selectAll('.body') .data([0]); @@ -117,7 +117,7 @@ export function uiOsmoseEditor(context) { .merge(buttonEnter); buttonSection.select('.close-button') - .html(() => t('QA.keepRight.close')) + .html(t.html('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') - .html(() => t('QA.keepRight.ignore')) + .html(t.html('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/panels/background.js b/modules/ui/panels/background.js index b34451865..e8ae44074 100644 --- a/modules/ui/panels/background.js +++ b/modules/ui/panels/background.js @@ -46,7 +46,7 @@ export function uiPanelBackground(context) { .append('li') .attr('class', 'background-info-list-' + k) .classed('hide', !metadata[k]) - .html(t('info_panels.background.' + k) + ':') + .html(t.html('info_panels.background.' + k) + ':') .append('span') .attr('class', 'background-info-span-' + k) .html(metadata[k]); @@ -58,7 +58,7 @@ export function uiPanelBackground(context) { selection .append('a') - .html(t('info_panels.background.' + toggleTiles)) + .html(t.html('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') - .html(t('info_panels.background.' + toggleVintage)) + .html(t.html('info_panels.background.' + toggleVintage)) .attr('href', '#') .attr('class', 'button button-toggle-vintage') .on('click', function() { @@ -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', { html: false }); + panel.key = t('info_panels.background.key'); return panel; diff --git a/modules/ui/panels/history.js b/modules/ui/panels/history.js index 0ac7a075c..d477640a9 100644 --- a/modules/ui/panels/history.js +++ b/modules/ui/panels/history.js @@ -21,7 +21,7 @@ export function uiPanelHistory(context) { if (!userName) { selection .append('span') - .html(t('info_panels.history.unknown')); + .html(t.html('info_panels.history.unknown')); return; } @@ -57,7 +57,7 @@ export function uiPanelHistory(context) { if (!changeset) { selection .append('span') - .html(t('info_panels.history.unknown')); + .html(t.html('info_panels.history.unknown')); return; } @@ -118,7 +118,7 @@ export function uiPanelHistory(context) { selection .append('h4') .attr('class', 'history-heading') - .html(singular || t('info_panels.selected', { n: selected.length })); + .html(singular || t.html('info_panels.selected', { n: selected.length })); if (!singular) return; @@ -134,7 +134,7 @@ export function uiPanelHistory(context) { if (!note || note.isNew()) { selection .append('div') - .html(t('info_panels.history.note_no_history')); + .html(t.html('info_panels.history.note_no_history')); return; } @@ -143,20 +143,20 @@ export function uiPanelHistory(context) { list .append('li') - .html(t('info_panels.history.note_comments') + ':') + .html(t.html('info_panels.history.note_comments') + ':') .append('span') .html(note.comments.length); if (note.comments.length) { list .append('li') - .html(t('info_panels.history.note_created_date') + ':') + .html(t.html('info_panels.history.note_created_date') + ':') .append('span') .html(displayTimestamp(note.comments[0].date)); list .append('li') - .html(t('info_panels.history.note_created_user') + ':') + .html(t.html('info_panels.history.note_created_user') + ':') .call(displayUser, note.comments[0].user); } @@ -168,7 +168,7 @@ export function uiPanelHistory(context) { .attr('href', osm.noteURL(note)) .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .html(t('info_panels.history.note_link_text')); + .html(t.html('info_panels.history.note_link_text')); } } @@ -177,7 +177,7 @@ export function uiPanelHistory(context) { if (!entity || entity.isNew()) { selection .append('div') - .html(t('info_panels.history.no_history')); + .html(t.html('info_panels.history.no_history')); return; } @@ -191,7 +191,7 @@ export function uiPanelHistory(context) { .attr('class', 'view-history-on-osm') .attr('href', osm.historyURL(entity)) .attr('target', '_blank') - .attr('title', t('info_panels.history.link_text', { html: false })) + .attr('title', t('info_panels.history.link_text')) .html('OSM'); } links @@ -207,24 +207,24 @@ export function uiPanelHistory(context) { list .append('li') - .html(t('info_panels.history.version') + ':') + .html(t.html('info_panels.history.version') + ':') .append('span') .html(entity.version); list .append('li') - .html(t('info_panels.history.last_edit') + ':') + .html(t.html('info_panels.history.last_edit') + ':') .append('span') .html(displayTimestamp(entity.timestamp)); list .append('li') - .html(t('info_panels.history.edited_by') + ':') + .html(t.html('info_panels.history.edited_by') + ':') .call(displayUser, entity.user); list .append('li') - .html(t('info_panels.history.changeset') + ':') + .html(t.html('info_panels.history.changeset') + ':') .call(displayChangeset, entity.changeset); } @@ -250,7 +250,7 @@ export function uiPanelHistory(context) { panel.id = 'history'; panel.title = t('info_panels.history.title'); - panel.key = t('info_panels.history.key', { html: false }); + panel.key = t('info_panels.history.key'); return panel; diff --git a/modules/ui/panels/location.js b/modules/ui/panels/location.js index 50948363e..119c70c58 100644 --- a/modules/ui/panels/location.js +++ b/modules/ui/panels/location.js @@ -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', { html: false }); + panel.key = t('info_panels.location.key'); return panel; diff --git a/modules/ui/panels/measurement.js b/modules/ui/panels/measurement.js index 4ef63dfe0..f06057f59 100644 --- a/modules/ui/panels/measurement.js +++ b/modules/ui/panels/measurement.js @@ -120,7 +120,7 @@ export function uiPanelMeasurement(context) { if (geometry) { list .append('li') - .html(t('info_panels.measurement.geometry') + ':') + .html(t.html('info_panels.measurement.geometry') + ':') .append('span') .html( closed ? t('info_panels.measurement.closed_' + geometry) : t('geometry.' + geometry) @@ -130,7 +130,7 @@ export function uiPanelMeasurement(context) { if (totalNodeCount) { list .append('li') - .html(t('info_panels.measurement.node_count') + ':') + .html(t.html('info_panels.measurement.node_count') + ':') .append('span') .html(totalNodeCount.toLocaleString(localeCode)); } @@ -138,7 +138,7 @@ export function uiPanelMeasurement(context) { if (area) { list .append('li') - .html(t('info_panels.measurement.area') + ':') + .html(t.html('info_panels.measurement.area') + ':') .append('span') .html(displayArea(area, isImperial)); } @@ -155,7 +155,7 @@ export function uiPanelMeasurement(context) { if (location) { coordItem = list .append('li') - .html(t('info_panels.measurement.location') + ':'); + .html(t.html('info_panels.measurement.location') + ':'); coordItem.append('span') .html(dmsCoordinatePair(location)); coordItem.append('span') @@ -165,7 +165,7 @@ export function uiPanelMeasurement(context) { if (centroid) { coordItem = list .append('li') - .html(t('info_panels.measurement.centroid') + ':'); + .html(t.html('info_panels.measurement.centroid') + ':'); coordItem.append('span') .html(dmsCoordinatePair(centroid)); coordItem.append('span') @@ -175,7 +175,7 @@ export function uiPanelMeasurement(context) { if (center) { coordItem = list .append('li') - .html(t('info_panels.measurement.center') + ':'); + .html(t.html('info_panels.measurement.center') + ':'); coordItem.append('span') .html(dmsCoordinatePair(center)); coordItem.append('span') @@ -186,7 +186,7 @@ export function uiPanelMeasurement(context) { var toggle = isImperial ? 'imperial' : 'metric'; selection .append('a') - .html(t('info_panels.measurement.' + toggle)) + .html(t.html('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', { html: false }); + panel.key = t('info_panels.measurement.key'); return panel; diff --git a/modules/ui/panes/background.js b/modules/ui/panes/background.js index e66eb506f..3310c7b9e 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', { html: false })) + .key(t('background.key')) .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 3aff48741..16cfcbccd 100644 --- a/modules/ui/panes/help.js +++ b/modules/ui/panes/help.js @@ -9,7 +9,7 @@ import { uiPane } from '../pane'; import { t, localizer } from '../../core/localizer'; import { uiTooltip } from '../tooltip'; -import { helpString } from '../intro/helper'; +import { helpHtml } from '../intro/helper'; export function uiPaneHelp(context) { @@ -244,7 +244,7 @@ export function uiPaneHelp(context) { var subkey = helpkey + '.' + part; var depth = headings[subkey]; // is this subkey a heading? var hhh = depth ? Array(depth + 1).join('#') + ' ' : ''; // if so, prepend with some ##'s - return all + hhh + helpString(subkey, helpPaneReplacements) + '\n\n'; + return all + hhh + helpHtml(subkey, helpPaneReplacements) + '\n\n'; }, ''); return { @@ -257,7 +257,7 @@ export function uiPaneHelp(context) { }); var helpPane = uiPane('help', context) - .key(t('help.key', { html: false })) + .key(t('help.key')) .title(t('help.title')) .description(t('help.title')) .iconName('iD-icon-help'); @@ -364,7 +364,7 @@ export function uiPaneHelp(context) { shortcuts .append('div') - .html(t('shortcuts.title')); + .html(t.html('shortcuts.title')); var walkthrough = toc .append('li') @@ -381,7 +381,7 @@ export function uiPaneHelp(context) { walkthrough .append('div') - .html(t('splash.walkthrough')); + .html(t.html('splash.walkthrough')); var helpContent = content diff --git a/modules/ui/panes/issues.js b/modules/ui/panes/issues.js index 99af16ca6..6d7dd2b00 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', { html: false })) + .key(t('issues.key')) .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 db71f4f04..de2eae909 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', { html: false })) + .key(t('map_data.key')) .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 d48d23870..78bc33af8 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', { html: false })) + .key(t('preferences.key')) .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 50a8592ab..bc6a619d2 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') - .html(t('inspector.choose')); + .html(t.html('inspector.choose')); messagewrap .append('button') @@ -124,7 +124,7 @@ export function uiPresetList(context) { var search = searchWrap .append('input') .attr('class', 'preset-search-input') - .attr('placeholder', t('inspector.search', { html: false })) + .attr('placeholder', t('inspector.search')) .attr('type', 'search') .call(utilNoAuto) .on('keydown', initialKeydown) diff --git a/modules/ui/restore.js b/modules/ui/restore.js index f326eb374..3c715a373 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') - .html(t('restore.heading')); + .html(t.html('restore.heading')); introModal .append('div') .attr('class','modal-section') .append('p') - .html(t('restore.description')); + .html(t.html('restore.description')); let buttonWrap = introModal .append('div') @@ -45,7 +45,7 @@ export function uiRestore(context) { restore .append('div') - .html(t('restore.restore')); + .html(t.html('restore.restore')); let reset = buttonWrap .append('button') @@ -63,7 +63,7 @@ export function uiRestore(context) { reset .append('div') - .html(t('restore.reset')); + .html(t.html('restore.reset')); restore.node().focus(); }; diff --git a/modules/ui/sections/background_display_options.js b/modules/ui/sections/background_display_options.js index 21bec3a8a..eba11b43e 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') - .html(function(d) { return t('background.' + d); }) + .html(function(d) { return t.html('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', { html: false })) + .attr('title', t('background.reset')) .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', '#') - .html(t('background.reset_all')) + .html(t.html('background.reset_all')) .on('click', function() { for (var i = 0; i < _sliders.length; i++) { updateValue(_sliders[i],1); diff --git a/modules/ui/sections/background_list.js b/modules/ui/sections/background_list.js index b5b1b657c..91dd0896c 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', { html: false })]) + .keys([t('background.minimap.key')]) .placement('top') ); @@ -71,7 +71,7 @@ export function uiSectionBackgroundList(context) { minimapLabelEnter .append('span') - .html(t('background.minimap.description')); + .html(t.html('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', { html: false }))]) + .keys([uiCmd('⌘⇧' + t('info_panels.background.key'))]) .placement('top') ); @@ -94,7 +94,7 @@ export function uiSectionBackgroundList(context) { panelLabelEnter .append('span') - .html(t('background.panel.description')); + .html(t.html('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', { html: false }))]) + .keys([uiCmd('⌘⇧' + t('info_panels.location.key'))]) .placement('top') ); @@ -116,7 +116,7 @@ export function uiSectionBackgroundList(context) { locPanelLabelEnter .append('span') - .html(t('background.location_panel.description')); + .html(t.html('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') - .html(t('background.imagery_problem_faq')); + .html(t.html('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', { html: false }))]) + .keys([uiCmd('⌘' + t('background.key'))]) ); } else if (description || isOverflowing) { item.call(uiTooltip() diff --git a/modules/ui/sections/background_offset.js b/modules/ui/sections/background_offset.js index 219fe5874..da20b9688 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') - .html(t('background.offset')); + .html(t.html('background.offset')); var nudgeEnter = containerEnter .append('div') @@ -189,7 +189,7 @@ export function uiSectionBackgroundOffset(context) { containerEnter .append('button') - .attr('title', t('background.reset', { html: false })) + .attr('title', t('background.reset')) .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 b07daecc1..d786c3ee5 100644 --- a/modules/ui/sections/changes.js +++ b/modules/ui/sections/changes.js @@ -74,7 +74,7 @@ export function uiSectionChanges(context) { buttons .append('span') .attr('class', 'change-type') - .html(function(d) { return t('commit.' + d.changeType) + ' '; }); + .html(function(d) { return t.html('commit.' + d.changeType) + ' '; }); buttons .append('strong') @@ -132,7 +132,7 @@ export function uiSectionChanges(context) { linkEnter .call(svgIcon('#iD-icon-load', 'inline')) .append('span') - .html(t('commit.download_changes')); + .html(t.html('commit.download_changes')); function mouseover(d) { diff --git a/modules/ui/sections/data_layers.js b/modules/ui/sections/data_layers.js index 76c38f8e7..a62299151 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', { html: false }))]) + .keys([uiCmd('⌥' + t('area_fill.wireframe.key'))]) .placement('bottom') ); } else { @@ -116,7 +116,7 @@ export function uiSectionDataLayers(context) { labelEnter .append('span') - .html(function(d) { return t('map_data.layers.' + d.id + '.title'); }); + .html(function(d) { return t.html('map_data.layers.' + d.id + '.title'); }); // Update @@ -167,7 +167,7 @@ export function uiSectionDataLayers(context) { labelEnter .append('span') - .html(function(d) { return t('map_data.layers.' + d.id + '.title'); }); + .html(function(d) { return t.html('map_data.layers.' + d.id + '.title'); }); // Update @@ -325,7 +325,7 @@ export function uiSectionDataLayers(context) { labelEnter .append('span') - .html(t('map_data.layers.custom.title')); + .html(t.html('map_data.layers.custom.title')); liEnter .append('button') @@ -400,7 +400,7 @@ export function uiSectionDataLayers(context) { .append('label') .call(uiTooltip() .title(t('map_data.history_panel.tooltip')) - .keys([uiCmd('⌘⇧' + t('info_panels.history.key', { html: false }))]) + .keys([uiCmd('⌘⇧' + t('info_panels.history.key'))]) .placement('top') ); @@ -414,7 +414,7 @@ export function uiSectionDataLayers(context) { historyPanelLabelEnter .append('span') - .html(t('map_data.history_panel.title')); + .html(t.html('map_data.history_panel.title')); var measurementPanelLabelEnter = panelsListEnter .append('li') @@ -422,7 +422,7 @@ export function uiSectionDataLayers(context) { .append('label') .call(uiTooltip() .title(t('map_data.measurement_panel.tooltip')) - .keys([uiCmd('⌘⇧' + t('info_panels.measurement.key', { html: false }))]) + .keys([uiCmd('⌘⇧' + t('info_panels.measurement.key'))]) .placement('top') ); @@ -436,7 +436,7 @@ export function uiSectionDataLayers(context) { measurementPanelLabelEnter .append('span') - .html(t('map_data.measurement_panel.title')); + .html(t.html('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 835de9978..4bbcab3a6 100644 --- a/modules/ui/sections/entity_issues.js +++ b/modules/ui/sections/entity_issues.js @@ -110,7 +110,7 @@ export function uiSectionEntityIssues(context) { var infoButton = labelsEnter .append('button') .attr('class', 'issue-info-button') - .attr('title', t('icons.information', { html: false })) + .attr('title', t('icons.information')) .call(svgIcon('#iD-icon-inspect')); infoButton @@ -160,7 +160,7 @@ export function uiSectionEntityIssues(context) { .call(d.reference); } else { d3_select(this) - .html(t('inspector.no_documentation_key')); + .html(t.html('inspector.no_documentation_key')); } }); diff --git a/modules/ui/sections/map_features.js b/modules/ui/sections/map_features.js index 78e5f8e31..f9733af53 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', '#') - .html(t('issues.disable_all')) + .html(t.html('issues.disable_all')) .on('click', function() { context.features().disableAll(); }); @@ -41,7 +41,7 @@ export function uiSectionMapFeatures(context) { .append('a') .attr('class', 'feature-list-link') .attr('href', '#') - .html(t('issues.enable_all')) + .html(t.html('issues.enable_all')) .on('click', function() { context.features().enableAll(); }); @@ -88,7 +88,7 @@ export function uiSectionMapFeatures(context) { label .append('span') - .html(function(d) { return t(name + '.' + d + '.description'); }); + .html(function(d) { return t.html(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 53cc70ca1..af8f063fd 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', { html: false }) : null); - if (d === 'highlight_edits') key = t('map_data.highlight_edits.key', { html: false }); + var key = (d === 'wireframe' ? t('area_fill.wireframe.key') : null); + if (d === 'highlight_edits') key = t('map_data.highlight_edits.key'); return key ? [key] : null; }) .placement('top') @@ -69,7 +69,7 @@ export function uiSectionMapStyleOptions(context) { label .append('span') - .html(function(d) { return t(name + '.' + d + '.description'); }); + .html(function(d) { return t.html(name + '.' + d + '.description'); }); // Update items = items diff --git a/modules/ui/sections/privacy.js b/modules/ui/sections/privacy.js index 60298c3b1..46815e48e 100644 --- a/modules/ui/sections/privacy.js +++ b/modules/ui/sections/privacy.js @@ -45,7 +45,7 @@ export function uiSectionPrivacy(context) { thirdPartyIconsEnter .append('span') - .html(t('preferences.privacy.third_party_icons.description')); + .html(t.html('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') - .html(t('preferences.privacy.privacy_link')); + .html(t.html('preferences.privacy.privacy_link')); update(); diff --git a/modules/ui/sections/raw_member_editor.js b/modules/ui/sections/raw_member_editor.js index d40735007..c392441fa 100644 --- a/modules/ui/sections/raw_member_editor.js +++ b/modules/ui/sections/raw_member_editor.js @@ -199,14 +199,14 @@ export function uiSectionRawMemberEditor(context) { label .append('button') - .attr('title', t('icons.remove', { html: false })) + .attr('title', t('icons.remove')) .attr('class', 'remove member-delete') .call(svgIcon('#iD-operation-delete')); label .append('button') .attr('class', 'member-zoom') - .attr('title', t('icons.zoom_to', { html: false })) + .attr('title', t('icons.zoom_to')) .call(svgIcon('#iD-icon-framed-dot', 'monochrome')) .on('click', zoomToMember); @@ -218,17 +218,17 @@ export function uiSectionRawMemberEditor(context) { labelText .append('span') .attr('class', 'member-entity-type') - .html(t('inspector.' + d.type, { id: d.id })); + .html(t.html('inspector.' + d.type, { id: d.id })); labelText .append('span') .attr('class', 'member-entity-name') - .html(t('inspector.incomplete', { id: d.id })); + .html(t.html('inspector.incomplete', { id: d.id })); label .append('button') .attr('class', 'member-download') - .attr('title', t('icons.download', { html: false })) + .attr('title', t('icons.download')) .call(svgIcon('#iD-icon-load')) .on('click', downloadMember); } @@ -245,7 +245,7 @@ export function uiSectionRawMemberEditor(context) { return d.domId; }) .property('type', 'text') - .attr('placeholder', t('inspector.role', { html: false })) + .attr('placeholder', t('inspector.role')) .call(utilNoAuto); if (taginfo) { diff --git a/modules/ui/sections/raw_membership_editor.js b/modules/ui/sections/raw_membership_editor.js index 9060d722f..760787ba0 100644 --- a/modules/ui/sections/raw_membership_editor.js +++ b/modules/ui/sections/raw_membership_editor.js @@ -281,7 +281,7 @@ export function uiSectionRawMembershipEditor(context) { labelEnter .append('button') .attr('class', 'member-zoom') - .attr('title', t('icons.zoom_to', { html: false })) + .attr('title', t('icons.zoom_to')) .call(svgIcon('#iD-icon-framed-dot', 'monochrome')) .on('click', zoomToRelation); @@ -296,7 +296,7 @@ export function uiSectionRawMembershipEditor(context) { return d.domId; }) .property('type', 'text') - .attr('placeholder', t('inspector.role', { html: false })) + .attr('placeholder', t('inspector.role')) .call(utilNoAuto) .property('value', function(d) { return d.member.role; }) .on('blur', changeRole) @@ -325,7 +325,7 @@ export function uiSectionRawMembershipEditor(context) { newLabelEnter .append('input') - .attr('placeholder', t('inspector.choose_relation', { html: false })) + .attr('placeholder', t('inspector.choose_relation')) .attr('type', 'text') .attr('class', 'member-entity-input') .call(utilNoAuto); @@ -347,7 +347,7 @@ export function uiSectionRawMembershipEditor(context) { .append('input') .attr('class', 'member-role') .property('type', 'text') - .attr('placeholder', t('inspector.role', { html: false })) + .attr('placeholder', t('inspector.role')) .call(utilNoAuto); // Update diff --git a/modules/ui/sections/raw_tag_editor.js b/modules/ui/sections/raw_tag_editor.js index 27438b043..add6f01f1 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, { html: false }); }) + .attr('title', function(d) { return t('icons.' + d.id); }) .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', { html: false })) + .attr('placeholder', t('inspector.key_value')) .attr('spellcheck', 'false') .merge(textarea); @@ -205,7 +205,7 @@ export function uiSectionRawTagEditor(id, context) { innerWrap .append('button') .attr('class', 'form-field-button remove') - .attr('title', t('icons.remove', { html: false })) + .attr('title', t('icons.remove')) .call(svgIcon('#iD-operation-delete')); @@ -257,7 +257,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', { html: false }); + return typeof d.value === 'string' ? null : t('inspector.multiple_values'); }) .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 23eaad67d..e94a7fee3 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', { html: false })) + .attr('title', t('icons.deselect')) .on('click', deselectEntity) .call(svgIcon('#iD-icon-close')); diff --git a/modules/ui/sections/validation_issues.js b/modules/ui/sections/validation_issues.js index d0c7e6c23..c5e27adf8 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', { html: false })) + .attr('title', t('issues.fix_one.title')) .datum(d.autoFix) // set button datum to the autofix .attr('class', 'autofix action') .on('click', function(d) { @@ -175,7 +175,7 @@ export function uiSectionValidationIssues(id, severity, context) { linkEnter .append('span') .attr('class', 'autofix-all-link-text') - .html(t('issues.fix_all.title')); + .html(t.html('issues.fix_all.title')); linkEnter .append('span') diff --git a/modules/ui/sections/validation_options.js b/modules/ui/sections/validation_options.js index c95cc4087..cac0261d1 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') - .html(function(d) { return t('issues.options.' + d.key + '.title'); }); + .html(function(d) { return t.html('issues.options.' + d.key + '.title'); }); var valuesEnter = optionsEnter.selectAll('label') .data(function(d) { @@ -55,7 +55,7 @@ export function uiSectionValidationOptions(context) { valuesEnter .append('span') - .html(function(d) { return t('issues.options.' + d.key + '.' + d.value); }); + .html(function(d) { return t.html('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 96f2ec9f6..94099a6f3 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', '#') - .html(t('issues.disable_all')) + .html(t.html('issues.disable_all')) .on('click', function() { context.validator().disableRules(_ruleKeys); }); @@ -55,7 +55,7 @@ export function uiSectionValidationRules(context) { .append('a') .attr('class', 'issue-rules-link') .attr('href', '#') - .html(t('issues.enable_all')) + .html(t.html('issues.enable_all')) .on('click', function() { context.validator().disableRules([]); }); diff --git a/modules/ui/sections/validation_status.js b/modules/ui/sections/validation_status.js index 87afef901..17ae06c27 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') - .html(t('issues.reset_ignored', { count: ignoredIssues.length.toString() })); + .html(t.html('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') - .html(t( + .html(t.html( 'issues.no_issues.hidden_issues.' + type, { count: hiddenIssues.length.toString() } )); @@ -103,7 +103,7 @@ export function uiSectionValidationStatus(context) { } } selection.select('.box .details') - .html(t('issues.no_issues.hidden_issues.none')); + .html(t.html('issues.no_issues.hidden_issues.none')); } var messageType; @@ -158,7 +158,7 @@ export function uiSectionValidationStatus(context) { } selection.select('.box .message') - .html(t('issues.no_issues.message.' + messageType)); + .html(t.html('issues.no_issues.message.' + messageType)); } diff --git a/modules/ui/settings/custom_background.js b/modules/ui/settings/custom_background.js index f277ef522..e6804eb0d 100644 --- a/modules/ui/settings/custom_background.js +++ b/modules/ui/settings/custom_background.js @@ -27,28 +27,28 @@ export function uiSettingsCustomBackground() { modal.select('.modal-section.header') .append('h3') - .html(t('settings.custom_background.header')); + .html(t.html('settings.custom_background.header')); var textSection = modal.select('.modal-section.message-text'); var instructions = - `${t('settings.custom_background.instructions.info')}\n` + + `${t.html('settings.custom_background.instructions.info')}\n` + '\n' + - `#### ${t('settings.custom_background.instructions.wms.tokens_label')}\n` + - `* ${t('settings.custom_background.instructions.wms.tokens.proj')}\n` + - `* ${t('settings.custom_background.instructions.wms.tokens.wkid')}\n` + - `* ${t('settings.custom_background.instructions.wms.tokens.dimensions')}\n` + - `* ${t('settings.custom_background.instructions.wms.tokens.bbox')}\n` + + `#### ${t.html('settings.custom_background.instructions.wms.tokens_label')}\n` + + `* ${t.html('settings.custom_background.instructions.wms.tokens.proj')}\n` + + `* ${t.html('settings.custom_background.instructions.wms.tokens.wkid')}\n` + + `* ${t.html('settings.custom_background.instructions.wms.tokens.dimensions')}\n` + + `* ${t.html('settings.custom_background.instructions.wms.tokens.bbox')}\n` + '\n' + - `#### ${t('settings.custom_background.instructions.tms.tokens_label')}\n` + - `* ${t('settings.custom_background.instructions.tms.tokens.xyz')}\n` + - `* ${t('settings.custom_background.instructions.tms.tokens.flipped_y')}\n` + - `* ${t('settings.custom_background.instructions.tms.tokens.switch')}\n` + - `* ${t('settings.custom_background.instructions.tms.tokens.quadtile')}\n` + - `* ${t('settings.custom_background.instructions.tms.tokens.scale_factor')}\n` + + `#### ${t.html('settings.custom_background.instructions.tms.tokens_label')}\n` + + `* ${t.html('settings.custom_background.instructions.tms.tokens.xyz')}\n` + + `* ${t.html('settings.custom_background.instructions.tms.tokens.flipped_y')}\n` + + `* ${t.html('settings.custom_background.instructions.tms.tokens.switch')}\n` + + `* ${t.html('settings.custom_background.instructions.tms.tokens.quadtile')}\n` + + `* ${t.html('settings.custom_background.instructions.tms.tokens.scale_factor')}\n` + '\n' + - `#### ${t('settings.custom_background.instructions.example')}\n` + + `#### ${t.html('settings.custom_background.instructions.example')}\n` + `\`${example}\``; textSection @@ -59,7 +59,7 @@ export function uiSettingsCustomBackground() { textSection .append('textarea') .attr('class', 'field-template') - .attr('placeholder', t('settings.custom_background.template.placeholder', { html: false })) + .attr('placeholder', t('settings.custom_background.template.placeholder')) .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') - .html(t('confirm.cancel')); + .html(t.html('confirm.cancel')); buttonSection.select('.cancel-button') diff --git a/modules/ui/settings/custom_data.js b/modules/ui/settings/custom_data.js index b1cf7390f..3d39f2097 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') - .html(t('settings.custom_data.header')); + .html(t.html('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') - .html(t('settings.custom_data.file.instructions')); + .html(t.html('settings.custom_data.file.instructions')); textSection .append('input') @@ -59,17 +59,17 @@ export function uiSettingsCustomData(context) { textSection .append('h4') - .html(t('settings.custom_data.or')); + .html(t.html('settings.custom_data.or')); textSection .append('pre') .attr('class', 'instructions-url') - .html(t('settings.custom_data.url.instructions')); + .html(t.html('settings.custom_data.url.instructions')); textSection .append('textarea') .attr('class', 'field-url') - .attr('placeholder', t('settings.custom_data.url.placeholder', { html: false })) + .attr('placeholder', t('settings.custom_data.url.placeholder')) .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') - .html(t('confirm.cancel')); + .html(t.html('confirm.cancel')); buttonSection.select('.cancel-button') diff --git a/modules/ui/shortcuts.js b/modules/ui/shortcuts.js index 13cc3d490..2708e467b 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', { html: false }), '?'], function () { + .on([t('shortcuts.toggle.key'), '?'], 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') - .html(t('shortcuts.title')); + .html(t.html('shortcuts.title')); fileFetcher.get('shortcuts') .then(function(data) { content.call(render, data); }) @@ -85,7 +85,7 @@ export function uiShortcuts(context) { tabsEnter .append('span') - .html(function (d) { return t(d.text); }); + .html(function (d) { return t.html(d.text); }); tabs = tabs .merge(tabsEnter); @@ -131,7 +131,7 @@ export function uiShortcuts(context) { .append('td') .attr('class', 'shortcut-section') .append('h3') - .html(function (d) { return t(d.text); }); + .html(function (d) { return t.html(d.text); }); var shortcutRows = rowsEnter @@ -217,7 +217,7 @@ export function uiShortcuts(context) { if (i < nodes.length - 1) { selection .append('span') - .html(d.separator || '\u00a0' + t('shortcuts.or') + '\u00a0'); + .html(d.separator || '\u00a0' + t.html('shortcuts.or') + '\u00a0'); } else if (i === nodes.length - 1 && d.suffix) { selection .append('span') @@ -238,14 +238,14 @@ export function uiShortcuts(context) { selection .append('span') .attr('class', 'gesture') - .html(function (d) { return t(d.gesture); }); + .html(function (d) { return t.html(d.gesture); }); }); shortcutRows .append('td') .attr('class', 'shortcut-desc') - .html(function (d) { return d.text ? t(d.text) : '\u00a0'; }); + .html(function (d) { return d.text ? t.html(d.text) : '\u00a0'; }); shortcuts = shortcuts diff --git a/modules/ui/source_switch.js b/modules/ui/source_switch.js index 6ea6cfb78..9a665aa11 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) - .html(isLive ? t('source_switch.live') : t('source_switch.dev')) + .html(isLive ? t.html('source_switch.live') : t.html('source_switch.dev')) .classed('live', isLive) .classed('chip', isLive); @@ -42,7 +42,7 @@ export function uiSourceSwitch(context) { selection .append('a') .attr('href', '#') - .html(t('source_switch.live')) + .html(t.html('source_switch.live')) .attr('class', 'live chip') .on('click', click); }; diff --git a/modules/ui/splash.js b/modules/ui/splash.js index 8eddd22e3..03bad2988 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') - .html(t('splash.welcome')); + .html(t.html('splash.welcome')); let modalSection = introModal .append('div') @@ -50,7 +50,7 @@ export function uiSplash(context) { modalSection .append('p') - .html(t('splash.text', { + .html(t.html('splash.text', { version: context.version, website: 'ideditor.blog', github: 'github.com' @@ -58,7 +58,7 @@ export function uiSplash(context) { modalSection .append('p') - .html(t('splash.privacy', { + .html(t.html('splash.privacy', { updateMessage: updateMessage, privacyLink: '' + t('splash.privacy_policy') + '' @@ -84,7 +84,7 @@ export function uiSplash(context) { walkthrough .append('div') - .html(t('splash.walkthrough')); + .html(t.html('splash.walkthrough')); let startEditing = buttonWrap .append('button') @@ -99,7 +99,7 @@ export function uiSplash(context) { startEditing .append('div') - .html(t('splash.start')); + .html(t.html('splash.start')); modalSelection.select('button.close') .attr('class','hide'); diff --git a/modules/ui/status.js b/modules/ui/status.js index 8c93f6688..6b1729fcf 100644 --- a/modules/ui/status.js +++ b/modules/ui/status.js @@ -23,13 +23,13 @@ export function uiStatus(context) { } else if (apiStatus === 'rateLimited') { selection - .html(t('osm_api_status.message.rateLimit')) + .html(t.html('osm_api_status.message.rateLimit')) .append('a') .attr('class', 'api-status-login') .attr('target', '_blank') .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .html(t('login')) + .html(t.html('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 - .html(t('osm_api_status.message.error') + ' ') + .html(t.html('osm_api_status.message.error') + ' ') .append('a') // let the user manually retry their connection directly - .html(t('osm_api_status.retry')) + .html(t.html('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.html(t('osm_api_status.message.readonly')); + selection.html(t.html('osm_api_status.message.readonly')); } else if (apiStatus === 'offline') { - selection.html(t('osm_api_status.message.offline')); + selection.html(t.html('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 f07671361..d01aa1c2e 100644 --- a/modules/ui/success.js +++ b/modules/ui/success.js @@ -74,7 +74,7 @@ export function uiSuccess(context) { header .append('h3') - .html(t('success.just_edited')); + .html(t.html('success.just_edited')); header .append('button') @@ -92,18 +92,18 @@ export function uiSuccess(context) { summary .append('h3') - .html(t('success.thank_you' + (_location ? '_location' : ''), { where: _location })); + .html(t.html('success.thank_you' + (_location ? '_location' : ''), { where: _location })); summary .append('p') - .html(t('success.help_html')) + .html(t.html('success.help_html')) .append('a') .attr('class', 'link-out') .attr('target', '_blank') .attr('href', t('success.help_link_url')) .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .html(t('success.help_link_text')); + .html(t.html('success.help_link_text')); let osm = context.connection(); if (!osm) return; @@ -138,11 +138,11 @@ export function uiSuccess(context) { .attr('class', 'cell-detail summary-view-on-osm') .attr('target', '_blank') .attr('href', changesetURL) - .html(t('success.view_on_osm')); + .html(t.html('success.view_on_osm')); summaryDetail .append('div') - .html(t('success.changeset_id', { + .html(t.html('success.changeset_id', { changeset_id: `${_changeset.id}` })); @@ -182,7 +182,7 @@ export function uiSuccess(context) { communityLinks .append('h3') - .html(t('success.like_osm')); + .html(t.html('success.like_osm')); let table = communityLinks .append('table') @@ -216,14 +216,14 @@ export function uiSuccess(context) { communityLinks .append('div') .attr('class', 'community-missing') - .html(t('success.missing')) + .html(t.html('success.missing')) .append('a') .attr('class', 'link-out') .attr('target', '_blank') .call(svgIcon('#iD-icon-out-link', 'inline')) .attr('href', 'https://github.com/osmlab/osm-community-index/issues') .append('span') - .html(t('success.tell_us')); + .html(t.html('success.tell_us')); } @@ -241,7 +241,7 @@ export function uiSuccess(context) { .append('a') .attr('target', '_blank') .attr('href', d.url) - .html(t(`community.${d.id}.name`)); + .html(t.html(`community.${d.id}.name`)); let descriptionHTML = t(`community.${d.id}.description`, replacements); @@ -309,7 +309,7 @@ export function uiSuccess(context) { moreEnter .append('div') .attr('class', 'community-extended-description') - .html(t(`community.${d.id}.extendedDescription`, replacements)); + .html(t.html(`community.${d.id}.extendedDescription`, replacements)); } if (d.languageCodes && d.languageCodes.length) { @@ -320,7 +320,7 @@ export function uiSuccess(context) { moreEnter .append('div') .attr('class', 'community-languages') - .html(t('success.languages', { languages: languageList })); + .html(t.html('success.languages', { languages: languageList })); } } diff --git a/modules/ui/tag_reference.js b/modules/ui/tag_reference.js index 41e7dc025..da8f2236c 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') - .html(t('inspector.no_documentation_key')); + .html(t.html('inspector.no_documentation_key')); done(); return; } @@ -64,11 +64,11 @@ export function uiTagReference(what) { _body .append('p') .attr('class', 'tag-reference-description') - .html(docs.description || t('inspector.no_documentation_key')) + .html(docs.description || t.html('inspector.no_documentation_key')) .append('a') .attr('class', 'tag-reference-edit') .attr('target', '_blank') - .attr('title', t('inspector.edit_reference', { html: false })) + .attr('title', t('inspector.edit_reference')) .attr('href', docs.editURL) .call(svgIcon('#iD-icon-edit', 'inline')); @@ -80,7 +80,7 @@ export function uiTagReference(what) { .attr('href', docs.wiki.url) .call(svgIcon('#iD-icon-out-link', 'inline')) .append('span') - .html(t(docs.wiki.text)); + .html(t.html(docs.wiki.text)); } // Add link to info about "good changeset comments" - #2923 @@ -92,7 +92,7 @@ export function uiTagReference(what) { .call(svgIcon('#iD-icon-out-link', 'inline')) .attr('href', t('commit.about_changeset_comments_link')) .append('span') - .html(t('commit.about_changeset_comments')); + .html(t.html('commit.about_changeset_comments')); } } @@ -150,7 +150,7 @@ export function uiTagReference(what) { _button = _button.enter() .append('button') .attr('class', 'tag-reference-button ' + (klass || '')) - .attr('title', t('icons.information', { html: false })) + .attr('title', t('icons.information')) .call(svgIcon('#iD-icon-' + (iconName || 'inspect'))) .merge(_button); diff --git a/modules/ui/tools/save.js b/modules/ui/tools/save.js index 00333944d..bc60535ce 100644 --- a/modules/ui/tools/save.js +++ b/modules/ui/tools/save.js @@ -102,7 +102,7 @@ export function uiToolSave(context) { .duration(2000) .iconName('#iD-icon-save') .iconClass('disabled') - .html(t('save.no_changes'))(); + .html(t.html('save.no_changes'))(); } lastPointerUpType = null; }) diff --git a/modules/ui/tools/sidebar_toggle.js b/modules/ui/tools/sidebar_toggle.js index d4412cc3a..1cd3588f2 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', { html: false })]) + .keys([t('sidebar.key')]) .scrollContainer(context.container().select('.top-toolbar')) ) .call(svgIcon('#iD-icon-sidebar-' + (localizer.textDirection() === 'rtl' ? 'right' : 'left'))); diff --git a/modules/ui/tooltip.js b/modules/ui/tooltip.js index 443e3ad9f..bc00704c9 100644 --- a/modules/ui/tooltip.js +++ b/modules/ui/tooltip.js @@ -86,7 +86,7 @@ export function uiTooltip(klass) { keyhintWrapEnter .append('span') - .html(t('tooltip_keyhint')); + .html(t.html('tooltip_keyhint')); keyhintWrap = keyhintWrapEnter.merge(keyhintWrap); diff --git a/modules/ui/view_on_keepRight.js b/modules/ui/view_on_keepRight.js index 08e90cf26..fd82c5011 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') - .html(t('inspector.view_on_keepRight')); + .html(t.html('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 dff50c5ff..49632ead5 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') - .html(t('inspector.view_on_osm')); + .html(t.html('inspector.view_on_osm')); } diff --git a/modules/ui/view_on_osmose.js b/modules/ui/view_on_osmose.js index 362fb93a0..faee91b16 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') - .html(t('inspector.view_on_osmose')); + .html(t.html('inspector.view_on_osmose')); } viewOnOsmose.what = function(val) { diff --git a/modules/ui/zoom_to_selection.js b/modules/ui/zoom_to_selection.js index 12c64333c..a23324790 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') - .html(t('inspector.zoom_to.no_selection'))(); + .html(t.html('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', { html: false })]); + .keys([t('inspector.zoom_to.key')]); var button = selection .append('button') diff --git a/modules/validations/almost_junction.js b/modules/validations/almost_junction.js index 3b4fdcb06..f74ff2c7b 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') - .html(t('issues.almost_junction.highway-highway.reference')); + .html(t.html('issues.almost_junction.highway-highway.reference')); } function isExtendableCandidate(node, way) { diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index d33bc86d8..4b73e1f7e 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') - .html(t('issues.crossing_ways.' + crossingTypeID + '.reference')); + .html(t.html('issues.crossing_ways.' + crossingTypeID + '.reference')); } } diff --git a/modules/validations/disconnected_way.js b/modules/validations/disconnected_way.js index 9fa88337a..aa9c7b64f 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') - .html(t('issues.disconnected_way.routable.reference')); + .html(t.html('issues.disconnected_way.routable.reference')); } function routingIslandForEntity(entity) { diff --git a/modules/validations/help_request.js b/modules/validations/help_request.js index 6cef0d6f2..58df82576 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') - .html(t('issues.fixme_tag.reference')); + .html(t.html('issues.fixme_tag.reference')); } }; diff --git a/modules/validations/impossible_oneway.js b/modules/validations/impossible_oneway.js index 32bf927de..f406435a6 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') - .html(t('issues.impossible_oneway.' + referenceID + '.reference')); + .html(t.html('issues.impossible_oneway.' + referenceID + '.reference')); }; } } diff --git a/modules/validations/incompatible_source.js b/modules/validations/incompatible_source.js index 93c57e9d2..6c5f98b44 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') - .html(t('issues.incompatible_source.' + id + '.reference')); + .html(t.html('issues.incompatible_source.' + id + '.reference')); }; } }; diff --git a/modules/validations/invalid_format.js b/modules/validations/invalid_format.js index 44996e9cc..f4b8c0fce 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') - .html(t('issues.invalid_format.email.reference')); + .html(t.html('issues.invalid_format.email.reference')); } /* function showReferenceWebsite(selection) { @@ -37,7 +37,7 @@ export function validationFormatting() { .enter() .append('div') .attr('class', 'issue-reference') - .html(t('issues.invalid_format.website.reference')); + .html(t.html('issues.invalid_format.website.reference')); } if (entity.tags.website) { diff --git a/modules/validations/mismatched_geometry.js b/modules/validations/mismatched_geometry.js index ce6367a02..60aa80996 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') - .html(t('issues.tag_suggests_area.reference')); + .html(t.html('issues.tag_suggests_area.reference')); } } @@ -170,7 +170,7 @@ export function validationMismatchedGeometry() { .enter() .append('div') .attr('class', 'issue-reference') - .html(t('issues.vertex_as_point.reference')); + .html(t.html('issues.vertex_as_point.reference')); }, entityIds: [entity.id] }); @@ -193,7 +193,7 @@ export function validationMismatchedGeometry() { .enter() .append('div') .attr('class', 'issue-reference') - .html(t('issues.point_as_vertex.reference')); + .html(t.html('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') - .html(t('issues.unclosed_multipolygon_part.reference')); + .html(t.html('issues.unclosed_multipolygon_part.reference')); } } diff --git a/modules/validations/missing_role.js b/modules/validations/missing_role.js index eac0b09e1..cc8db32d8 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') - .html(t('issues.missing_role.multipolygon.reference')); + .html(t.html('issues.missing_role.multipolygon.reference')); } } diff --git a/modules/validations/missing_tag.js b/modules/validations/missing_tag.js index 48768a540..2baaf0298 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') - .html(t('issues.' + referenceID + '.reference')); + .html(t.html('issues.' + referenceID + '.reference')); } }; diff --git a/modules/validations/outdated_tags.js b/modules/validations/outdated_tags.js index fbc6292d0..37e7e679f 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') - .html(t(`issues.outdated_tags.${prefix}reference`)); + .html(t.html(`issues.outdated_tags.${prefix}reference`)); enter .append('strong') - .html(t('issues.suggested')); + .html(t.html('issues.suggested')); enter .append('table') @@ -313,7 +313,7 @@ export function validationOutdatedTags() { .enter() .append('div') .attr('class', 'issue-reference') - .html(t('issues.old_multipolygon.reference')); + .html(t.html('issues.old_multipolygon.reference')); } } diff --git a/modules/validations/private_data.js b/modules/validations/private_data.js index c87279abb..cc1d8b59c 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') - .html(t('issues.private_data.reference')); + .html(t.html('issues.private_data.reference')); enter .append('strong') - .html(t('issues.suggested')); + .html(t.html('issues.suggested')); enter .append('table') diff --git a/modules/validations/suspicious_name.js b/modules/validations/suspicious_name.js index c903054e5..2411f5091 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') - .html(t('issues.generic_name.reference')); + .html(t.html('issues.generic_name.reference')); } } @@ -142,7 +142,7 @@ export function validationSuspiciousName() { .enter() .append('div') .attr('class', 'issue-reference') - .html(t('issues.generic_name.reference')); + .html(t.html('issues.generic_name.reference')); } } diff --git a/modules/validations/unsquare_way.js b/modules/validations/unsquare_way.js index 40b045c8f..ff8e8bea5 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') - .html(t('issues.unsquare_way.buildings.reference')); + .html(t.html('issues.unsquare_way.buildings.reference')); } };