Make t function return a span element with a lang attribute unless html: false is specified in the options (re: #7963)

Update `text` functions to `html` to support inserting the `span` elements
Specify `html: false` for various instances where a `span` is not desired, e.g. `placeholder` and `title` attributes
This commit is contained in:
Quincy Morgan
2020-09-15 21:56:22 -04:00
parent 7aa6c1d1a3
commit 32f8274929
150 changed files with 471 additions and 463 deletions
+15 -5
View File
@@ -221,6 +221,8 @@ export function coreLocalizer() {
return 'other';
}
let _lastUsedTCode;
/**
* Given a string identifier, try to find that string in the current
* language, and return it. This function will be called recursively
@@ -232,17 +234,19 @@ export function coreLocalizer() {
* @return {string?} localized string
*/
localizer.t = function(stringId, replacements, locale) {
locale = locale || _localeCode;
_lastUsedTCode = null;
// US English is the default
if (locale.toLowerCase() === 'en-us') locale = 'en';
locale = locale || _localeCode;
let path = stringId
.split('.')
.map(s => s.replace(/<TX_DOT>/g, '.'))
.reverse();
let result = _localeStrings[locale];
let stringsKey = locale;
// US English is the default
if (stringsKey.toLowerCase() === 'en-us') stringsKey = 'en';
let result = _localeStrings[stringsKey];
while (result !== undefined && path.length) {
result = result[path.pop()];
@@ -287,7 +291,11 @@ export function coreLocalizer() {
}
if (typeof result === 'string') {
// found a localized string!
return result;
_lastUsedTCode = locale;
if (replacements && replacements.html === false) {
return result;
}
return `<span class="localized-text" lang="${locale}">${result}</span>`;
}
}
// no localized string found...
@@ -311,6 +319,8 @@ export function coreLocalizer() {
return missing;
};
localizer.t.lastCode = () => _lastUsedTCode;
localizer.languageName = (code, options) => {
if (_languageNames[code]) { // name in locale language
+1 -1
View File
@@ -12,7 +12,7 @@ export function modeAddNote(context) {
button: 'note',
title: t('modes.add_note.title'),
description: t('modes.add_note.description'),
key: t('modes.add_note.key')
key: t('modes.add_note.key', { html: false })
};
var behavior = behaviorDraw(context)
+1 -1
View File
@@ -230,7 +230,7 @@ export function modeSelect(context, selectedIDs) {
_behaviors.forEach(context.install);
keybinding
.on(t('inspector.zoom_to.key'), mode.zoomToSelected)
.on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected)
.on(['[', 'pgup'], previousVertex)
.on([']', 'pgdown'], nextVertex)
.on(['{', uiCmd('⌘['), 'home'], firstVertex)
+1 -1
View File
@@ -72,7 +72,7 @@ export function modeSelectData(context, selectedDatum) {
behaviors.forEach(context.install);
keybinding
.on(t('inspector.zoom_to.key'), mode.zoomToSelected)
.on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected)
.on('⎋', esc, true);
d3_select(document)
+1 -1
View File
@@ -98,7 +98,7 @@ export function modeSelectError(context, selectedErrorID, selectedErrorService)
behaviors.forEach(context.install);
keybinding
.on(t('inspector.zoom_to.key'), mode.zoomToSelected)
.on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected)
.on('⎋', esc, true);
d3_select(document)
+1 -1
View File
@@ -108,7 +108,7 @@ export function modeSelectNote(context, selectedNoteID) {
_behaviors.forEach(context.install);
_keybinding
.on(t('inspector.zoom_to.key'), mode.zoomToSelected)
.on(t('inspector.zoom_to.key', { html: false }), mode.zoomToSelected)
.on('⎋', esc, true);
d3_select(document)
+1 -1
View File
@@ -107,7 +107,7 @@ export function operationCircularize(context, selectedIDs) {
operation.id = 'circularize';
operation.keys = [t('operations.circularize.key')];
operation.keys = [t('operations.circularize.key', { html: false })];
operation.title = t('operations.circularize.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -65,7 +65,7 @@ export function operationContinue(context, selectedIDs) {
operation.id = 'continue';
operation.keys = [t('operations.continue.key')];
operation.keys = [t('operations.continue.key', { html: false })];
operation.title = t('operations.continue.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -183,7 +183,7 @@ export function operationDisconnect(context, selectedIDs) {
operation.id = 'disconnect';
operation.keys = [t('operations.disconnect.key')];
operation.keys = [t('operations.disconnect.key', { html: false })];
operation.title = t('operations.disconnect.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -84,7 +84,7 @@ export function operationExtract(context, selectedIDs) {
operation.id = 'extract';
operation.keys = [t('operations.extract.key')];
operation.keys = [t('operations.extract.key', { html: false })];
operation.title = t('operations.extract.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -88,7 +88,7 @@ export function operationMerge(context, selectedIDs) {
};
operation.id = 'merge';
operation.keys = [t('operations.merge.key')];
operation.keys = [t('operations.merge.key', { html: false })];
operation.title = t('operations.merge.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -72,7 +72,7 @@ export function operationMove(context, selectedIDs) {
operation.id = 'move';
operation.keys = [t('operations.move.key')];
operation.keys = [t('operations.move.key', { html: false })];
operation.title = t('operations.move.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -130,7 +130,7 @@ export function operationOrthogonalize(context, selectedIDs) {
operation.id = 'orthogonalize';
operation.keys = [t('operations.orthogonalize.key')];
operation.keys = [t('operations.orthogonalize.key', { html: false })];
operation.title = t('operations.orthogonalize.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -68,7 +68,7 @@ export function operationReverse(context, selectedIDs) {
operation.id = 'reverse';
operation.keys = [t('operations.reverse.key')];
operation.keys = [t('operations.reverse.key', { html: false })];
operation.title = t('operations.reverse.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -72,7 +72,7 @@ export function operationRotate(context, selectedIDs) {
operation.id = 'rotate';
operation.keys = [t('operations.rotate.key')];
operation.keys = [t('operations.rotate.key', { html: false })];
operation.title = t('operations.rotate.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -63,7 +63,7 @@ export function operationSplit(context, selectedIDs) {
operation.id = 'split';
operation.keys = [t('operations.split.key')];
operation.keys = [t('operations.split.key', { html: false })];
operation.title = t('operations.split.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -135,7 +135,7 @@ export function operationStraighten(context, selectedIDs) {
operation.id = 'straighten';
operation.keys = [t('operations.straighten.key')];
operation.keys = [t('operations.straighten.key', { html: false })];
operation.title = t('operations.straighten.title');
operation.behavior = behaviorOperation(context).which(operation);
+1 -1
View File
@@ -33,7 +33,7 @@ export function presetCategory(categoryID, category, all) {
_this.matchScore = () => -1;
_this.name = () => t(`presets.categories.${categoryID}.name`, { 'default': categoryID });
_this.name = () => t(`presets.categories.${categoryID}.name`, { 'default': categoryID, html: false });
_this.terms = () => [];
+3 -3
View File
@@ -22,14 +22,14 @@ export function presetField(fieldID, field) {
_this.t = (scope, options) => t(`presets.fields.${fieldID}.${scope}`, options);
_this.label = () => _this.overrideLabel || _this.t('label', { 'default': fieldID });
_this.label = () => _this.overrideLabel || _this.t('label', { 'default': fieldID, html: false });
const _placeholder = _this.placeholder;
_this.placeholder = () => _this.t('placeholder', { 'default': _placeholder });
_this.placeholder = () => _this.t('placeholder', { 'default': _placeholder, html: false });
_this.originalTerms = (_this.terms || []).join();
_this.terms = () => _this.t('terms', { 'default': _this.originalTerms })
_this.terms = () => _this.t('terms', { 'default': _this.originalTerms, html: false })
.toLowerCase().trim().split(/\s*,+\s*/);
+4 -6
View File
@@ -79,11 +79,9 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) {
};
let _textCache = {};
_this.t = (scope, options) => {
const textID = `presets.presets.${presetID}.${scope}`;
if (_textCache[textID]) return _textCache[textID];
return _textCache[textID] = t(textID, options);
return t(textID, options);
};
@@ -92,13 +90,13 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) {
let path = presetID.split('/');
path.pop(); // remove brand name
// NOTE: insert an en-dash, not a hyphen (to avoid conflict with fr - nl names in Brussels etc)
return _this.originalName + ' ' + t('presets.presets.' + path.join('/') + '.name');
return _this.originalName + ' ' + t('presets.presets.' + path.join('/') + '.name', { html: false });
}
return _this.t('name', { 'default': _this.originalName });
return _this.t('name', { 'default': _this.originalName, html: false });
};
_this.terms = () => _this.t('terms', { 'default': _this.originalTerms })
_this.terms = () => _this.t('terms', { 'default': _this.originalTerms, html: false })
.toLowerCase().trim().split(/\s*,+\s*/);
+2 -2
View File
@@ -238,7 +238,7 @@ export function rendererTileLayer(context) {
debug
.selectAll('.tile-label-debug-coord')
.text(function(d) { return d[2] + ' / ' + d[0] + ' / ' + d[1]; });
.html(function(d) { return d[2] + ' / ' + d[0] + ' / ' + d[1]; });
debug
.selectAll('.tile-label-debug-vintage')
@@ -246,7 +246,7 @@ export function rendererTileLayer(context) {
var span = d3_select(this);
var center = context.projection.invert(tileCenter(d));
_source.getMetadata(center, d, function(err, result) {
span.text((result && result.vintage && result.vintage.range) ||
span.html((result && result.vintage && result.vintage.range) ||
t('info_panels.background.vintage') + ': ' + t('info_panels.background.unknown')
);
});
+9 -9
View File
@@ -265,22 +265,22 @@ export default {
controlsEnter
.append('button')
.on('click.back', step(-1))
.text('◄');
.html('◄');
controlsEnter
.append('button')
.on('click.rotate-ccw', rotate(-90))
.text('⤿');
.html('⤿');
controlsEnter
.append('button')
.on('click.rotate-cw', rotate(90))
.text('⤾');
.html('⤾');
controlsEnter
.append('button')
.on('click.forward', step(1))
.text('►');
.html('►');
wrapEnter
.append('div')
@@ -423,22 +423,22 @@ export default {
.attr('class', 'captured_by')
.attr('target', '_blank')
.attr('href', 'https://openstreetcam.org/user/' + encodeURIComponent(d.captured_by))
.text('@' + d.captured_by);
.html('@' + d.captured_by);
attribution
.append('span')
.text('|');
.html('|');
}
if (d.captured_at) {
attribution
.append('span')
.attr('class', 'captured_at')
.text(localeDateString(d.captured_at));
.html(localeDateString(d.captured_at));
attribution
.append('span')
.text('|');
.html('|');
}
attribution
@@ -446,7 +446,7 @@ export default {
.attr('class', 'image-link')
.attr('target', '_blank')
.attr('href', 'https://openstreetcam.org/details/' + d.sequence_id + '/' + d.sequence_index)
.text('openstreetcam.org');
.html('openstreetcam.org');
}
return this;
+8 -8
View File
@@ -526,12 +526,12 @@ export default {
controlsEnter
.append('button')
.on('click.back', step(-1))
.text('◄');
.html('◄');
controlsEnter
.append('button')
.on('click.forward', step(1))
.text('►');
.html('►');
// create working canvas for stitching together images
@@ -789,7 +789,7 @@ export default {
label
.append('span')
.text(t('streetside.hires'));
.html(t('streetside.hires'));
let captureInfo = line1
@@ -805,18 +805,18 @@ export default {
.attr('class', 'captured_by')
.attr('target', '_blank')
.attr('href', 'https://www.microsoft.com/en-us/maps/streetside')
.text('©' + yyyy + ' Microsoft');
.html('©' + yyyy + ' Microsoft');
captureInfo
.append('span')
.text('|');
.html('|');
}
if (d.captured_at) {
captureInfo
.append('span')
.attr('class', 'captured_at')
.text(localeTimestamp(d.captured_at));
.html(localeTimestamp(d.captured_at));
}
// Add image links
@@ -830,7 +830,7 @@ export default {
.attr('target', '_blank')
.attr('href', 'https://www.bing.com/maps?cp=' + d.loc[1] + '~' + d.loc[0] +
'&lvl=17&dir=' + d.ca + '&style=x&v=2&sV=1')
.text(t('streetside.view_on_bing'));
.html(t('streetside.view_on_bing'));
line2
.append('a')
@@ -838,7 +838,7 @@ export default {
.attr('target', '_blank')
.attr('href', 'https://www.bing.com/maps/privacyreport/streetsideprivacyreport?bubbleid=' +
encodeURIComponent(d.key) + '&focus=photo&lat=' + d.loc[1] + '&lng=' + d.loc[0] + '&z=17')
.text(t('streetside.report'));
.html(t('streetside.report'));
let bubbleIdQuadKey = d.key.toString(4);
+1 -1
View File
@@ -112,7 +112,7 @@ export function svgMapillaryMapFeatures(projection, context, dispatch) {
.append('title')
.text(function(d) {
var id = d.value.replace(/--/g, '.').replace(/-/g, '_');
return t('mapillary_map_features.' + id);
return t('mapillary_map_features.' + id, { html: false });
});
enter
+2 -2
View File
@@ -47,12 +47,12 @@ export function uiAccount(context) {
// Add user name
userLink.append('span')
.attr('class', 'label')
.text(details.display_name);
.html(details.display_name);
logoutLink.append('a')
.attr('class', 'logout')
.attr('href', '#')
.text(t('logout'))
.html(t('logout'))
.on('click.logout', function() {
d3_event.preventDefault();
osm.logout();
+2 -2
View File
@@ -56,7 +56,7 @@ export function uiAttribution(context) {
attribution
.append('span')
.attr('class', 'attribution-text')
.text(terms_text);
.html(terms_text);
})
.merge(attributions);
@@ -76,7 +76,7 @@ export function uiAttribution(context) {
.merge(copyright);
copyright
.text(String);
.html(String);
}
+1 -1
View File
@@ -108,7 +108,7 @@ export function uiChangesetEditor(context) {
.call(svgIcon('#iD-icon-alert', 'inline'))
.attr('href', t('commit.google_warning_link'))
.append('span')
.text(t('commit.google_warning'));
.html(t('commit.google_warning'));
commentEnter
.transition()
+1 -1
View File
@@ -380,7 +380,7 @@ export function uiCombobox(context, klass) {
.append('a')
.attr('class', 'combobox-option')
.attr('title', function(d) { return d.title; })
.text(function(d) { return d.display || d.value; })
.html(function(d) { return d.display || d.value; })
.on('mouseenter', _mouseEnterHandler)
.on('mouseleave', _mouseLeaveHandler)
.merge(options)
+6 -6
View File
@@ -223,7 +223,7 @@ export function uiCommit(context) {
.append('div')
.attr('class', 'header-block')
.append('h3')
.text(t('commit.title'));
.html(t('commit.title'));
headerTitle
.append('div')
@@ -283,7 +283,7 @@ export function uiCommit(context) {
prose = prose.enter()
.append('p')
.attr('class', 'commit-info')
.text(t('commit.upload_explanation'))
.html(t('commit.upload_explanation'))
.merge(prose);
// always check if this has changed, but only update prose.html()
@@ -306,7 +306,7 @@ export function uiCommit(context) {
userLink
.append('a')
.attr('class', 'user-info')
.text(user.display_name)
.html(user.display_name)
.attr('href', osm.userURL(user.display_name))
.attr('target', '_blank');
@@ -337,7 +337,7 @@ export function uiCommit(context) {
labelEnter
.append('span')
.text(t('commit.request_review'));
.html(t('commit.request_review'));
// Update
requestReview = requestReview
@@ -362,7 +362,7 @@ export function uiCommit(context) {
.attr('class', 'secondary-action button cancel-button')
.append('span')
.attr('class', 'label')
.text(t('commit.cancel'));
.html(t('commit.cancel'));
var uploadButton = buttonEnter
.append('button')
@@ -370,7 +370,7 @@ export function uiCommit(context) {
uploadButton.append('span')
.attr('class', 'label')
.text(t('commit.save'));
.html(t('commit.save'));
var uploadBlockerTooltipText = getUploadBlockerMessage();
+2 -2
View File
@@ -27,7 +27,7 @@ export function uiCommitWarnings(context) {
containerEnter
.append('h3')
.text(severity === 'warning' ? t('commit.warnings') : t('commit.errors'));
.html(severity === 'warning' ? t('commit.warnings') : t('commit.errors'));
containerEnter
.append('ul')
@@ -64,7 +64,7 @@ export function uiCommitWarnings(context) {
.merge(items);
items.selectAll('.issue-message')
.text(function(d) {
.html(function(d) {
return d.message(context);
});
+1 -1
View File
@@ -27,7 +27,7 @@ export function uiConfirm(selection) {
.on('click.confirm', function() {
modalSelection.remove();
})
.text(t('confirm.okay'))
.html(t('confirm.okay'))
.node()
.focus();
+10 -10
View File
@@ -66,7 +66,7 @@ export function uiConflicts(context) {
headerEnter
.append('h3')
.text(t('save.conflict.header'));
.html(t('save.conflict.header'));
var bodyEnter = selection.selectAll('.body')
.data([0])
@@ -77,7 +77,7 @@ export function uiConflicts(context) {
var conflictsHelpEnter = bodyEnter
.append('div')
.attr('class', 'conflicts-help')
.text(t('save.conflict.help'));
.html(t('save.conflict.help'));
// Download changes link
@@ -110,7 +110,7 @@ export function uiConflicts(context) {
linkEnter
.call(svgIcon('#iD-icon-load', 'inline'))
.append('span')
.text(t('save.conflict.download_changes'));
.html(t('save.conflict.download_changes'));
bodyEnter
@@ -123,7 +123,7 @@ export function uiConflicts(context) {
.attr('class', 'conflicts-done')
.attr('opacity', 0)
.style('display', 'none')
.text(t('save.conflict.done'));
.html(t('save.conflict.done'));
var buttonsEnter = bodyEnter
.append('div')
@@ -133,13 +133,13 @@ export function uiConflicts(context) {
.append('button')
.attr('disabled', _conflictList.length > 1)
.attr('class', 'action conflicts-button col6')
.text(t('save.title'))
.html(t('save.title'))
.on('click.try_again', tryAgain);
buttonsEnter
.append('button')
.attr('class', 'secondary-action conflicts-button col6')
.text(t('confirm.cancel'))
.html(t('confirm.cancel'))
.on('click.cancel', cancel);
}
@@ -177,13 +177,13 @@ export function uiConflicts(context) {
conflictEnter
.append('h4')
.attr('class', 'conflict-count')
.text(t('save.conflict.count', { num: index + 1, total: _conflictList.length }));
.html(t('save.conflict.count', { num: index + 1, total: _conflictList.length }));
conflictEnter
.append('a')
.attr('class', 'conflict-description')
.attr('href', '#')
.text(function(d) { return d.name; })
.html(function(d) { return d.name; })
.on('click', function(d) {
d3_event.preventDefault();
zoomToEntity(d.id);
@@ -215,7 +215,7 @@ export function uiConflicts(context) {
.data(['previous', 'next'])
.enter()
.append('button')
.text(function(d) { return t('save.conflict.' + d); })
.html(function(d) { return t('save.conflict.' + d); })
.attr('class', 'conflict-nav-button action col6')
.attr('disabled', function(d, i) {
return (i === 0 && index === 0) ||
@@ -265,7 +265,7 @@ export function uiConflicts(context) {
labelEnter
.append('span')
.text(function(d) { return d.text; });
.html(function(d) { return d.text; });
// update
choicesEnter
+2 -2
View File
@@ -39,7 +39,7 @@ export function uiContributors(context) {
.attr('class', 'user-link')
.attr('href', function(d) { return osm.userURL(d); })
.attr('target', '_blank')
.text(String);
.html(String);
if (u.length > limit) {
var count = d3_select(document.createElement('span'));
@@ -51,7 +51,7 @@ export function uiContributors(context) {
.attr('href', function() {
return osm.changesetsURL(context.map().center(), context.map().zoom());
})
.text(othersNum);
.html(othersNum);
wrap.append('span')
.html(t('contributors.truncated_list', { n: othersNum, users: userList.html(), count: count.html() }));
+1 -1
View File
@@ -33,7 +33,7 @@ export function uiDataEditor(context) {
headerEnter
.append('h3')
.text(t('map_data.title'));
.html(t('map_data.title'));
var body = selection.selectAll('.body')
+1 -1
View File
@@ -32,7 +32,7 @@ export function uiDataHeader() {
headerEnter
.append('div')
.attr('class', 'data-header-label')
.text(t('map_data.layers.custom.title'));
.html(t('map_data.layers.custom.title'));
}
+1 -1
View File
@@ -49,7 +49,7 @@ export function uiDisclosure(context, key, expandedDefault) {
.classed('expanded', _expanded);
hideToggle.selectAll('.hide-toggle-text')
.text(_title());
.html(_title());
hideToggle.selectAll('.hide-toggle-icon')
.attr('xlink:href', _expanded ? '#iD-icon-down'
+3 -3
View File
@@ -109,7 +109,7 @@ export function uiEditMenu(context) {
if (showLabels) {
buttonsEnter.append('span')
.attr('class', 'label')
.text(function(d) {
.html(function(d) {
return d.title;
});
}
@@ -148,7 +148,7 @@ export function uiEditMenu(context) {
.duration(4000)
.iconName('#iD-operation-' + operation.id)
.iconClass('operation disabled')
.text(operation.tooltip)();
.html(operation.tooltip)();
}
} else {
if (lastPointerUpType === 'touch' ||
@@ -157,7 +157,7 @@ export function uiEditMenu(context) {
.duration(2000)
.iconName('#iD-operation-' + operation.id)
.iconClass('operation')
.text(operation.annotation() || operation.title)();
.html(operation.annotation() || operation.title)();
}
operation();
+1 -1
View File
@@ -61,7 +61,7 @@ export function uiEntityEditor(context) {
.merge(headerEnter);
header.selectAll('h3')
.text(_entityIDs.length === 1 ? t('inspector.edit') : t('inspector.edit_features'));
.html(_entityIDs.length === 1 ? t('inspector.edit') : t('inspector.edit_features'));
header.selectAll('.preset-reset')
.on('click', function() {
+6 -6
View File
@@ -35,7 +35,7 @@ export function uiFeatureList(context) {
header
.append('h3')
.text(t('inspector.feature_list'));
.html(t('inspector.feature_list'));
var searchWrap = selection
.append('div')
@@ -46,7 +46,7 @@ export function uiFeatureList(context) {
var search = searchWrap
.append('input')
.attr('placeholder', t('inspector.search'))
.attr('placeholder', t('inspector.search', { html: false }))
.attr('type', 'search')
.call(utilNoAuto)
.on('keypress', keypress)
@@ -254,7 +254,7 @@ export function uiFeatureList(context) {
.attr('class', 'entity-name');
list.selectAll('.no-results-item .entity-name')
.text(t('geocoder.no_results_worldwide'));
.html(t('geocoder.no_results_worldwide'));
if (services.geocoder) {
list.selectAll('.geocode-item')
@@ -267,7 +267,7 @@ export function uiFeatureList(context) {
.attr('class', 'label')
.append('span')
.attr('class', 'entity-name')
.text(t('geocoder.search'));
.html(t('geocoder.search'));
}
list.selectAll('.no-results-item')
@@ -303,12 +303,12 @@ export function uiFeatureList(context) {
label
.append('span')
.attr('class', 'entity-type')
.text(function(d) { return d.type; });
.html(function(d) { return d.type; });
label
.append('span')
.attr('class', 'entity-name')
.text(function(d) { return d.name; });
.html(function(d) { return d.name; });
enter
.style('opacity', 0)
+3 -3
View File
@@ -132,7 +132,7 @@ export function uiField(context, presetField, entityIDs, options) {
textEnter
.append('span')
.attr('class', 'label-textvalue')
.text(function(d) { return d.label(); });
.html(function(d) { return d.label(); });
textEnter
.append('span')
@@ -142,7 +142,7 @@ export function uiField(context, presetField, entityIDs, options) {
labelEnter
.append('button')
.attr('class', 'remove-icon')
.attr('title', t('icons.remove'))
.attr('title', t('icons.remove', { html: false }))
.attr('tabindex', -1)
.call(svgIcon('#iD-operation-delete'));
}
@@ -151,7 +151,7 @@ export function uiField(context, presetField, entityIDs, options) {
labelEnter
.append('button')
.attr('class', 'modified-icon')
.attr('title', t('icons.undo'))
.attr('title', t('icons.undo', { html: false }))
.attr('tabindex', -1)
.call(svgIcon((localizer.textDirection() === 'rtl') ? '#iD-icon-redo' : '#iD-icon-undo'));
}
+2 -2
View File
@@ -198,7 +198,7 @@ export function uiFieldHelp(context, fieldName) {
titleEnter
.append('h2')
.attr('class', ((localizer.textDirection() === 'rtl') ? 'fr' : 'fl'))
.text(t('help.field.' + fieldName + '.title'));
.html(t('help.field.' + fieldName + '.title'));
titleEnter
.append('button')
@@ -220,7 +220,7 @@ export function uiFieldHelp(context, fieldName) {
.enter()
.append('div')
.attr('class', 'field-help-nav-item')
.text(function(d) { return d; })
.html(function(d) { return d; })
.on('click', function(d, i) {
d3_event.stopPropagation();
d3_event.preventDefault();
+2 -2
View File
@@ -40,7 +40,7 @@ export function uiFieldAccess(field, context) {
.append('span')
.attr('class', 'label preset-label-access')
.attr('for', function(d) { return 'preset-input-access-' + d; })
.text(function(d) { return field.t('types.' + d); });
.html(function(d) { return field.t('types.' + d); });
enter
.append('div')
@@ -217,7 +217,7 @@ export function uiFieldAccess(field, context) {
})
.attr('placeholder', function(d) {
if (tags[d] && Array.isArray(tags[d])) {
return t('inspector.multiple_values');
return t('inspector.multiple_values', { html: false });
}
if (d === 'access') {
return 'yes';
+2 -2
View File
@@ -274,12 +274,12 @@ export function uiFieldAddress(field, context) {
function updatePlaceholder(inputSelection) {
return inputSelection.attr('placeholder', function(subfield) {
if (_tags && Array.isArray(_tags[field.key + ':' + subfield.id])) {
return t('inspector.multiple_values');
return t('inspector.multiple_values', { html: false });
}
if (_countryCode) {
var localkey = subfield.id + '!' + _countryCode;
var tkey = addrField.strings.placeholders[localkey] ? localkey : subfield.id;
return addrField.t('placeholders.' + tkey);
return addrField.t('placeholders.' + tkey, { html: false });
}
});
}
+3 -3
View File
@@ -83,7 +83,7 @@ export function uiFieldCheck(field, context) {
var icon = pseudoDirection ? '#iD-icon-forward' : '#iD-icon-backward';
selection.selectAll('.reverser-span')
.text(t('inspector.check.reverser'))
.html(t('inspector.check.reverser'))
.call(svgIcon(icon, 'inline'));
return selection;
@@ -108,7 +108,7 @@ export function uiFieldCheck(field, context) {
enter
.append('span')
.text(texts[0])
.html(texts[0])
.attr('class', 'value');
if (field.type === 'onewayCheck') {
@@ -212,7 +212,7 @@ export function uiFieldCheck(field, context) {
.property('checked', isChecked(_value));
text
.text(isMixed ? t('inspector.multiple_values') : textFor(_value))
.html(isMixed ? t('inspector.multiple_values') : textFor(_value))
.classed('mixed', isMixed);
label
+7 -7
View File
@@ -149,7 +149,7 @@ export function uiFieldCombo(field, context) {
if (optstrings) {
_comboData = Object.keys(optstrings).map(function(k) {
var v = field.t('options.' + k, { 'default': optstrings[k] });
var v = field.t('options.' + k, { 'default': optstrings[k], html: false });
return {
key: k,
value: v,
@@ -242,7 +242,7 @@ export function uiFieldCombo(field, context) {
function setPlaceholder(values) {
if (isMulti || isSemi) {
_staticPlaceholder = field.placeholder() || t('inspector.add');
_staticPlaceholder = field.placeholder() || t('inspector.add', { html: false });
} else {
var vals = values
.map(function(d) { return d.value; })
@@ -258,7 +258,7 @@ export function uiFieldCombo(field, context) {
var ph;
if (!isMulti && !isSemi && _tags && Array.isArray(_tags[field.key])) {
ph = t('inspector.multiple_values');
ph = t('inspector.multiple_values', { html: false });
} else {
ph = _staticPlaceholder;
}
@@ -528,7 +528,7 @@ export function uiFieldCombo(field, context) {
return d.isMixed;
})
.attr('title', function(d) {
return d.isMixed ? t('inspector.unshared_value_tooltip') : null;
return d.isMixed ? t('inspector.unshared_value_tooltip', { html: false }) : null;
});
if (allowDragAndDrop) {
@@ -536,12 +536,12 @@ export function uiFieldCombo(field, context) {
}
chips.select('span')
.text(function(d) { return d.value; });
.html(function(d) { return d.value; });
chips.select('a')
.on('click', removeMultikey)
.attr('class', 'remove')
.text('×');
.html('×');
} else {
var isMixed = Array.isArray(tags[field.key]);
@@ -552,7 +552,7 @@ export function uiFieldCombo(field, context) {
utilGetSetValue(input, !isMixed ? displayValue(tags[field.key]) : '')
.attr('title', isMixed ? mixedValues.join('\n') : undefined)
.attr('placeholder', isMixed ? t('inspector.multiple_values') : _staticPlaceholder || '')
.attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : _staticPlaceholder || '')
.classed('mixed', isMixed);
}
};
+2 -2
View File
@@ -49,7 +49,7 @@ export function uiFieldCycleway(field, context) {
.append('span')
.attr('class', 'label preset-label-cycleway')
.attr('for', function(d) { return 'preset-input-cycleway-' + stripcolon(d); })
.text(function(d) { return field.t('types.' + d); });
.html(function(d) { return field.t('types.' + d); });
enter
.append('div')
@@ -149,7 +149,7 @@ export function uiFieldCycleway(field, context) {
})
.attr('placeholder', function(d) {
if (Array.isArray(tags.cycleway) || Array.isArray(tags[d])) {
return t('inspector.multiple_values');
return t('inspector.multiple_values', { html: false });
}
return field.placeholder();
})
+2 -2
View File
@@ -113,7 +113,7 @@ export function uiFieldText(field, context) {
var domainResults = /^https?:\/\/(.{1,}?)\//.exec(field.urlFormat);
if (domainResults.length >= 2 && domainResults[1]) {
var domain = domainResults[1];
return t('icons.view_on', { domain: domain });
return t('icons.view_on', { domain: domain, html: false });
}
return '';
})
@@ -202,7 +202,7 @@ export function uiFieldText(field, context) {
utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : '')
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined)
.attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown')))
.attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : (field.placeholder() || t('inspector.unknown', { html: false })))
.classed('mixed', isMixed);
if (outlinkButton && !outlinkButton.empty()) {
+3 -3
View File
@@ -77,7 +77,7 @@ export function uiFieldLanes(field, context) {
.append('text')
.attr('y', 40)
.attr('x', 14)
.text('▲');
.html('▲');
enter
.append('g')
@@ -85,7 +85,7 @@ export function uiFieldLanes(field, context) {
.append('text')
.attr('y', 40)
.attr('x', 14)
.text('▲▼');
.html('▲▼');
enter
.append('g')
@@ -93,7 +93,7 @@ export function uiFieldLanes(field, context) {
.append('text')
.attr('y', 40)
.attr('x', 14)
.text('▼');
.html('▼');
lane = lane
+4 -4
View File
@@ -513,7 +513,7 @@ export function uiFieldLocalized(field, context) {
text
.append('span')
.attr('class', 'label-textvalue')
.text(t('translate.localized_translation_label'));
.html(t('translate.localized_translation_label'));
text
.append('span')
@@ -544,7 +544,7 @@ export function uiFieldLocalized(field, context) {
.attr('class', 'localized-lang')
.attr('id', domId)
.attr('type', 'text')
.attr('placeholder', t('translate.localized_translation_language'))
.attr('placeholder', t('translate.localized_translation_language', { html: false }))
.on('blur', changeLang)
.on('change', changeLang)
.call(langCombo);
@@ -591,7 +591,7 @@ export function uiFieldLocalized(field, context) {
return Array.isArray(d.value) ? d.value.filter(Boolean).join('\n') : null;
})
.attr('placeholder', function(d) {
return Array.isArray(d.value) ? t('inspector.multiple_values') : t('translate.localized_translation_name');
return Array.isArray(d.value) ? t('inspector.multiple_values', { html: false }) : t('translate.localized_translation_name', { html: false });
})
.classed('mixed', function(d) {
return Array.isArray(d.value);
@@ -618,7 +618,7 @@ export function uiFieldLocalized(field, context) {
utilGetSetValue(input, typeof tags[field.key] === 'string' ? tags[field.key] : '')
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined)
.attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder())
.attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : field.placeholder())
.classed('mixed', isMixed);
calcMultilingual(tags);
+1 -1
View File
@@ -129,7 +129,7 @@ export function uiFieldMaxspeed(field, context) {
utilGetSetValue(input, typeof value === 'string' ? value : '')
.attr('title', isMixed ? value.filter(Boolean).join('\n') : null)
.attr('placeholder', isMixed ? t('inspector.multiple_values') : field.placeholder())
.attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : field.placeholder())
.classed('mixed', isMixed);
};
+7 -7
View File
@@ -59,12 +59,12 @@ export function uiFieldRadio(field, context) {
.append('input')
.attr('type', 'radio')
.attr('name', field.id)
.attr('value', function(d) { return field.t('options.' + d, { 'default': d }); })
.attr('value', function(d) { return field.t('options.' + d, { 'default': d, html: false }); })
.attr('checked', false);
enter
.append('span')
.text(function(d) { return field.t('options.' + d, { 'default': d }); });
.html(function(d) { return field.t('options.' + d, { 'default': d }); });
labels = labels
.merge(enter);
@@ -129,7 +129,7 @@ export function uiFieldRadio(field, context) {
.append('span')
.attr('class', 'label structure-label-type')
.attr('for', 'preset-input-' + selected)
.text(t('inspector.radio.structure.type'));
.html(t('inspector.radio.structure.type'));
typeEnter
.append('div')
@@ -174,7 +174,7 @@ export function uiFieldRadio(field, context) {
.append('span')
.attr('class', 'label structure-label-layer')
.attr('for', 'preset-input-layer')
.text(t('inspector.radio.structure.layer'));
.html(t('inspector.radio.structure.layer'));
layerEnter
.append('div')
@@ -290,16 +290,16 @@ export function uiFieldRadio(field, context) {
})
.classed('mixed', isMixed)
.attr('title', function(d) {
return isMixed(d) ? t('inspector.unshared_value_tooltip') : null;
return isMixed(d) ? t('inspector.unshared_value_tooltip', { html: false }) : null;
});
var selection = radios.filter(function() { return this.checked; });
if (selection.empty()) {
placeholder.text(t('inspector.none'));
placeholder.html(t('inspector.none'));
} else {
placeholder.text(selection.attr('value'));
placeholder.html(selection.attr('value'));
_oldType[selection.datum()] = tags[selection.datum()];
}
+6 -6
View File
@@ -124,7 +124,7 @@ export function uiFieldRestrictions(field, context) {
distControlEnter
.append('span')
.attr('class', 'restriction-control-label restriction-distance-label')
.text(t('restriction.controls.distance') + ':');
.html(t('restriction.controls.distance') + ':');
distControlEnter
.append('input')
@@ -151,7 +151,7 @@ export function uiFieldRestrictions(field, context) {
});
selection.selectAll('.restriction-distance-text')
.text(displayMaxDistance(_maxDistance));
.html(displayMaxDistance(_maxDistance));
var viaControl = selection.selectAll('.restriction-via-way')
@@ -167,7 +167,7 @@ export function uiFieldRestrictions(field, context) {
viaControlEnter
.append('span')
.attr('class', 'restriction-control-label restriction-via-way-label')
.text(t('restriction.controls.via') + ':');
.html(t('restriction.controls.via') + ':');
viaControlEnter
.append('input')
@@ -193,7 +193,7 @@ export function uiFieldRestrictions(field, context) {
});
selection.selectAll('.restriction-via-way-text')
.text(displayMaxVia(_maxViaWay));
.html(displayMaxVia(_maxViaWay));
}
@@ -517,7 +517,7 @@ export function uiFieldRestrictions(field, context) {
help
.append('div') // "NO Right Turn (indirect)"
.attr('class', 'qualifier ' + klass)
.text(turnText);
.html(turnText);
help
.append('div') // "FROM {fromName} TO {toName}"
@@ -548,7 +548,7 @@ export function uiFieldRestrictions(field, context) {
if (!indirect) {
help
.append('div') // Click for "No Right Turn"
.text(t('restriction.help.toggle', { turn: nextText.trim() }));
.html(t('restriction.help.toggle', { turn: nextText.trim() }));
}
highlightPathsFrom(null);
+1 -1
View File
@@ -61,7 +61,7 @@ export function uiFieldTextarea(field, context) {
utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : '')
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : undefined)
.attr('placeholder', isMixed ? t('inspector.multiple_values') : (field.placeholder() || t('inspector.unknown')))
.attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : (field.placeholder() || t('inspector.unknown', { html: false })))
.classed('mixed', isMixed);
};
+4 -4
View File
@@ -93,7 +93,7 @@ export function uiFieldWikidata(field, context) {
searchRowEnter
.append('button')
.attr('class', 'form-field-button wiki-link')
.attr('title', t('icons.view_on', { domain: 'wikidata.org' }))
.attr('title', t('icons.view_on', { domain: 'wikidata.org', html: false }))
.attr('tabindex', -1)
.call(svgIcon('#iD-icon-out-link'))
.on('click', function() {
@@ -118,7 +118,7 @@ export function uiFieldWikidata(field, context) {
enter
.append('span')
.attr('class', 'label')
.text(function(d) { return t('wikidata.' + d); });
.html(function(d) { return t('wikidata.' + d); });
enter
.append('input')
@@ -130,7 +130,7 @@ export function uiFieldWikidata(field, context) {
enter
.append('button')
.attr('class', 'form-field-button')
.attr('title', t('icons.copy'))
.attr('title', t('icons.copy', { html: false }))
.attr('tabindex', -1)
.call(svgIcon('#iD-operation-copy'))
.on('click', function() {
@@ -292,7 +292,7 @@ export function uiFieldWikidata(field, context) {
var isMixed = Array.isArray(tags[field.key]);
_searchInput
.attr('title', isMixed ? tags[field.key].filter(Boolean).join('\n') : null)
.attr('placeholder', isMixed ? t('inspector.multiple_values') : '')
.attr('placeholder', isMixed ? t('inspector.multiple_values', { html: false }) : '')
.classed('mixed', isMixed);
_qid = typeof tags[field.key] === 'string' && tags[field.key] || '';
+2 -2
View File
@@ -87,7 +87,7 @@ export function uiFieldWikipedia(field, context) {
.append('input')
.attr('type', 'text')
.attr('class', 'wiki-lang')
.attr('placeholder', t('translate.localized_translation_language'))
.attr('placeholder', t('translate.localized_translation_language', { html: false }))
.call(utilNoAuto)
.call(langCombo)
.merge(_langInput);
@@ -129,7 +129,7 @@ export function uiFieldWikipedia(field, context) {
.append('button')
.attr('class', 'form-field-button wiki-link')
.attr('tabindex', -1)
.attr('title', t('icons.view_on', { domain: 'wikipedia.org' }))
.attr('title', t('icons.view_on', { domain: 'wikipedia.org', html: false }))
.call(svgIcon('#iD-icon-out-link'))
.merge(link);
+1 -1
View File
@@ -65,7 +65,7 @@ export function uiFlash(context) {
content
.selectAll('.flash-text')
.attr('class', 'flash-text ' + (_textClass || ''))
.text(_text);
.html(_text);
_flashTimer = d3_timeout(function() {
+1 -1
View File
@@ -83,7 +83,7 @@ export function uiFormFields(context) {
moreEnter
.append('span')
.text(t('inspector.add_fields'));
.html(t('inspector.add_fields'));
more = moreEnter
.merge(more);
+1 -1
View File
@@ -64,7 +64,7 @@ export function uiFullScreen(context) {
if (!isSupported()) return;
// button = selection.append('button')
// .attr('title', t('full_screen'))
// .attr('title', t('full_screen', { html: false }))
// .attr('tabindex', -1)
// .on('click', fullScreen)
// .call(tooltip);
+2 -2
View File
@@ -62,7 +62,7 @@ export function uiGeolocate(context) {
zoomTo();
} else {
context.ui().flash
.text(t('geolocate.location_unavailable'))
.html(t('geolocate.location_unavailable'))
.iconName('#iD-icon-geolocate')();
}
@@ -92,6 +92,6 @@ export function uiGeolocate(context) {
.keys([t('geolocate.key')])
);
context.keybinding().on(t('geolocate.key'), click);
context.keybinding().on(t('geolocate.key', { html: false }), click);
};
}
+3 -3
View File
@@ -56,19 +56,19 @@ export function uiImproveOsmComments() {
.attr('target', '_blank');
}
selection
.text(d => d.username);
.html(d => d.username);
});
metadataEnter
.append('div')
.attr('class', 'comment-date')
.text(d => t('note.status.commented', { when: localeDateString(d.timestamp) }));
.html(d => t('note.status.commented', { when: localeDateString(d.timestamp) }));
mainEnter
.append('div')
.attr('class', 'comment-text')
.append('p')
.text(d => d.text);
.html(d => d.text);
})
.catch(err => {
console.log(err); // eslint-disable-line no-console
+1 -1
View File
@@ -43,7 +43,7 @@ export function uiImproveOsmDetails(context) {
descriptionEnter
.append('h4')
.text(() => t('QA.keepRight.detail_description'));
.html(() => t('QA.keepRight.detail_description'));
descriptionEnter
.append('div')
+6 -6
View File
@@ -36,7 +36,7 @@ export function uiImproveOsmEditor(context) {
headerEnter
.append('h3')
.text(t('QA.improveOSM.title'));
.html(t('QA.improveOSM.title'));
let body = selection.selectAll('.body')
.data([0]);
@@ -80,12 +80,12 @@ export function uiImproveOsmEditor(context) {
saveSectionEnter
.append('h4')
.attr('class', '.qa-save-header')
.text(t('note.newComment'));
.html(t('note.newComment'));
saveSectionEnter
.append('textarea')
.attr('class', 'new-comment-input')
.attr('placeholder', t('QA.keepRight.comment_placeholder'))
.attr('placeholder', t('QA.keepRight.comment_placeholder', { html: false }))
.attr('maxlength', 1000)
.property('value', d => d.newComment)
.call(utilNoAuto)
@@ -135,7 +135,7 @@ export function uiImproveOsmEditor(context) {
buttonEnter
.append('button')
.attr('class', 'button comment-button action')
.text(t('QA.keepRight.save_comment'));
.html(t('QA.keepRight.save_comment'));
buttonEnter
.append('button')
@@ -160,7 +160,7 @@ export function uiImproveOsmEditor(context) {
});
buttonSection.select('.close-button')
.text(d => {
.html(d => {
const andComment = (d.newComment ? '_comment' : '');
return t(`QA.keepRight.close${andComment}`);
})
@@ -174,7 +174,7 @@ export function uiImproveOsmEditor(context) {
});
buttonSection.select('.ignore-button')
.text(d => {
.html(d => {
const andComment = (d.newComment ? '_comment' : '');
return t(`QA.keepRight.ignore${andComment}`);
})
+1 -1
View File
@@ -62,7 +62,7 @@ export function uiImproveOsmHeader() {
headerEnter
.append('div')
.attr('class', 'qa-header-label')
.text(issueTitle);
.html(issueTitle);
}
improveOsmHeader.issue = function(val) {
+3 -3
View File
@@ -59,7 +59,7 @@ export function uiInfo(context) {
title
.append('h3')
.text(function(d) { return panels[d].title; });
.html(function(d) { return panels[d].title; });
title
.append('button')
@@ -123,10 +123,10 @@ export function uiInfo(context) {
redraw();
context.keybinding()
.on(uiCmd('⌘' + t('info_panels.key')), info.toggle);
.on(uiCmd('⌘' + t('info_panels.key', { html: false })), info.toggle);
ids.forEach(function(k) {
var key = t('info_panels.' + k + '.key', { default: null });
var key = t('info_panels.' + k + '.key', { default: null, html: false });
if (!key) return;
context.keybinding()
.on(uiCmd('⌘⇧' + key), function() { info.toggle(k); });
+6 -6
View File
@@ -126,7 +126,7 @@ export function uiInit(context) {
map
.on('hitMinZoom.ui', function() {
ui.flash.text(t('cannot_zoom'))();
ui.flash.html(t('cannot_zoom'))();
});
container
@@ -351,7 +351,7 @@ export function uiInit(context) {
var panPixels = 80;
context.keybinding()
.on('⌫', function() { d3_event.preventDefault(); })
.on([t('sidebar.key'), '`', '²', '@'], ui.sidebar.toggle) // #5663, #6864 - common QWERTY, AZERTY
.on([t('sidebar.key', { html: false }), '`', '²', '@'], ui.sidebar.toggle) // #5663, #6864 - common QWERTY, AZERTY
.on('←', pan([panPixels, 0]))
.on('↑', pan([0, panPixels]))
.on('→', pan([-panPixels, 0]))
@@ -360,7 +360,7 @@ export function uiInit(context) {
.on(uiCmd('⌥↑'), pan([0, map.dimensions()[1]]))
.on(uiCmd('⌥→'), pan([-map.dimensions()[0], 0]))
.on(uiCmd('⌥↓'), pan([0, -map.dimensions()[1]]))
.on(uiCmd('⌘' + t('background.key')), function quickSwitch() {
.on(uiCmd('⌘' + t('background.key', { html: false })), function quickSwitch() {
if (d3_event) {
d3_event.stopImmediatePropagation();
d3_event.preventDefault();
@@ -373,12 +373,12 @@ export function uiInit(context) {
context.background().baseLayerSource(previousBackground);
}
})
.on(t('area_fill.wireframe.key'), function toggleWireframe() {
.on(t('area_fill.wireframe.key', { html: false }), function toggleWireframe() {
d3_event.preventDefault();
d3_event.stopPropagation();
context.map().toggleWireframe();
})
.on(uiCmd('⌥' + t('area_fill.wireframe.key')), function toggleOsmData() {
.on(uiCmd('⌥' + t('area_fill.wireframe.key', { html: false })), function toggleOsmData() {
d3_event.preventDefault();
d3_event.stopPropagation();
@@ -394,7 +394,7 @@ export function uiInit(context) {
}
}
})
.on(t('map_data.highlight_edits.key'), function toggleHighlightEdited() {
.on(t('map_data.highlight_edits.key', { html: false }), function toggleHighlightEdited() {
d3_event.preventDefault();
context.map().toggleHighlightEdited();
});
+3 -3
View File
@@ -86,9 +86,9 @@ export function helpString(id, replacements) {
return: uiCmd.display('↵'),
esc: t('shortcuts.key.esc'),
space: t('shortcuts.key.space'),
add_note_key: t('modes.add_note.key'),
help_key: t('help.key'),
shortcuts_key: t('shortcuts.toggle.key'),
add_note_key: t('modes.add_note.key', { html: false }),
help_key: t('help.key', { html: false }),
shortcuts_key: t('shortcuts.toggle.key', { html: false }),
// reference localized UI labels directly so that they'll always match
save: t('save.title'),
+1 -1
View File
@@ -191,7 +191,7 @@ export function uiIntro(context) {
buttons
.append('span')
.text(d => t(d.title));
.html(d => t(d.title));
buttons
.append('span')
+1 -1
View File
@@ -406,7 +406,7 @@ export function uiIntroNavigation(context, reveal) {
var firstName = first.select('.entity-name');
var name = t('intro.graph.name.spring-street');
if (!firstName.empty() && firstName.text() === name) {
if (!firstName.empty() && firstName.html() === name) {
reveal(first.node(),
helpString('intro.navigation.choose_street', { name: name }),
{ duration: 300 }
+1 -1
View File
@@ -72,7 +72,7 @@ export function uiIntroStartEditing(context, reveal) {
startbutton
.append('h2')
.text(t('intro.startediting.start'));
.html(t('intro.startediting.start'));
dispatch.call('startEditing');
}
+1 -1
View File
@@ -84,7 +84,7 @@ export function uiIssuesInfo(context) {
enter.merge(chips)
.selectAll('span.count')
.text(function(d) {
.html(function(d) {
return d.count.toString();
});
}
+1 -1
View File
@@ -48,7 +48,7 @@ export function uiKeepRightDetails(context) {
descriptionEnter
.append('h4')
.text(() => t('QA.keepRight.detail_description'));
.html(() => t('QA.keepRight.detail_description'));
descriptionEnter
.append('div')
+6 -6
View File
@@ -35,7 +35,7 @@ export function uiKeepRightEditor(context) {
headerEnter
.append('h3')
.text(t('QA.keepRight.title'));
.html(t('QA.keepRight.title'));
let body = selection.selectAll('.body')
@@ -90,12 +90,12 @@ export function uiKeepRightEditor(context) {
saveSectionEnter
.append('h4')
.attr('class', '.qa-save-header')
.text(t('QA.keepRight.comment'));
.html(t('QA.keepRight.comment'));
saveSectionEnter
.append('textarea')
.attr('class', 'new-comment-input')
.attr('placeholder', t('QA.keepRight.comment_placeholder'))
.attr('placeholder', t('QA.keepRight.comment_placeholder', { html: false }))
.attr('maxlength', 1000)
.property('value', d => d.newComment || d.comment)
.call(utilNoAuto)
@@ -146,7 +146,7 @@ export function uiKeepRightEditor(context) {
buttonEnter
.append('button')
.attr('class', 'button comment-button action')
.text(t('QA.keepRight.save_comment'));
.html(t('QA.keepRight.save_comment'));
buttonEnter
.append('button')
@@ -171,7 +171,7 @@ export function uiKeepRightEditor(context) {
});
buttonSection.select('.close-button') // select and propagate data
.text(d => {
.html(d => {
const andComment = (d.newComment ? '_comment' : '');
return t(`QA.keepRight.close${andComment}`);
})
@@ -185,7 +185,7 @@ export function uiKeepRightEditor(context) {
});
buttonSection.select('.ignore-button') // select and propagate data
.text(d => {
.html(d => {
const andComment = (d.newComment ? '_comment' : '');
return t(`QA.keepRight.ignore${andComment}`);
})
+1 -1
View File
@@ -47,7 +47,7 @@ export function uiKeepRightHeader() {
headerEnter
.append('div')
.attr('class', 'qa-header-label')
.text(issueTitle);
.html(issueTitle);
}
+1 -1
View File
@@ -23,7 +23,7 @@ export function uiLoading(context) {
loadertext
.append('h3')
.text(_message);
.html(_message);
_modalSelection.select('button.close')
.attr('class', 'hide');
+1 -1
View File
@@ -320,7 +320,7 @@ export function uiMapInMap(context) {
redraw();
context.keybinding()
.on(t('background.minimap.key'), toggle);
.on(t('background.minimap.key', { html: false }), toggle);
}
return mapInMap;
+2 -2
View File
@@ -55,13 +55,13 @@ export function uiNoteComments() {
.attr('target', '_blank');
}
selection
.text(function(d) { return d.user || t('note.anonymous'); });
.html(function(d) { return d.user || t('note.anonymous'); });
});
metadataEnter
.append('div')
.attr('class', 'comment-date')
.text(function(d) {
.html(function(d) {
return t('note.status.' + d.action, { when: localeDateString(d.date) });
});
+11 -11
View File
@@ -54,7 +54,7 @@ export function uiNoteEditor(context) {
headerEnter
.append('h3')
.text(t('note.title'));
.html(t('note.title'));
var body = selection.selectAll('.body')
@@ -148,14 +148,14 @@ export function uiNoteEditor(context) {
noteSaveEnter
.append('h4')
.attr('class', '.note-save-header')
.text(function() {
.html(function() {
return _note.isNew() ? t('note.newDescription') : t('note.newComment');
});
var commentTextarea = noteSaveEnter
.append('textarea')
.attr('class', 'new-comment-input')
.attr('placeholder', t('note.inputPlaceholder'))
.attr('placeholder', t('note.inputPlaceholder', { html: false }))
.attr('maxlength', 1000)
.property('value', function(d) { return d.newComment; })
.call(utilNoAuto)
@@ -256,14 +256,14 @@ export function uiNoteEditor(context) {
authEnter
.append('span')
.text(t('note.login'));
.html(t('note.login'));
authEnter
.append('a')
.attr('target', '_blank')
.call(svgIcon('#iD-icon-out-link', 'inline'))
.append('span')
.text(t('login'))
.html(t('login'))
.on('click.note-login', function() {
d3_event.preventDefault();
osm.authenticate();
@@ -284,7 +284,7 @@ export function uiNoteEditor(context) {
prose = prose.enter()
.append('p')
.attr('class', 'note-save-prose')
.text(t('note.upload_explanation'))
.html(t('note.upload_explanation'))
.merge(prose);
osm.userDetails(function(err, user) {
@@ -302,7 +302,7 @@ export function uiNoteEditor(context) {
userLink
.append('a')
.attr('class', 'user-info')
.text(user.display_name)
.html(user.display_name)
.attr('href', osm.userURL(user.display_name))
.attr('tabindex', -1)
.attr('target', '_blank');
@@ -334,12 +334,12 @@ export function uiNoteEditor(context) {
buttonEnter
.append('button')
.attr('class', 'button cancel-button secondary-action')
.text(t('confirm.cancel'));
.html(t('confirm.cancel'));
buttonEnter
.append('button')
.attr('class', 'button save-button action')
.text(t('note.save'));
.html(t('note.save'));
} else {
buttonEnter
@@ -349,7 +349,7 @@ export function uiNoteEditor(context) {
buttonEnter
.append('button')
.attr('class', 'button comment-button action')
.text(t('note.comment'));
.html(t('note.comment'));
}
@@ -366,7 +366,7 @@ export function uiNoteEditor(context) {
buttonSection.select('.status-button') // select and propagate data
.attr('disabled', (hasAuth ? null : true))
.text(function(d) {
.html(function(d) {
var action = (d.status === 'open' ? 'close' : 'open');
var andComment = (d.newComment ? '_comment' : '');
return t('note.' + action + andComment);
+1 -1
View File
@@ -41,7 +41,7 @@ export function uiNoteHeader() {
headerEnter
.append('div')
.attr('class', 'note-header-label')
.text(function(d) {
.html(function(d) {
if (_note.isNew()) { return t('note.new'); }
return t('note.note') + ' ' + d.id + ' ' +
(d.status === 'closed' ? t('note.closed') : '');
+1 -1
View File
@@ -30,7 +30,7 @@ export function uiNoteReport() {
linkEnter
.append('span')
.text(t('note.report'));
.html(t('note.report'));
}
+1 -1
View File
@@ -28,7 +28,7 @@ export function uiNotice(context) {
.call(svgIcon('#iD-icon-plus', 'pre-text'))
.append('span')
.attr('class', 'label')
.text(t('zoom_in_edit'));
.html(t('zoom_in_edit'));
function disableTooHigh() {
+6 -6
View File
@@ -45,7 +45,7 @@ export function uiOsmoseDetails(context) {
div
.append('h4')
.text(() => t('QA.keepRight.detail_description'));
.html(() => t('QA.keepRight.detail_description'));
div
.append('p')
@@ -73,7 +73,7 @@ export function uiOsmoseDetails(context) {
div
.append('h4')
.text(() => t('QA.osmose.fix_title'));
.html(() => t('QA.osmose.fix_title'));
div
.append('p')
@@ -91,7 +91,7 @@ export function uiOsmoseDetails(context) {
div
.append('h4')
.text(() => t('QA.osmose.trap_title'));
.html(() => t('QA.osmose.trap_title'));
div
.append('p')
@@ -118,7 +118,7 @@ export function uiOsmoseDetails(context) {
if (d.detail) {
detailsDiv
.append('h4')
.text(() => t('QA.osmose.detail_title'));
.html(() => t('QA.osmose.detail_title'));
detailsDiv
.append('p')
@@ -131,7 +131,7 @@ export function uiOsmoseDetails(context) {
// Create list of linked issue elements
elemsDiv
.append('h4')
.text(() => t('QA.osmose.elems_title'));
.html(() => t('QA.osmose.elems_title'));
elemsDiv
.append('ul').selectAll('li')
@@ -140,7 +140,7 @@ export function uiOsmoseDetails(context) {
.append('li')
.append('a')
.attr('class', 'error_entity_link')
.text(d => d)
.html(d => d)
.each(function() {
const link = d3_select(this);
const entityID = this.textContent;
+3 -3
View File
@@ -35,7 +35,7 @@ export function uiOsmoseEditor(context) {
headerEnter
.append('h3')
.text(t('QA.osmose.title'));
.html(t('QA.osmose.title'));
let body = selection.selectAll('.body')
.data([0]);
@@ -117,7 +117,7 @@ export function uiOsmoseEditor(context) {
.merge(buttonEnter);
buttonSection.select('.close-button')
.text(() => t('QA.keepRight.close'))
.html(() => t('QA.keepRight.close'))
.on('click.close', function(d) {
this.blur(); // avoid keeping focus on the button - #4641
const qaService = services.osmose;
@@ -128,7 +128,7 @@ export function uiOsmoseEditor(context) {
});
buttonSection.select('.ignore-button')
.text(() => t('QA.keepRight.ignore'))
.html(() => t('QA.keepRight.ignore'))
.on('click.ignore', function(d) {
this.blur(); // avoid keeping focus on the button - #4641
const qaService = services.osmose;
+1 -1
View File
@@ -65,7 +65,7 @@ export function uiOsmoseHeader() {
headerEnter
.append('div')
.attr('class', 'qa-header-label')
.text(issueTitle);
.html(issueTitle);
}
osmoseHeader.issue = function(val) {
+1 -1
View File
@@ -107,7 +107,7 @@ export function uiPane(id, context) {
heading
.append('h2')
.text(_title);
.html(_title);
heading
.append('button')
+9 -9
View File
@@ -36,7 +36,7 @@ export function uiPanelBackground(context) {
list
.append('li')
.text(currSourceName);
.html(currSourceName);
metadataKeys.forEach(function(k) {
// DigitalGlobe vintage is available in raster layers for now.
@@ -46,10 +46,10 @@ export function uiPanelBackground(context) {
.append('li')
.attr('class', 'background-info-list-' + k)
.classed('hide', !metadata[k])
.text(t('info_panels.background.' + k) + ':')
.html(t('info_panels.background.' + k) + ':')
.append('span')
.attr('class', 'background-info-span-' + k)
.text(metadata[k]);
.html(metadata[k]);
});
debouncedGetMetadata(selection);
@@ -58,7 +58,7 @@ export function uiPanelBackground(context) {
selection
.append('a')
.text(t('info_panels.background.' + toggleTiles))
.html(t('info_panels.background.' + toggleTiles))
.attr('href', '#')
.attr('class', 'button button-toggle-tiles')
.on('click', function() {
@@ -74,7 +74,7 @@ export function uiPanelBackground(context) {
var toggleVintage = showsVintage ? 'hide_vintage' : 'show_vintage';
selection
.append('a')
.text(t('info_panels.background.' + toggleVintage))
.html(t('info_panels.background.' + toggleVintage))
.attr('href', '#')
.attr('class', 'button button-toggle-vintage')
.on('click', function() {
@@ -113,7 +113,7 @@ export function uiPanelBackground(context) {
selection.selectAll('.background-info-list-zoom')
.classed('hide', false)
.selectAll('.background-info-span-zoom')
.text(metadata.zoom);
.html(metadata.zoom);
if (!d || !d.length >= 3) return;
@@ -126,7 +126,7 @@ export function uiPanelBackground(context) {
selection.selectAll('.background-info-list-vintage')
.classed('hide', false)
.selectAll('.background-info-span-vintage')
.text(metadata.vintage);
.html(metadata.vintage);
// update other metadata
metadataKeys.forEach(function(k) {
@@ -136,7 +136,7 @@ export function uiPanelBackground(context) {
selection.selectAll('.background-info-list-' + k)
.classed('hide', !val)
.selectAll('.background-info-span-' + k)
.text(val);
.html(val);
});
});
}
@@ -163,7 +163,7 @@ export function uiPanelBackground(context) {
panel.id = 'background';
panel.title = t('info_panels.background.title');
panel.key = t('info_panels.background.key');
panel.key = t('info_panels.background.key', { html: false });
return panel;
+28 -28
View File
@@ -21,14 +21,14 @@ export function uiPanelHistory(context) {
if (!userName) {
selection
.append('span')
.text(t('info_panels.history.unknown'));
.html(t('info_panels.history.unknown'));
return;
}
selection
.append('span')
.attr('class', 'user-name')
.text(userName);
.html(userName);
var links = selection
.append('div')
@@ -41,7 +41,7 @@ export function uiPanelHistory(context) {
.attr('href', osm.userURL(userName))
.attr('target', '_blank')
.attr('tabindex', -1)
.text('OSM');
.html('OSM');
}
links
@@ -50,7 +50,7 @@ export function uiPanelHistory(context) {
.attr('href', 'https://hdyc.neis-one.org/?' + userName)
.attr('target', '_blank')
.attr('tabindex', -1)
.text('HDYC');
.html('HDYC');
}
@@ -58,14 +58,14 @@ export function uiPanelHistory(context) {
if (!changeset) {
selection
.append('span')
.text(t('info_panels.history.unknown'));
.html(t('info_panels.history.unknown'));
return;
}
selection
.append('span')
.attr('class', 'changeset-id')
.text(changeset);
.html(changeset);
var links = selection
.append('div')
@@ -78,7 +78,7 @@ export function uiPanelHistory(context) {
.attr('href', osm.changesetURL(changeset))
.attr('target', '_blank')
.attr('tabindex', -1)
.text('OSM');
.html('OSM');
}
links
@@ -87,7 +87,7 @@ export function uiPanelHistory(context) {
.attr('href', 'https://osmcha.org/changesets/' + changeset)
.attr('target', '_blank')
.attr('tabindex', -1)
.text('OSMCha');
.html('OSMCha');
links
.append('a')
@@ -95,7 +95,7 @@ export function uiPanelHistory(context) {
.attr('href', 'https://overpass-api.de/achavi/?changeset=' + changeset)
.attr('target', '_blank')
.attr('tabindex', -1)
.text('Achavi');
.html('Achavi');
}
@@ -122,7 +122,7 @@ export function uiPanelHistory(context) {
selection
.append('h4')
.attr('class', 'history-heading')
.text(singular || t('info_panels.selected', { n: selected.length }));
.html(singular || t('info_panels.selected', { n: selected.length }));
if (!singular) return;
@@ -138,7 +138,7 @@ export function uiPanelHistory(context) {
if (!note || note.isNew()) {
selection
.append('div')
.text(t('info_panels.history.note_no_history'));
.html(t('info_panels.history.note_no_history'));
return;
}
@@ -147,20 +147,20 @@ export function uiPanelHistory(context) {
list
.append('li')
.text(t('info_panels.history.note_comments') + ':')
.html(t('info_panels.history.note_comments') + ':')
.append('span')
.text(note.comments.length);
.html(note.comments.length);
if (note.comments.length) {
list
.append('li')
.text(t('info_panels.history.note_created_date') + ':')
.html(t('info_panels.history.note_created_date') + ':')
.append('span')
.text(displayTimestamp(note.comments[0].date));
.html(displayTimestamp(note.comments[0].date));
list
.append('li')
.text(t('info_panels.history.note_created_user') + ':')
.html(t('info_panels.history.note_created_user') + ':')
.call(displayUser, note.comments[0].user);
}
@@ -173,7 +173,7 @@ export function uiPanelHistory(context) {
.attr('href', osm.noteURL(note))
.call(svgIcon('#iD-icon-out-link', 'inline'))
.append('span')
.text(t('info_panels.history.note_link_text'));
.html(t('info_panels.history.note_link_text'));
}
}
@@ -182,7 +182,7 @@ export function uiPanelHistory(context) {
if (!entity || entity.isNew()) {
selection
.append('div')
.text(t('info_panels.history.no_history'));
.html(t('info_panels.history.no_history'));
return;
}
@@ -197,8 +197,8 @@ export function uiPanelHistory(context) {
.attr('href', osm.historyURL(entity))
.attr('target', '_blank')
.attr('tabindex', -1)
.attr('title', t('info_panels.history.link_text'))
.text('OSM');
.attr('title', t('info_panels.history.link_text', { html: false }))
.html('OSM');
}
links
.append('a')
@@ -206,31 +206,31 @@ export function uiPanelHistory(context) {
.attr('href', 'https://pewu.github.io/osm-history/#/' + entity.type + '/' + entity.osmId())
.attr('target', '_blank')
.attr('tabindex', -1)
.text('PeWu');
.html('PeWu');
var list = selection
.append('ul');
list
.append('li')
.text(t('info_panels.history.version') + ':')
.html(t('info_panels.history.version') + ':')
.append('span')
.text(entity.version);
.html(entity.version);
list
.append('li')
.text(t('info_panels.history.last_edit') + ':')
.html(t('info_panels.history.last_edit') + ':')
.append('span')
.text(displayTimestamp(entity.timestamp));
.html(displayTimestamp(entity.timestamp));
list
.append('li')
.text(t('info_panels.history.edited_by') + ':')
.html(t('info_panels.history.edited_by') + ':')
.call(displayUser, entity.user);
list
.append('li')
.text(t('info_panels.history.changeset') + ':')
.html(t('info_panels.history.changeset') + ':')
.call(displayChangeset, entity.changeset);
}
@@ -256,7 +256,7 @@ export function uiPanelHistory(context) {
panel.id = 'history';
panel.title = t('info_panels.history.title');
panel.key = t('info_panels.history.key');
panel.key = t('info_panels.history.key', { html: false });
return panel;
+6 -6
View File
@@ -23,15 +23,15 @@ export function uiPanelLocation(context) {
list
.append('li')
.text(dmsCoordinatePair(coord))
.html(dmsCoordinatePair(coord))
.append('li')
.text(decimalCoordinatePair(coord));
.html(decimalCoordinatePair(coord));
// Location Info
selection
.append('div')
.attr('class', 'location-info')
.text(currLocation || ' ');
.html(currLocation || ' ');
debouncedGetLocation(selection, coord);
}
@@ -42,12 +42,12 @@ export function uiPanelLocation(context) {
if (!services.geocoder) {
currLocation = t('info_panels.location.unknown_location');
selection.selectAll('.location-info')
.text(currLocation);
.html(currLocation);
} else {
services.geocoder.reverse(coord, function(err, result) {
currLocation = result ? result.display_name : t('info_panels.location.unknown_location');
selection.selectAll('.location-info')
.text(currLocation);
.html(currLocation);
});
}
}
@@ -69,7 +69,7 @@ export function uiPanelLocation(context) {
panel.id = 'location';
panel.title = t('info_panels.location.title');
panel.key = t('info_panels.location.key');
panel.key = t('info_panels.location.key', { html: false });
return panel;
+20 -20
View File
@@ -110,7 +110,7 @@ export function uiPanelMeasurement(context) {
selection
.append('h4')
.attr('class', 'measurement-heading')
.text(heading);
.html(heading);
}
var list = selection
@@ -120,9 +120,9 @@ export function uiPanelMeasurement(context) {
if (geometry) {
list
.append('li')
.text(t('info_panels.measurement.geometry') + ':')
.html(t('info_panels.measurement.geometry') + ':')
.append('span')
.text(
.html(
closed ? t('info_panels.measurement.closed_' + geometry) : t('geometry.' + geometry)
);
}
@@ -130,63 +130,63 @@ export function uiPanelMeasurement(context) {
if (totalNodeCount) {
list
.append('li')
.text(t('info_panels.measurement.node_count') + ':')
.html(t('info_panels.measurement.node_count') + ':')
.append('span')
.text(totalNodeCount.toLocaleString(localeCode));
.html(totalNodeCount.toLocaleString(localeCode));
}
if (area) {
list
.append('li')
.text(t('info_panels.measurement.area') + ':')
.html(t('info_panels.measurement.area') + ':')
.append('span')
.text(displayArea(area, isImperial));
.html(displayArea(area, isImperial));
}
if (length) {
var lengthLabel = t('info_panels.measurement.' + (closed ? 'perimeter' : 'length'));
list
.append('li')
.text(lengthLabel + ':')
.html(lengthLabel + ':')
.append('span')
.text(displayLength(length, isImperial));
.html(displayLength(length, isImperial));
}
if (location) {
coordItem = list
.append('li')
.text(t('info_panels.measurement.location') + ':');
.html(t('info_panels.measurement.location') + ':');
coordItem.append('span')
.text(dmsCoordinatePair(location));
.html(dmsCoordinatePair(location));
coordItem.append('span')
.text(decimalCoordinatePair(location));
.html(decimalCoordinatePair(location));
}
if (centroid) {
coordItem = list
.append('li')
.text(t('info_panels.measurement.centroid') + ':');
.html(t('info_panels.measurement.centroid') + ':');
coordItem.append('span')
.text(dmsCoordinatePair(centroid));
.html(dmsCoordinatePair(centroid));
coordItem.append('span')
.text(decimalCoordinatePair(centroid));
.html(decimalCoordinatePair(centroid));
}
if (center) {
coordItem = list
.append('li')
.text(t('info_panels.measurement.center') + ':');
.html(t('info_panels.measurement.center') + ':');
coordItem.append('span')
.text(dmsCoordinatePair(center));
.html(dmsCoordinatePair(center));
coordItem.append('span')
.text(decimalCoordinatePair(center));
.html(decimalCoordinatePair(center));
}
if (length || area) {
var toggle = isImperial ? 'imperial' : 'metric';
selection
.append('a')
.text(t('info_panels.measurement.' + toggle))
.html(t('info_panels.measurement.' + toggle))
.attr('href', '#')
.attr('class', 'button button-toggle-units')
.on('click', function() {
@@ -219,7 +219,7 @@ export function uiPanelMeasurement(context) {
panel.id = 'measurement';
panel.title = t('info_panels.measurement.title');
panel.key = t('info_panels.measurement.key');
panel.key = t('info_panels.measurement.key', { html: false });
return panel;
+1 -1
View File
@@ -10,7 +10,7 @@ import { uiSectionOverlayList } from '../sections/overlay_list';
export function uiPaneBackground(context) {
var backgroundPane = uiPane('background', context)
.key(t('background.key'))
.key(t('background.key', { html: false }))
.title(t('background.title'))
.description(t('background.description'))
.iconName('iD-icon-layers')
+5 -5
View File
@@ -255,7 +255,7 @@ export function uiPaneHelp(context) {
});
var helpPane = uiPane('help', context)
.key(t('help.key'))
.key(t('help.key', { html: false }))
.title(t('help.title'))
.description(t('help.title'))
.iconName('iD-icon-help');
@@ -293,7 +293,7 @@ export function uiPaneHelp(context) {
nextLink
.append('span')
.text(docs[i + 1].title)
.html(docs[i + 1].title)
.call(svgIcon((rtl ? '#iD-icon-backward' : '#iD-icon-forward'), 'inline'));
}
}
@@ -311,7 +311,7 @@ export function uiPaneHelp(context) {
prevLink
.call(svgIcon((rtl ? '#iD-icon-forward' : '#iD-icon-backward'), 'inline'))
.append('span')
.text(docs[i - 1].title);
.html(docs[i - 1].title);
}
}
}
@@ -353,7 +353,7 @@ export function uiPaneHelp(context) {
shortcuts
.append('div')
.text(t('shortcuts.title'));
.html(t('shortcuts.title'));
var walkthrough = toc
.append('li')
@@ -369,7 +369,7 @@ export function uiPaneHelp(context) {
walkthrough
.append('div')
.text(t('splash.walkthrough'));
.html(t('splash.walkthrough'));
var helpContent = content
+1 -1
View File
@@ -10,7 +10,7 @@ import { uiSectionValidationStatus } from '../sections/validation_status';
export function uiPaneIssues(context) {
var issuesPane = uiPane('issues', context)
.key(t('issues.key'))
.key(t('issues.key', { html: false }))
.title(t('issues.title'))
.description(t('issues.title'))
.iconName('iD-icon-alert')
+1 -1
View File
@@ -10,7 +10,7 @@ import { uiSectionPhotoOverlays } from '../sections/photo_overlays';
export function uiPaneMapData(context) {
var mapDataPane = uiPane('map-data', context)
.key(t('map_data.key'))
.key(t('map_data.key', { html: false }))
.title(t('map_data.title'))
.description(t('map_data.description'))
.iconName('iD-icon-data')
+1 -1
View File
@@ -6,7 +6,7 @@ import { uiSectionPrivacy } from '../sections/privacy';
export function uiPanePreferences(context) {
let preferencesPane = uiPane('preferences', context)
.key(t('preferences.key'))
.key(t('preferences.key', { html: false }))
.title(t('preferences.title'))
.description(t('preferences.description'))
.iconName('fas-user-cog')
+4 -4
View File
@@ -38,7 +38,7 @@ export function uiPresetList(context) {
var message = messagewrap
.append('h3')
.text(t('inspector.choose'));
.html(t('inspector.choose'));
messagewrap
.append('button')
@@ -110,7 +110,7 @@ export function uiPresetList(context) {
messageText = t('inspector.choose');
}
list.call(drawList, results);
message.text(messageText);
message.html(messageText);
}
var searchWrap = selection
@@ -123,7 +123,7 @@ export function uiPresetList(context) {
var search = searchWrap
.append('input')
.attr('class', 'preset-search-input')
.attr('placeholder', t('inspector.search'))
.attr('placeholder', t('inspector.search', { html: false }))
.attr('type', 'search')
.call(utilNoAuto)
.on('keydown', initialKeydown)
@@ -392,7 +392,7 @@ export function uiPresetList(context) {
.enter()
.append('div')
.attr('class', 'namepart')
.text(function(d) { return d; });
.html(function(d) { return d; });
wrap.call(item.reference.button);
selection.call(item.reference.body);
+4 -4
View File
@@ -17,13 +17,13 @@ export function uiRestore(context) {
.append('div')
.attr('class', 'modal-section')
.append('h3')
.text(t('restore.heading'));
.html(t('restore.heading'));
introModal
.append('div')
.attr('class','modal-section')
.append('p')
.text(t('restore.description'));
.html(t('restore.description'));
let buttonWrap = introModal
.append('div')
@@ -45,7 +45,7 @@ export function uiRestore(context) {
restore
.append('div')
.text(t('restore.restore'));
.html(t('restore.restore'));
let reset = buttonWrap
.append('button')
@@ -63,7 +63,7 @@ export function uiRestore(context) {
reset
.append('div')
.text(t('restore.reset'));
.html(t('restore.reset'));
restore.node().focus();
};
+1 -1
View File
@@ -55,7 +55,7 @@ export function uiScale(context) {
selection.select('.scale-text')
.style(localizer.textDirection() === 'ltr' ? 'left' : 'right', (scale.px + 16) + 'px')
.text(scale.text);
.html(scale.text);
}
@@ -70,7 +70,7 @@ export function uiSectionBackgroundDisplayOptions(context) {
slidersEnter
.append('h5')
.text(function(d) { return t('background.' + d); })
.html(function(d) { return t('background.' + d); })
.append('span')
.attr('class', function(d) { return 'display-option-value display-option-value-' + d; });
@@ -92,7 +92,7 @@ export function uiSectionBackgroundDisplayOptions(context) {
sildersControlEnter
.append('button')
.attr('title', t('background.reset'))
.attr('title', t('background.reset', { html: false }))
.attr('class', function(d) { return 'display-option-reset display-option-reset-' + d; })
.on('click', function(d) {
if (d3_event.button !== 0) return;
@@ -105,7 +105,7 @@ export function uiSectionBackgroundDisplayOptions(context) {
.append('a')
.attr('class', 'display-option-resetlink')
.attr('href', '#')
.text(t('background.reset_all'))
.html(t('background.reset_all'))
.on('click', function() {
for (var i = 0; i < _sliders.length; i++) {
updateValue(_sliders[i],1);
@@ -120,7 +120,7 @@ export function uiSectionBackgroundDisplayOptions(context) {
.property('value', function(d) { return _options[d]; });
container.selectAll('.display-option-value')
.text(function(d) { return Math.floor(_options[d] * 100) + '%'; });
.html(function(d) { return Math.floor(_options[d] * 100) + '%'; });
container.selectAll('.display-option-reset')
.classed('disabled', function(d) { return _options[d] === 1; });
+9 -9
View File
@@ -57,7 +57,7 @@ export function uiSectionBackgroundList(context) {
.append('label')
.call(uiTooltip()
.title(t('background.minimap.tooltip'))
.keys([t('background.minimap.key')])
.keys([t('background.minimap.key', { html: false })])
.placement('top')
);
@@ -71,7 +71,7 @@ export function uiSectionBackgroundList(context) {
minimapLabelEnter
.append('span')
.text(t('background.minimap.description'));
.html(t('background.minimap.description'));
var panelLabelEnter = bgExtrasListEnter
@@ -80,7 +80,7 @@ export function uiSectionBackgroundList(context) {
.append('label')
.call(uiTooltip()
.title(t('background.panel.tooltip'))
.keys([uiCmd('⌘⇧' + t('info_panels.background.key'))])
.keys([uiCmd('⌘⇧' + t('info_panels.background.key', { html: false }))])
.placement('top')
);
@@ -94,7 +94,7 @@ export function uiSectionBackgroundList(context) {
panelLabelEnter
.append('span')
.text(t('background.panel.description'));
.html(t('background.panel.description'));
var locPanelLabelEnter = bgExtrasListEnter
.append('li')
@@ -102,7 +102,7 @@ export function uiSectionBackgroundList(context) {
.append('label')
.call(uiTooltip()
.title(t('background.location_panel.tooltip'))
.keys([uiCmd('⌘⇧' + t('info_panels.location.key'))])
.keys([uiCmd('⌘⇧' + t('info_panels.location.key', { html: false }))])
.placement('top')
);
@@ -116,7 +116,7 @@ export function uiSectionBackgroundList(context) {
locPanelLabelEnter
.append('span')
.text(t('background.location_panel.description'));
.html(t('background.location_panel.description'));
// "Info / Report a Problem" link
@@ -130,7 +130,7 @@ export function uiSectionBackgroundList(context) {
.call(svgIcon('#iD-icon-out-link', 'inline'))
.attr('href', 'https://github.com/openstreetmap/iD/blob/develop/FAQ.md#how-can-i-report-an-issue-with-background-imagery')
.append('span')
.text(t('background.imagery_problem_faq'));
.html(t('background.imagery_problem_faq'));
_backgroundList
.call(drawListItems, 'radio', chooseBackground, function(d) { return !d.isHidden() && !d.overlay; });
@@ -150,7 +150,7 @@ export function uiSectionBackgroundList(context) {
item.call(uiTooltip()
.placement(placement)
.title('<div>' + t('background.switch') + '</div>')
.keys([uiCmd('⌘' + t('background.key'))])
.keys([uiCmd('⌘' + t('background.key', { html: false }))])
);
} else if (description || isOverflowing) {
item.call(uiTooltip()
@@ -188,7 +188,7 @@ export function uiSectionBackgroundList(context) {
label
.append('span')
.text(function(d) { return d.name(); });
.html(function(d) { return d.name(); });
enter.filter(function(d) { return d.id === 'custom'; })
.append('button')
+2 -2
View File
@@ -161,7 +161,7 @@ export function uiSectionBackgroundOffset(context) {
containerEnter
.append('div')
.attr('class', 'nudge-instructions')
.text(t('background.offset'));
.html(t('background.offset'));
var nudgeEnter = containerEnter
.append('div')
@@ -189,7 +189,7 @@ export function uiSectionBackgroundOffset(context) {
containerEnter
.append('button')
.attr('title', t('background.reset'))
.attr('title', t('background.reset', { html: false }))
.attr('class', 'nudge-reset disabled')
.on('contextmenu', cancelEvent)
.on('click', function() {
+4 -4
View File
@@ -68,12 +68,12 @@ export function uiSectionChanges(context) {
itemsEnter
.append('span')
.attr('class', 'change-type')
.text(function(d) { return t('commit.' + d.changeType) + ' '; });
.html(function(d) { return t('commit.' + d.changeType) + ' '; });
itemsEnter
.append('strong')
.attr('class', 'entity-type')
.text(function(d) {
.html(function(d) {
var matched = presetManager.match(d.entity, d.graph);
return (matched && matched.name()) || utilDisplayType(d.entity.id);
});
@@ -81,7 +81,7 @@ export function uiSectionChanges(context) {
itemsEnter
.append('span')
.attr('class', 'entity-name')
.text(function(d) {
.html(function(d) {
var name = utilDisplayName(d.entity) || '',
string = '';
if (name !== '') {
@@ -136,7 +136,7 @@ export function uiSectionChanges(context) {
linkEnter
.call(svgIcon('#iD-icon-load', 'inline'))
.append('span')
.text(t('commit.download_changes'));
.html(t('commit.download_changes'));
function mouseover(d) {

Some files were not shown because too many files have changed in this diff Show More