Tweak issue and fix strings

Different strings for one vs. a combination of deprecated tags
This commit is contained in:
Quincy Morgan
2019-02-15 14:24:11 -05:00
parent 31eb837596
commit 397097ac1f
6 changed files with 67 additions and 40 deletions
+21 -15
View File
@@ -1175,8 +1175,8 @@ en:
warnings:
list_title: "Warnings ({count})"
no_issues:
message: Everything looks fine.
info: Any issues will show up here as you edit.
message: Everything looks fine
info: Any issues will show up here as you edit
almost_junction:
message: "{feature} is very close but not connected to {feature2}"
highway-highway:
@@ -1212,7 +1212,10 @@ en:
bridge-bridge_connectable:
tip: "Crossing bridges should be connected or use different layers."
deprecated_tag:
message: '{feature} has outdated tags: {tags}'
single:
message: '{feature} has the outdated tag "{tag}"'
combination:
message: '{feature} has an outdated tag combination: {tags}'
tip: "Some tags become deprecated over time and should be replaced."
disconnected_way:
highway:
@@ -1220,7 +1223,7 @@ en:
tip: "Highways should connect to other highways or building entrances."
generic_name:
message: '{feature} has the generic name "{name}"'
tip: "Names should be the official, on-the-ground titles of features."
tip: "Names should be the actual, on-the-ground names of features."
many_deletions:
points-lines-areas:
message: "Deleting {n} features: {p} points, {l} lines, and {a} areas"
@@ -1239,24 +1242,24 @@ en:
message: "{multipolygon} has misplaced tags"
tip: "Multipolygons should be tagged on their relation, not their outer way."
tag_suggests_area:
message: "{feature} should be a closed area based on the tag: {tag}"
message: '{feature} should be a closed area based on the tag "{tag}"'
tip: "Areas must have connected endpoints."
fix:
add_connection_vertex:
title: Connect the features
annotation: Connected crossing features.
connect_almost_junction:
title: Connect the features
annotation: Connected very close features.
connect_crossing_features:
annotation: Connected crossing features.
connect_endpoints:
title: Connect the ends
annotation: Connected the endpoints of a way.
connect_features:
title: Connect the features
continue_from_start:
title: Continue drawing from start
continue_from_end:
title: Continue drawing from end
delete_feature:
title: Delete this feature
connect_endpoints:
title: Connect the ends
annotation: Connected the endpoints of a way.
move_tags:
title: Move the tags
annotation: Moved tags.
@@ -1273,9 +1276,12 @@ en:
tag_as_disconnected:
title: Tag as disconnected
annotation: Tagged very close features as disconnected.
upgrade_tags:
title: Upgrade tags
annotation: Upgraded tags.
upgrade_tag:
title: Upgrade this tag
annotation: Upgraded an old tag.
upgrade_tag_combo:
title: Upgrade these tags
annotation: Upgraded an old tag combination.
intro:
done: done
ok: OK
+27 -17
View File
@@ -1425,8 +1425,8 @@
"list_title": "Warnings ({count})"
},
"no_issues": {
"message": "Everything looks fine.",
"info": "Any issues will show up here as you edit."
"message": "Everything looks fine",
"info": "Any issues will show up here as you edit"
},
"almost_junction": {
"message": "{feature} is very close but not connected to {feature2}",
@@ -1480,7 +1480,12 @@
}
},
"deprecated_tag": {
"message": "{feature} has outdated tags: {tags}",
"single": {
"message": "{feature} has the outdated tag \"{tag}\""
},
"combination": {
"message": "{feature} has an outdated tag combination: {tags}"
},
"tip": "Some tags become deprecated over time and should be replaced."
},
"disconnected_way": {
@@ -1491,7 +1496,7 @@
},
"generic_name": {
"message": "{feature} has the generic name \"{name}\"",
"tip": "Names should be the official, on-the-ground titles of features."
"tip": "Names should be the actual, on-the-ground names of features."
},
"many_deletions": {
"points-lines-areas": {
@@ -1519,17 +1524,22 @@
"tip": "Multipolygons should be tagged on their relation, not their outer way."
},
"tag_suggests_area": {
"message": "{feature} should be a closed area based on the tag: {tag}",
"message": "{feature} should be a closed area based on the tag \"{tag}\"",
"tip": "Areas must have connected endpoints."
},
"fix": {
"add_connection_vertex": {
"title": "Connect the features",
"connect_almost_junction": {
"annotation": "Connected very close features."
},
"connect_crossing_features": {
"annotation": "Connected crossing features."
},
"connect_almost_junction": {
"title": "Connect the features",
"annotation": "Connected very close features."
"connect_endpoints": {
"title": "Connect the ends",
"annotation": "Connected the endpoints of a way."
},
"connect_features": {
"title": "Connect the features"
},
"continue_from_start": {
"title": "Continue drawing from start"
@@ -1540,10 +1550,6 @@
"delete_feature": {
"title": "Delete this feature"
},
"connect_endpoints": {
"title": "Connect the ends",
"annotation": "Connected the endpoints of a way."
},
"move_tags": {
"title": "Move the tags",
"annotation": "Moved tags."
@@ -1566,9 +1572,13 @@
"title": "Tag as disconnected",
"annotation": "Tagged very close features as disconnected."
},
"upgrade_tags": {
"title": "Upgrade tags",
"annotation": "Upgraded tags."
"upgrade_tag": {
"title": "Upgrade this tag",
"annotation": "Upgraded an old tag."
},
"upgrade_tag_combo": {
"title": "Upgrade these tags",
"annotation": "Upgraded an old tag combination."
}
}
},
+4 -3
View File
@@ -135,7 +135,7 @@ export function validationAlmostJunction() {
var edgeHighway = graph.entity(extendableNodeInfo.wid);
var fixes = [new validationIssueFix({
title: t('issues.fix.connect_almost_junction.title'),
title: t('issues.fix.connect_features.title'),
onClick: function() {
var endNode = this.issue.entities[1];
var targetEdge = this.issue.info.edge;
@@ -143,17 +143,18 @@ export function validationAlmostJunction() {
var edgeNodes = [context.graph().entity(targetEdge[0]), context.graph().entity(targetEdge[1])];
var closestNodeInfo = geoSphericalClosestNode(edgeNodes, crossLoc);
var annotation = t('issues.fix.connect_almost_junction.annotation');
// already a point nearby, just connect to that
if (closestNodeInfo.distance < 0.75) {
context.perform(
actionMergeNodes([closestNodeInfo.node.id, endNode.id], closestNodeInfo.node.loc),
t('issues.fix.connect_almost_junction.annotation')
annotation
);
// else add the end node to the edge way
} else {
context.perform(
actionAddMidpoint({loc: crossLoc, edge: targetEdge}, endNode),
t('issues.fix.connect_almost_junction.annotation')
annotation
);
}
}
+2 -2
View File
@@ -359,7 +359,7 @@ export function validationCrossingWays() {
var fixes = [];
if (connectionTags) {
fixes.push(new validationIssueFix({
title: t('issues.fix.add_connection_vertex.title'),
title: t('issues.fix.connect_features.title'),
onClick: function() {
var loc = this.issue.loc;
var connectionTags = this.issue.info.connectionTags;
@@ -393,7 +393,7 @@ export function validationCrossingWays() {
return graph;
},
t('issues.fix.add_connection_vertex.annotation')
t('issues.fix.connect_crossing_features.annotation')
);
}
}));
+12 -3
View File
@@ -17,10 +17,18 @@ export function validationDeprecatedTag() {
var deprecatedTags = deprecatedTagsArray[deprecatedTagIndex];
var tagsLabel = utilTagText({ tags: deprecatedTags.old });
var featureLabel = utilDisplayLabel(entity, context);
var isCombo = Object.keys(deprecatedTags.old).length > 1;
var messageObj = { feature: featureLabel };
if (isCombo) {
messageObj.tags = tagsLabel;
} else {
messageObj.tag = tagsLabel;
}
var tagMessageID = isCombo ? 'combination' : 'single';
issues.push(new validationIssue({
type: type,
severity: 'warning',
message: t('issues.deprecated_tag.message', { feature: featureLabel, tags: tagsLabel }),
message: t('issues.deprecated_tag.' + tagMessageID + '.message', messageObj),
tooltip: t('issues.deprecated_tag.tip'),
entities: [entity],
hash: tagsLabel,
@@ -31,12 +39,13 @@ export function validationDeprecatedTag() {
fixes: [
new validationIssueFix({
icon: 'iD-icon-up',
title: t('issues.fix.upgrade_tags.title'),
title: t('issues.fix.' + (isCombo ? 'upgrade_tag_combo' : 'upgrade_tag') + '.title'),
onClick: function() {
var entity = this.issue.entities[0];
var tags = _clone(entity.tags);
var replaceTags = this.issue.info.replaceTags;
var oldTags = this.issue.info.oldTags;
var fixTextID = Object.keys(oldTags).length > 1 ? 'upgrade_tag_combo' : 'upgrade_tag';
var transferValue;
for (var oldTagKey in oldTags) {
if (oldTags[oldTagKey] === '*') {
@@ -63,7 +72,7 @@ export function validationDeprecatedTag() {
}
context.perform(
actionChangeTags(entity.id, tags),
t('issues.fix.upgrade_tags.annotation')
t('issues.fix.' + fixTextID + '.annotation')
);
}
})
+1
View File
@@ -69,6 +69,7 @@ export function validationTagSuggestsArea() {
}
fixes.push(new validationIssueFix({
icon: 'iD-operation-delete',
title: t('issues.fix.remove_tag.title'),
onClick: function() {
var entity = this.issue.entities[0];