mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Add lang attribute to text in turn restriction editor (re: #7963)
This commit is contained in:
+2
-2
@@ -2024,13 +2024,13 @@ a.hide-toggle {
|
||||
}
|
||||
|
||||
.restriction-control input,
|
||||
.restriction-control span {
|
||||
.restriction-control > span {
|
||||
display: table-cell;
|
||||
text-align: start;
|
||||
padding: 0px 5px;
|
||||
}
|
||||
|
||||
.restriction-control span.restriction-control-label {
|
||||
.restriction-control > span.restriction-control-label {
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ export function uiFieldHelp(context, fieldName) {
|
||||
var fieldHelpHeadings = {};
|
||||
|
||||
var replacements = {
|
||||
distField: t('restriction.controls.distance'),
|
||||
viaField: t('restriction.controls.via'),
|
||||
distField: t.html('restriction.controls.distance'),
|
||||
viaField: t.html('restriction.controls.via'),
|
||||
fromShadow: icon('#iD-turn-shadow', 'inline shadow from'),
|
||||
allowShadow: icon('#iD-turn-shadow', 'inline shadow allow'),
|
||||
restrictShadow: icon('#iD-turn-shadow', 'inline shadow restrict'),
|
||||
@@ -74,12 +74,12 @@ export function uiFieldHelp(context, fieldName) {
|
||||
var subkey = helpkey + '.' + part;
|
||||
var depth = fieldHelpHeadings[subkey]; // is this subkey a heading?
|
||||
var hhh = depth ? Array(depth + 1).join('#') + ' ' : ''; // if so, prepend with some ##'s
|
||||
return all + hhh + t(subkey, replacements) + '\n\n';
|
||||
return all + hhh + t.html(subkey, replacements) + '\n\n';
|
||||
}, '');
|
||||
|
||||
return {
|
||||
key: helpkey,
|
||||
title: t(helpkey + '.title'),
|
||||
title: t.html(helpkey + '.title'),
|
||||
html: marked(text.trim())
|
||||
};
|
||||
});
|
||||
|
||||
@@ -497,21 +497,21 @@ export function uiFieldRestrictions(field, context) {
|
||||
} else if (datum instanceof osmTurn) {
|
||||
var restrictionType = osmInferRestriction(vgraph, datum, projection);
|
||||
var turnType = restrictionType.replace(/^(only|no)\_/, '');
|
||||
var indirect = (datum.direct === false ? t('restriction.help.indirect') : '');
|
||||
var indirect = (datum.direct === false ? t.html('restriction.help.indirect') : '');
|
||||
var klass, turnText, nextText;
|
||||
|
||||
if (datum.no) {
|
||||
klass = 'restrict';
|
||||
turnText = t('restriction.help.turn.no_' + turnType, { indirect: indirect });
|
||||
nextText = t('restriction.help.turn.only_' + turnType, { indirect: '' });
|
||||
turnText = t.html('restriction.help.turn.no_' + turnType, { indirect: indirect });
|
||||
nextText = t.html('restriction.help.turn.only_' + turnType, { indirect: '' });
|
||||
} else if (datum.only) {
|
||||
klass = 'only';
|
||||
turnText = t('restriction.help.turn.only_' + turnType, { indirect: indirect });
|
||||
nextText = t('restriction.help.turn.allowed_' + turnType, { indirect: '' });
|
||||
turnText = t.html('restriction.help.turn.only_' + turnType, { indirect: indirect });
|
||||
nextText = t.html('restriction.help.turn.allowed_' + turnType, { indirect: '' });
|
||||
} else {
|
||||
klass = 'allow';
|
||||
turnText = t('restriction.help.turn.allowed_' + turnType, { indirect: indirect });
|
||||
nextText = t('restriction.help.turn.no_' + turnType, { indirect: '' });
|
||||
turnText = t.html('restriction.help.turn.allowed_' + turnType, { indirect: indirect });
|
||||
nextText = t.html('restriction.help.turn.no_' + turnType, { indirect: '' });
|
||||
}
|
||||
|
||||
help
|
||||
@@ -596,14 +596,14 @@ export function uiFieldRestrictions(field, context) {
|
||||
opts = { distance: t('units.meters', { quantity: maxDist }) };
|
||||
}
|
||||
|
||||
return t('restriction.controls.distance_up_to', opts);
|
||||
return t.html('restriction.controls.distance_up_to', opts);
|
||||
}
|
||||
|
||||
|
||||
function displayMaxVia(maxVia) {
|
||||
return maxVia === 0 ? t('restriction.controls.via_node_only')
|
||||
: maxVia === 1 ? t('restriction.controls.via_up_to_one')
|
||||
: t('restriction.controls.via_up_to_two');
|
||||
return maxVia === 0 ? t.html('restriction.controls.via_node_only')
|
||||
: maxVia === 1 ? t.html('restriction.controls.via_up_to_one')
|
||||
: t.html('restriction.controls.via_up_to_two');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user