diff --git a/modules/validations/almost_junction.js b/modules/validations/almost_junction.js index e45b1f7495..dae91a75ce 100644 --- a/modules/validations/almost_junction.js +++ b/modules/validations/almost_junction.js @@ -57,12 +57,12 @@ export function validationAlmostJunction(context) { const graph = editor.staging.graph; const entity1 = graph.hasEntity(this.entityIds[0]); if (this.entityIds[0] === this.entityIds[2]) { - return entity1 ? l10n.tHtml('issues.almost_junction.self.message', { + return entity1 ? l10n.t('issues.almost_junction.self.message', { feature: l10n.displayLabel(entity1, graph) }) : ''; } else { const entity2 = graph.hasEntity(this.entityIds[2]); - return (entity1 && entity2) ? l10n.tHtml('issues.almost_junction.message', { + return (entity1 && entity2) ? l10n.t('issues.almost_junction.message', { feature: l10n.displayLabel(entity1, graph), feature2: l10n.displayLabel(entity2, graph) }) : ''; @@ -93,7 +93,7 @@ export function validationAlmostJunction(context) { let fixes = [new ValidationFix({ icon: 'rapid-icon-abutment', - title: l10n.tHtml('issues.fix.connect_features.title'), + title: l10n.t('issues.fix.connect_features.title'), onClick: function() { const annotation = l10n.t('issues.fix.connect_almost_junction.annotation'); const [, endNodeId, crossWayId] = this.issue.entityIds; @@ -144,7 +144,7 @@ export function validationAlmostJunction(context) { // node has no descriptive tags, suggest noexit fix fixes.push(new ValidationFix({ icon: 'maki-barrier', - title: l10n.tHtml('issues.fix.tag_as_disconnected.title'), + title: l10n.t('issues.fix.tag_as_disconnected.title'), onClick: function() { const nodeID = this.issue.entityIds[1]; const tags = Object.assign({}, graph.entity(nodeID).tags); @@ -167,7 +167,7 @@ export function validationAlmostJunction(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.almost_junction.highway-highway.reference')); + .text(l10n.t('issues.almost_junction.highway-highway.reference')); } function isExtendableCandidate(node, way) { diff --git a/modules/validations/ambiguous_crossing_tags.js b/modules/validations/ambiguous_crossing_tags.js index d5f56072f9..745df5c881 100644 --- a/modules/validations/ambiguous_crossing_tags.js +++ b/modules/validations/ambiguous_crossing_tags.js @@ -349,7 +349,7 @@ export function validationAmbiguousCrossingTags(context) { const klass = (d.type === '+') ? 'add' : 'remove'; return `tagDiff-cell tagDiff-cell-${klass}`; }) - .html(d => d.display); + .text(d => d.display); } }); } diff --git a/modules/validations/close_nodes.js b/modules/validations/close_nodes.js index e581725d8e..fdd2d3c4fc 100644 --- a/modules/validations/close_nodes.js +++ b/modules/validations/close_nodes.js @@ -181,7 +181,7 @@ export function validationCloseNodes(context) { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); const entity2 = graph.hasEntity(this.entityIds[1]); - return (entity && entity2) ? l10n.tHtml('issues.close_nodes.detached.message', { + return (entity && entity2) ? l10n.t('issues.close_nodes.detached.message', { feature: l10n.displayLabel(entity, graph), feature2: l10n.displayLabel(entity2, graph) }) : ''; @@ -192,11 +192,11 @@ export function validationCloseNodes(context) { return [ new ValidationFix({ icon: 'rapid-operation-disconnect', - title: l10n.tHtml('issues.fix.move_points_apart.title') + title: l10n.t('issues.fix.move_points_apart.title') }), new ValidationFix({ icon: 'rapid-icon-layers', - title: l10n.tHtml('issues.fix.use_different_layers_or_levels.title') + title: l10n.t('issues.fix.use_different_layers_or_levels.title') }) ]; } @@ -207,13 +207,12 @@ export function validationCloseNodes(context) { return issues; function showReference(selection) { - const referenceText = l10n.t('issues.close_nodes.detached.reference'); selection.selectAll('.issue-reference') .data([0]) .enter() .append('div') .attr('class', 'issue-reference') - .html(referenceText); + .text(l10n.t('issues.close_nodes.detached.reference')); } } @@ -254,7 +253,7 @@ export function validationCloseNodes(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.close_nodes.message', { way: l10n.displayLabel(entity, graph) }) : ''; + return entity ? l10n.t('issues.close_nodes.message', { way: l10n.displayLabel(entity, graph) }) : ''; }, reference: showReference, entityIds: [way.id, node1.id, node2.id], @@ -267,7 +266,7 @@ export function validationCloseNodes(context) { return [ new ValidationFix({ icon: 'rapid-icon-plus', - title: l10n.tHtml('issues.fix.merge_points.title'), + title: l10n.t('issues.fix.merge_points.title'), onClick: function() { const entityIds = this.issue.entityIds; editor.perform(actionMergeNodes([entityIds[1], entityIds[2]])); @@ -279,20 +278,19 @@ export function validationCloseNodes(context) { }), new ValidationFix({ icon: 'rapid-operation-disconnect', - title: l10n.tHtml('issues.fix.move_points_apart.title') + title: l10n.t('issues.fix.move_points_apart.title') }) ]; } }); function showReference(selection) { - const referenceText = l10n.t('issues.close_nodes.reference'); selection.selectAll('.issue-reference') .data([0]) .enter() .append('div') .attr('class', 'issue-reference') - .html(referenceText); + .text(l10n.t('issues.close_nodes.reference')); } } diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index 703ff543e2..7c4d9ccb05 100644 --- a/modules/validations/crossing_ways.js +++ b/modules/validations/crossing_ways.js @@ -493,7 +493,7 @@ export function validationCrossingWays(context) { const graph = editor.staging.graph; const entity1 = graph.hasEntity(this.entityIds[0]); const entity2 = graph.hasEntity(this.entityIds[1]); - return (entity1 && entity2) ? l10n.tHtml('issues.crossing_ways.message', { + return (entity1 && entity2) ? l10n.t('issues.crossing_ways.message', { feature: l10n.displayLabel(entity1, graph), feature2: l10n.displayLabel(entity2, graph) }) : ''; @@ -531,7 +531,7 @@ export function validationCrossingWays(context) { if (isCrossingIndoors) { fixes.push(new ValidationFix({ icon: 'rapid-icon-layers', - title: l10n.tHtml('issues.fix.use_different_levels.title') + title: l10n.t('issues.fix.use_different_levels.title') })); } else if (isCrossingTunnels || isCrossingBridges || type1 === 'building' || type2 === 'building') { @@ -557,7 +557,7 @@ export function validationCrossingWays(context) { // repositioning the features is always an option fixes.push(new ValidationFix({ icon: 'rapid-operation-move', - title: l10n.tHtml('issues.fix.reposition_features.title') + title: l10n.t('issues.fix.reposition_features.title') })); return fixes; @@ -570,7 +570,7 @@ export function validationCrossingWays(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml(`issues.crossing_ways.${crossingTypeID}.reference`)); + .text(l10n.t(`issues.crossing_ways.${crossingTypeID}.reference`)); } } @@ -585,7 +585,7 @@ export function validationCrossingWays(context) { function makeAddBridgeOrTunnelFix(titleID, iconName, bridgeOrTunnel) { return new ValidationFix({ icon: iconName, - title: l10n.tHtml(`issues.fix.${titleID}.title`), + title: l10n.t(`issues.fix.${titleID}.title`), onClick: function() { if (context.mode?.id !== 'select-osm') return; @@ -854,7 +854,7 @@ export function validationCrossingWays(context) { return new ValidationFix({ icon: iconID, - title: l10n.tHtml(`issues.fix.${titleID}.title`), + title: l10n.t(`issues.fix.${titleID}.title`), onClick: function() { const loc = this.issue.loc; const edges = this.issue.data.edges; @@ -880,7 +880,7 @@ export function validationCrossingWays(context) { function makeChangeLayerFix(higherOrLower) { return new ValidationFix({ icon: 'rapid-icon-' + (higherOrLower === 'higher' ? 'up' : 'down'), - title: l10n.tHtml(`issues.fix.tag_this_as_${higherOrLower}.title`), + title: l10n.t(`issues.fix.tag_this_as_${higherOrLower}.title`), onClick: function() { if (context.mode?.id !== 'select-osm') return; diff --git a/modules/validations/disconnected_way.js b/modules/validations/disconnected_way.js index e90b2459de..b29f7484f0 100644 --- a/modules/validations/disconnected_way.js +++ b/modules/validations/disconnected_way.js @@ -28,7 +28,7 @@ export function validationDisconnectedWay(context) { const graph = editor.staging.graph; const entity = this.entityIds.length && graph.hasEntity(this.entityIds[0]); const label = entity && l10n.displayLabel(entity, graph); - return l10n.tHtml('issues.disconnected_way.routable.message', { count: this.entityIds.length, highway: label }); + return l10n.t('issues.disconnected_way.routable.message', { count: this.entityIds.length, highway: label }); }, reference: showReference, entityIds: Array.from(routingIslandEntities).map(entity => entity.id), @@ -51,13 +51,13 @@ export function validationDisconnectedWay(context) { } if (!fixes.length) { fixes.push(new ValidationFix({ - title: l10n.tHtml('issues.fix.connect_feature.title') + title: l10n.t('issues.fix.connect_feature.title') })); } fixes.push(new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml('issues.fix.delete_feature.title'), + title: l10n.t('issues.fix.delete_feature.title'), entityIds: [ singleEntity.id ], onClick: function() { const id = this.issue.entityIds[0]; @@ -69,7 +69,7 @@ export function validationDisconnectedWay(context) { })); } else { fixes.push(new ValidationFix({ - title: l10n.tHtml('issues.fix.connect_features.title') + title: l10n.t('issues.fix.connect_features.title') })); } @@ -83,7 +83,7 @@ export function validationDisconnectedWay(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.disconnected_way.routable.reference')); + .text(l10n.t('issues.disconnected_way.routable.reference')); } @@ -178,7 +178,7 @@ export function validationDisconnectedWay(context) { return new ValidationFix({ icon: 'rapid-operation-continue' + (useLeftContinue ? '-left' : ''), - title: l10n.tHtml(`issues.fix.continue_from_${whichEnd}.title`), + title: l10n.t(`issues.fix.continue_from_${whichEnd}.title`), entityIds: [vertexID], onClick: function() { const graph = editor.staging.graph; diff --git a/modules/validations/duplicate_way_segments.js b/modules/validations/duplicate_way_segments.js index 5bd849702f..2026635707 100644 --- a/modules/validations/duplicate_way_segments.js +++ b/modules/validations/duplicate_way_segments.js @@ -80,7 +80,7 @@ export function validationDuplicateWaySegments(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.duplicate_way_segments.message', { + return entity ? l10n.t('issues.duplicate_way_segments.message', { way: l10n.displayLabel(entity, graph) }) : ''; }, @@ -91,15 +91,15 @@ export function validationDuplicateWaySegments(context) { return [ new ValidationFix({ icon: 'rapid-icon-plus', - title: l10n.tHtml('issues.fix.merge_points.title'), + title: l10n.t('issues.fix.merge_points.title'), }), new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml('issues.fix.remove_way_segments.title') + title: l10n.t('issues.fix.remove_way_segments.title') }), new ValidationFix({ icon: 'rapid-operation-disconnect', - title: l10n.tHtml('issues.fix.move_way_segments_apart.title') + title: l10n.t('issues.fix.move_way_segments_apart.title') }) ]; } @@ -112,7 +112,7 @@ export function validationDuplicateWaySegments(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.t('issues.duplicate_way_segments.reference')); + .text(l10n.t('issues.duplicate_way_segments.reference')); } } diff --git a/modules/validations/help_request.js b/modules/validations/help_request.js index c1c21f1612..f848516f4c 100644 --- a/modules/validations/help_request.js +++ b/modules/validations/help_request.js @@ -26,13 +26,13 @@ export function validationHelpRequest(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.fixme_tag.message', { + return entity ? l10n.t('issues.fixme_tag.message', { feature: l10n.displayLabel(entity, graph, true) // true = verbose }) : ''; }, dynamicFixes: () => { return [ - new ValidationFix({ title: l10n.tHtml('issues.fix.address_the_concern.title') }) + new ValidationFix({ title: l10n.t('issues.fix.address_the_concern.title') }) ]; }, reference: showReference, @@ -45,7 +45,7 @@ export function validationHelpRequest(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.fixme_tag.reference')); + .text(l10n.t('issues.fixme_tag.reference')); } }; diff --git a/modules/validations/impossible_oneway.js b/modules/validations/impossible_oneway.js index c2ee29e79b..0892edac94 100644 --- a/modules/validations/impossible_oneway.js +++ b/modules/validations/impossible_oneway.js @@ -131,7 +131,7 @@ export function validationImpossibleOneway(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml(`issues.impossible_oneway.${messageID}.message`, { + return entity ? l10n.t(`issues.impossible_oneway.${messageID}.message`, { feature: l10n.displayLabel(entity, graph) }) : ''; }, @@ -143,7 +143,7 @@ export function validationImpossibleOneway(context) { if (attachedOneways.length) { fixes.push(new ValidationFix({ icon: 'rapid-operation-reverse', - title: l10n.tHtml('issues.fix.reverse_feature.title'), + title: l10n.t('issues.fix.reverse_feature.title'), entityIds: [way.id], onClick: function() { const entityID = this.issue.entityIds[0]; @@ -160,7 +160,7 @@ export function validationImpossibleOneway(context) { const useLeftContinue = (isFirst && !isRTL) || (!isFirst && isRTL); fixes.push(new ValidationFix({ icon: 'rapid-operation-continue' + (useLeftContinue ? '-left' : ''), - title: l10n.tHtml('issues.fix.continue_from_' + (isFirst ? 'start' : 'end') + '.title'), + title: l10n.t('issues.fix.continue_from_' + (isFirst ? 'start' : 'end') + '.title'), onClick: function() { const entityID = this.issue.entityIds[0]; const vertexID = this.issue.entityIds[1]; @@ -183,7 +183,7 @@ export function validationImpossibleOneway(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml(`issues.impossible_oneway.${referenceID}.reference`)); + .text(l10n.t(`issues.impossible_oneway.${referenceID}.reference`)); }; } } diff --git a/modules/validations/incompatible_source.js b/modules/validations/incompatible_source.js index d137f95b2a..439611eee1 100644 --- a/modules/validations/incompatible_source.js +++ b/modules/validations/incompatible_source.js @@ -43,7 +43,7 @@ export function validationIncompatibleSource(context) { message: () => { const graph = editor.staging.graph; const entity = graph.hasEntity(entityID); - return entity ? l10n.tHtml('issues.incompatible_source.feature.message', { + return entity ? l10n.t('issues.incompatible_source.feature.message', { feature: l10n.displayLabel(entity, graph, true), // true = verbose value: source }) : ''; @@ -53,7 +53,7 @@ export function validationIncompatibleSource(context) { hash: source, dynamicFixes: () => { return [ - new ValidationFix({ title: l10n.tHtml('issues.fix.remove_proprietary_data.title') }) + new ValidationFix({ title: l10n.t('issues.fix.remove_proprietary_data.title') }) ]; } }); @@ -68,7 +68,7 @@ export function validationIncompatibleSource(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml(`issues.incompatible_source.reference.${id}`)); + .text(l10n.t(`issues.incompatible_source.reference.${id}`)); }; } }; diff --git a/modules/validations/invalid_format.js b/modules/validations/invalid_format.js index 98a225f1ae..8d21e173a5 100644 --- a/modules/validations/invalid_format.js +++ b/modules/validations/invalid_format.js @@ -31,7 +31,7 @@ export function validationFormatting(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.invalid_format.email.reference')); + .text(l10n.t('issues.invalid_format.email.reference')); } /* @@ -41,7 +41,7 @@ export function validationFormatting(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.invalid_format.website.reference')); + .text(l10n.t('issues.invalid_format.website.reference')); } if (entity.tags.website) { @@ -59,7 +59,7 @@ export function validationFormatting(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.invalid_format.website.message' + this.data, + return entity ? l10n.t('issues.invalid_format.website.message' + this.data, { feature: l10n.displayLabel(entity, graph), site: websites.join(', ') }) : ''; }, reference: showReferenceWebsite, @@ -86,8 +86,8 @@ export function validationFormatting(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.invalid_format.email.message' + this.data, - { feature: l10n.displayLabel(entity, graph), email: emails.join(', ') }) : ''; + return entity ? l10n.t('issues.invalid_format.email.message' + this.data, + { feature: l10n.displayLabel(entity, graph), email: emails.join(', ') }) : ''; }, reference: showReferenceEmail, entityIds: [entity.id], diff --git a/modules/validations/mismatched_geometry.js b/modules/validations/mismatched_geometry.js index 0e085964b6..2cd67585ab 100644 --- a/modules/validations/mismatched_geometry.js +++ b/modules/validations/mismatched_geometry.js @@ -100,7 +100,7 @@ export function validationMismatchedGeometry(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.tag_suggests_area.message', { + return entity ? l10n.t('issues.tag_suggests_area.message', { feature: l10n.displayLabel(entity, 'area', true), // true = verbose tag: utilTagText({ tags: tagSuggestingArea }) }) : ''; @@ -115,13 +115,13 @@ export function validationMismatchedGeometry(context) { var connectEndsOnClick = makeConnectEndpointsFixOnClick(entity, graph); fixes.push(new ValidationFix({ - title: l10n.tHtml('issues.fix.connect_endpoints.title'), + title: l10n.t('issues.fix.connect_endpoints.title'), onClick: connectEndsOnClick })); fixes.push(new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml('issues.fix.remove_tag.title'), + title: l10n.t('issues.fix.remove_tag.title'), onClick: function() { const entityID = this.issue.entityIds[0]; const graph = editor.staging.graph; @@ -149,7 +149,7 @@ export function validationMismatchedGeometry(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.tag_suggests_area.reference')); + .text(l10n.t('issues.tag_suggests_area.reference')); } } @@ -175,7 +175,7 @@ export function validationMismatchedGeometry(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.vertex_as_point.message', { + return entity ? l10n.t('issues.vertex_as_point.message', { feature: l10n.displayLabel(entity, 'vertex', true /* verbose */) }) : ''; }, @@ -185,7 +185,7 @@ export function validationMismatchedGeometry(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.vertex_as_point.reference')); + .text(l10n.t('issues.vertex_as_point.reference')); }, entityIds: [entity.id] }); @@ -199,7 +199,7 @@ export function validationMismatchedGeometry(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.point_as_vertex.message', { + return entity ? l10n.t('issues.point_as_vertex.message', { feature: l10n.displayLabel(entity, 'point', true /* verbose */) }) : ''; }, @@ -209,7 +209,7 @@ export function validationMismatchedGeometry(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.point_as_vertex.reference')); + .text(l10n.t('issues.point_as_vertex.reference')); }, entityIds: [entity.id], dynamicFixes: extractPointDynamicFixes @@ -278,7 +278,7 @@ export function validationMismatchedGeometry(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.' + referenceId + '.message', { + return entity ? l10n.t('issues.' + referenceId + '.message', { feature: l10n.displayLabel(entity, targetGeom, true /* verbose */) }) : ''; }, @@ -288,7 +288,7 @@ export function validationMismatchedGeometry(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.mismatched_geometry.reference')); + .text(l10n.t('issues.mismatched_geometry.reference')); }, entityIds: [entity.id], dynamicFixes: dynamicFixes @@ -328,7 +328,7 @@ export function validationMismatchedGeometry(context) { return [ new ValidationFix({ icon: 'rapid-icon-line', - title: l10n.tHtml('issues.fix.convert_to_line.title'), + title: l10n.t('issues.fix.convert_to_line.title'), onClick: convertOnClick }) ]; @@ -359,7 +359,7 @@ export function validationMismatchedGeometry(context) { return [ new ValidationFix({ icon: 'rapid-operation-extract', - title: l10n.tHtml('issues.fix.extract_point.title'), + title: l10n.t('issues.fix.extract_point.title'), onClick: extractOnClick }) ]; @@ -394,7 +394,7 @@ export function validationMismatchedGeometry(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.unclosed_multipolygon_part.message', { + return entity ? l10n.t('issues.unclosed_multipolygon_part.message', { feature: l10n.displayLabel(entity, graph, true /* verbose */) }) : ''; }, @@ -416,7 +416,7 @@ export function validationMismatchedGeometry(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.unclosed_multipolygon_part.reference')); + .text(l10n.t('issues.unclosed_multipolygon_part.reference')); } } diff --git a/modules/validations/missing_role.js b/modules/validations/missing_role.js index 1ff992008f..9d293bfbd3 100644 --- a/modules/validations/missing_role.js +++ b/modules/validations/missing_role.js @@ -48,7 +48,7 @@ export function validationMissingRole(context) { const graph = editor.staging.graph; const member = graph.hasEntity(this.entityIds[1]); const relation = graph.hasEntity(this.entityIds[0]); - return (member && relation) ? l10n.tHtml('issues.missing_role.message', { + return (member && relation) ? l10n.t('issues.missing_role.message', { member: l10n.displayLabel(member, graph), relation: l10n.displayLabel(relation, graph) }) : ''; @@ -63,7 +63,7 @@ export function validationMissingRole(context) { makeAddRoleFix('outer'), new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml('issues.fix.remove_from_relation.title'), + title: l10n.t('issues.fix.remove_from_relation.title'), onClick: () => { const parentID = this.issue.entityIds[0]; editor.perform(actionDeleteMember(parentID, this.issue.data.member.index)); @@ -84,14 +84,14 @@ export function validationMissingRole(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.missing_role.multipolygon.reference')); + .text(l10n.t('issues.missing_role.multipolygon.reference')); } } function makeAddRoleFix(role) { return new ValidationFix({ - title: l10n.tHtml(`issues.fix.set_as_${role}.title`), + title: l10n.t(`issues.fix.set_as_${role}.title`), onClick: () => { const oldMember = this.issue.data.member; const member = { id: this.issue.entityIds[1], type: oldMember.type, role: role }; diff --git a/modules/validations/missing_tag.js b/modules/validations/missing_tag.js index c43ad35419..632dc8d3dc 100644 --- a/modules/validations/missing_tag.js +++ b/modules/validations/missing_tag.js @@ -81,7 +81,7 @@ export function validationMissingTag(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml(`issues.${messageID}.message`, { + return entity ? l10n.t(`issues.${messageID}.message`, { feature: l10n.displayLabel(entity, graph) }) : ''; }, @@ -92,7 +92,7 @@ export function validationMissingTag(context) { const selectFixType = subtype === 'highway_classification' ? 'select_road_type' : 'select_preset'; fixes.push(new ValidationFix({ icon: 'rapid-icon-search', - title: l10n.tHtml(`issues.fix.${selectFixType}.title`), + title: l10n.t(`issues.fix.${selectFixType}.title`), onClick: function() { context.systems.ui.sidebar.showPresetList(); } @@ -115,7 +115,7 @@ export function validationMissingTag(context) { fixes.push( new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml('issues.fix.delete_feature.title'), + title: l10n.t('issues.fix.delete_feature.title'), disabledReason: disabledReasonID ? l10n.t(`operations.delete.${disabledReasonID}.single`) : undefined, onClick: deleteOnClick }) @@ -131,7 +131,7 @@ export function validationMissingTag(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml(`issues.${referenceID}.reference`)); + .text(l10n.t(`issues.${referenceID}.reference`)); } }; diff --git a/modules/validations/outdated_tags.js b/modules/validations/outdated_tags.js index cb9fd2f097..77a334026c 100644 --- a/modules/validations/outdated_tags.js +++ b/modules/validations/outdated_tags.js @@ -160,7 +160,7 @@ export function validationOutdatedTags(context) { dynamicFixes: () => { let fixes = [ new ValidationFix({ - title: l10n.tHtml('issues.fix.upgrade_tags.title'), + title: l10n.t('issues.fix.upgrade_tags.title'), onClick: () => { editor.perform(actionDoTagUpgrade); editor.commit({ @@ -175,7 +175,7 @@ export function validationOutdatedTags(context) { if (item) { fixes.push( new ValidationFix({ - title: l10n.tHtml('issues.fix.tag_as_not.title', { name: item.displayName }), + title: l10n.t('issues.fix.tag_as_not.title', { name: item.displayName }), onClick: () => { editor.perform(actionAddNotTag); editor.commit({ @@ -239,11 +239,11 @@ export function validationOutdatedTags(context) { const currEntity = graph.hasEntity(entity.id); if (!currEntity) return ''; - let messageID = `issues.outdated_tags.${prefix}message`; + let stringID = `issues.outdated_tags.${prefix}message`; if (subtype === 'noncanonical_brand' && isOnlyAddingTags) { - messageID += '_incomplete'; + stringID += '_incomplete'; } - return l10n.tHtml(messageID, { + return l10n.t(stringID, { feature: l10n.displayLabel(currEntity, graph, true /* verbose */) }); } @@ -257,11 +257,11 @@ export function validationOutdatedTags(context) { enter .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml(`issues.outdated_tags.${prefix}reference`)); + .text(l10n.t(`issues.outdated_tags.${prefix}reference`)); enter .append('strong') - .html(l10n.tHtml('issues.suggested')); + .text(l10n.t('issues.suggested')); enter .append('table') @@ -276,7 +276,7 @@ export function validationOutdatedTags(context) { const klass = (d.type === '+') ? 'add' : 'remove'; return `tagDiff-cell tagDiff-cell-${klass}`; }) - .html(d => d.display); + .text(d => d.display); } } @@ -339,7 +339,7 @@ export function validationOutdatedTags(context) { let currMultipolygon = graph.hasEntity(multipolygon.id); if (!currMultipolygon) return ''; - return l10n.tHtml('issues.old_multipolygon.message', + return l10n.t('issues.old_multipolygon.message', { multipolygon: l10n.displayLabel(currMultipolygon, graph, true) } // true = verbose ); } @@ -351,7 +351,7 @@ export function validationOutdatedTags(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.old_multipolygon.reference')); + .text(l10n.t('issues.old_multipolygon.reference')); } } diff --git a/modules/validations/private_data.js b/modules/validations/private_data.js index 95019a24a5..f41a4c273c 100644 --- a/modules/validations/private_data.js +++ b/modules/validations/private_data.js @@ -52,7 +52,7 @@ export function validationPrivateData(context) { return [ new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml(`issues.fix.${fixID}.title`), + title: l10n.t(`issues.fix.${fixID}.title`), onClick: () => { editor.perform(doUpgrade); editor.commit({ @@ -88,7 +88,7 @@ export function validationPrivateData(context) { const currEntity = graph.hasEntity(this.entityIds[0]); if (!currEntity) return ''; - return l10n.tHtml('issues.private_data.contact.message', + return l10n.t('issues.private_data.contact.message', { feature: l10n.displayLabel(currEntity, graph) } ); } @@ -102,11 +102,11 @@ export function validationPrivateData(context) { enter .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.private_data.reference')); + .text(l10n.t('issues.private_data.reference')); enter .append('strong') - .html(l10n.tHtml('issues.suggested')); + .text(l10n.t('issues.suggested')); enter .append('table') @@ -121,7 +121,7 @@ export function validationPrivateData(context) { const klass = d.type === '+' ? 'add' : 'remove'; return `tagDiff-cell tagDiff-cell-${klass}`; }) - .html(d => d.display); + .text(d => d.display); } }; diff --git a/modules/validations/suspicious_name.js b/modules/validations/suspicious_name.js index e7ffa879c0..f1d080859c 100644 --- a/modules/validations/suspicious_name.js +++ b/modules/validations/suspicious_name.js @@ -61,7 +61,7 @@ export function validationSuspiciousName(context) { if (!entity) return ''; const preset = presets.match(entity, graph); const langName = langCode && l10n.languageName(langCode); - return l10n.tHtml('issues.generic_name.message' + (langName ? '_language' : ''), + return l10n.t('issues.generic_name.message' + (langName ? '_language' : ''), { feature: preset.name(), name: genericName, language: langName } ); }, @@ -72,7 +72,7 @@ export function validationSuspiciousName(context) { return [ new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml('issues.fix.remove_the_name.title'), + title: l10n.t('issues.fix.remove_the_name.title'), onClick: function() { const graph = editor.staging.graph; const entityID = this.issue.entityIds[0]; @@ -96,7 +96,7 @@ export function validationSuspiciousName(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.generic_name.reference')); + .text(l10n.t('issues.generic_name.reference')); } } @@ -111,7 +111,7 @@ export function validationSuspiciousName(context) { if (!entity) return ''; const preset = presets.match(entity, graph); const langName = langCode && l10n.languageName(langCode); - return l10n.tHtml('issues.incorrect_name.message' + (langName ? '_language' : ''), + return l10n.t('issues.incorrect_name.message' + (langName ? '_language' : ''), { feature: preset.name(), name: incorrectName, language: langName } ); }, @@ -122,7 +122,7 @@ export function validationSuspiciousName(context) { return [ new ValidationFix({ icon: 'rapid-operation-delete', - title: l10n.tHtml('issues.fix.remove_the_name.title'), + title: l10n.t('issues.fix.remove_the_name.title'), onClick: function() { const graph = editor.staging.graph; const entityID = this.issue.entityIds[0]; @@ -146,7 +146,7 @@ export function validationSuspiciousName(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.generic_name.reference')); + .text(l10n.t('issues.generic_name.reference')); } } diff --git a/modules/validations/unsquare_way.js b/modules/validations/unsquare_way.js index 91cb01ad13..fdc5a23ad0 100644 --- a/modules/validations/unsquare_way.js +++ b/modules/validations/unsquare_way.js @@ -77,7 +77,7 @@ export function validationUnsquareWay(context) { message: function() { const graph = editor.staging.graph; const entity = graph.hasEntity(this.entityIds[0]); - return entity ? l10n.tHtml('issues.unsquare_way.message', { + return entity ? l10n.t('issues.unsquare_way.message', { feature: l10n.displayLabel(entity, graph) }) : ''; }, @@ -103,7 +103,7 @@ export function validationUnsquareWay(context) { }), /* new ValidationFix({ // Tag as unnsquare - title: l10n.tHtml('issues.fix.tag_as_unsquare.title'), + title: l10n.t('issues.fix.tag_as_unsquare.title'), onClick: function() { const graph = editor.staging.graph; const entityID = this.issue.entityIds[0]; @@ -128,7 +128,7 @@ export function validationUnsquareWay(context) { .enter() .append('div') .attr('class', 'issue-reference') - .html(l10n.tHtml('issues.unsquare_way.buildings.reference')); + .text(l10n.t('issues.unsquare_way.buildings.reference')); } }; diff --git a/test/spec/validations/almost_junction.js b/test/spec/validations/almost_junction.js index 9c0d8142c3..346b771fd5 100644 --- a/test/spec/validations/almost_junction.js +++ b/test/spec/validations/almost_junction.js @@ -5,7 +5,6 @@ describe('validationAlmostJunction', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockEditSystem { diff --git a/test/spec/validations/ambiguous_crossing_tags.js b/test/spec/validations/ambiguous_crossing_tags.js index f86fecc99a..c32a63f4e6 100644 --- a/test/spec/validations/ambiguous_crossing_tags.js +++ b/test/spec/validations/ambiguous_crossing_tags.js @@ -5,7 +5,6 @@ describe('validationAmbiguousCrossingTags', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockEditSystem { diff --git a/test/spec/validations/crossing_ways.js b/test/spec/validations/crossing_ways.js index 7ab790bf5d..95ba998456 100644 --- a/test/spec/validations/crossing_ways.js +++ b/test/spec/validations/crossing_ways.js @@ -5,7 +5,6 @@ describe('validationCrossingWays', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockEditSystem { diff --git a/test/spec/validations/disconnected_way.js b/test/spec/validations/disconnected_way.js index 01fae14778..dc047a0817 100644 --- a/test/spec/validations/disconnected_way.js +++ b/test/spec/validations/disconnected_way.js @@ -5,7 +5,6 @@ describe('validationDisconnectedWay', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockContext { diff --git a/test/spec/validations/incompatible_source.js b/test/spec/validations/incompatible_source.js index d973881c4b..1ad3603298 100644 --- a/test/spec/validations/incompatible_source.js +++ b/test/spec/validations/incompatible_source.js @@ -4,7 +4,6 @@ describe('validationIncompatibleSource', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockContext { diff --git a/test/spec/validations/mismatched_geometry.js b/test/spec/validations/mismatched_geometry.js index 654e23288a..ff1201b8fc 100644 --- a/test/spec/validations/mismatched_geometry.js +++ b/test/spec/validations/mismatched_geometry.js @@ -5,7 +5,6 @@ describe('validationMismatchedGeometry', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockLocationSystem { diff --git a/test/spec/validations/missing_role.js b/test/spec/validations/missing_role.js index d3649e0b9e..0d87f88fa7 100644 --- a/test/spec/validations/missing_role.js +++ b/test/spec/validations/missing_role.js @@ -4,7 +4,6 @@ describe('validationMissingRole', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockContext { diff --git a/test/spec/validations/missing_tag.js b/test/spec/validations/missing_tag.js index 06c03894d9..2ff5cb16e9 100644 --- a/test/spec/validations/missing_tag.js +++ b/test/spec/validations/missing_tag.js @@ -4,7 +4,6 @@ describe('validationMissingTag', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockContext { diff --git a/test/spec/validations/outdated_tags.js b/test/spec/validations/outdated_tags.js index 7547648c39..188ae4a259 100644 --- a/test/spec/validations/outdated_tags.js +++ b/test/spec/validations/outdated_tags.js @@ -4,7 +4,6 @@ describe('validationOutdatedTags', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockLocationSystem { diff --git a/test/spec/validations/private_data.js b/test/spec/validations/private_data.js index 6f5ec1f541..93d0daf4a3 100644 --- a/test/spec/validations/private_data.js +++ b/test/spec/validations/private_data.js @@ -4,7 +4,6 @@ describe('validationPrivateData', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockContext { diff --git a/test/spec/validations/suspicious_name.js b/test/spec/validations/suspicious_name.js index c16df2eae0..f43ed7e6ff 100644 --- a/test/spec/validations/suspicious_name.js +++ b/test/spec/validations/suspicious_name.js @@ -18,7 +18,6 @@ describe('validationSuspiciousName', () => { constructor() {} displayLabel(entity) { return entity.id; } t(id) { return id; } - tHtml(id) { return id; } } class MockContext {