mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Add lang attribute to more labels (re: #7963)
This commit is contained in:
@@ -10,8 +10,7 @@ export function modeAddNote(context) {
|
||||
var mode = {
|
||||
id: 'add-note',
|
||||
button: 'note',
|
||||
title: t('modes.add_note.title'),
|
||||
description: t('modes.add_note.description'),
|
||||
description: t.html('modes.add_note.description'),
|
||||
key: t('modes.add_note.key')
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export function uiField(context, presetField, entityIDs, options) {
|
||||
|
||||
var _locked = false;
|
||||
var _lockedTip = uiTooltip()
|
||||
.title(t('inspector.lock.suggestion', { label: field.label }))
|
||||
.title(t.html('inspector.lock.suggestion', { label: field.label }))
|
||||
.placement('bottom');
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export function uiFieldLocalized(field, context) {
|
||||
var _selection = d3_select(null);
|
||||
var _multilingual = [];
|
||||
var _buttonTip = uiTooltip()
|
||||
.title(t('translate.translate'))
|
||||
.title(t.html('translate.translate'))
|
||||
.placement('left');
|
||||
var _wikiTitles;
|
||||
var _entityIDs = [];
|
||||
|
||||
@@ -88,7 +88,7 @@ export function uiGeolocate(context) {
|
||||
.call(svgIcon('#iD-icon-geolocate', 'light'))
|
||||
.call(uiTooltip()
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
.title(t('geolocate.title'))
|
||||
.title(t.html('geolocate.title'))
|
||||
.keys([t('geolocate.key')])
|
||||
);
|
||||
|
||||
|
||||
@@ -304,14 +304,14 @@ export function uiInit(context) {
|
||||
.attr('target', '_blank')
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/issues')
|
||||
.call(svgIcon('#iD-icon-bug', 'light'))
|
||||
.call(uiTooltip().title(t('report_a_bug')).placement('top'));
|
||||
.call(uiTooltip().title(t.html('report_a_bug')).placement('top'));
|
||||
|
||||
issueLinks
|
||||
.append('a')
|
||||
.attr('target', '_blank')
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/blob/develop/CONTRIBUTING.md#translating')
|
||||
.call(svgIcon('#iD-icon-translate', 'light'))
|
||||
.call(uiTooltip().title(t('help_translate')).placement('top'));
|
||||
.call(uiTooltip().title(t.html('help_translate')).placement('top'));
|
||||
|
||||
aboutList
|
||||
.append('li')
|
||||
|
||||
@@ -62,7 +62,7 @@ export function uiIssuesInfo(context) {
|
||||
|
||||
var tooltipBehavior = uiTooltip()
|
||||
.placement('top')
|
||||
.title(t(d.descriptionID));
|
||||
.title(t.html(d.descriptionID));
|
||||
|
||||
chipSelection
|
||||
.call(tooltipBehavior)
|
||||
|
||||
@@ -12,7 +12,7 @@ export function uiPaneBackground(context) {
|
||||
var backgroundPane = uiPane('background', context)
|
||||
.key(t('background.key'))
|
||||
.label(t.html('background.title'))
|
||||
.description(t('background.description'))
|
||||
.description(t.html('background.description'))
|
||||
.iconName('iD-icon-layers')
|
||||
.sections([
|
||||
uiSectionBackgroundList(context),
|
||||
|
||||
@@ -259,7 +259,7 @@ export function uiPaneHelp(context) {
|
||||
var helpPane = uiPane('help', context)
|
||||
.key(t('help.key'))
|
||||
.label(t.html('help.title'))
|
||||
.description(t('help.title'))
|
||||
.description(t.html('help.title'))
|
||||
.iconName('iD-icon-help');
|
||||
|
||||
helpPane.renderContent = function(content) {
|
||||
@@ -354,7 +354,7 @@ export function uiPaneHelp(context) {
|
||||
.append('li')
|
||||
.attr('class', 'shortcuts')
|
||||
.call(uiTooltip()
|
||||
.title(t('shortcuts.tooltip'))
|
||||
.title(t.html('shortcuts.tooltip'))
|
||||
.keys(['?'])
|
||||
.placement('top')
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ export function uiPaneIssues(context) {
|
||||
var issuesPane = uiPane('issues', context)
|
||||
.key(t('issues.key'))
|
||||
.label(t.html('issues.title'))
|
||||
.description(t('issues.title'))
|
||||
.description(t.html('issues.title'))
|
||||
.iconName('iD-icon-alert')
|
||||
.sections([
|
||||
uiSectionValidationOptions(context),
|
||||
|
||||
@@ -12,7 +12,7 @@ export function uiPaneMapData(context) {
|
||||
var mapDataPane = uiPane('map-data', context)
|
||||
.key(t('map_data.key'))
|
||||
.label(t.html('map_data.title'))
|
||||
.description(t('map_data.description'))
|
||||
.description(t.html('map_data.description'))
|
||||
.iconName('iD-icon-data')
|
||||
.sections([
|
||||
uiSectionDataLayers(context),
|
||||
|
||||
@@ -8,7 +8,7 @@ export function uiPanePreferences(context) {
|
||||
let preferencesPane = uiPane('preferences', context)
|
||||
.key(t('preferences.key'))
|
||||
.label(t.html('preferences.title'))
|
||||
.description(t('preferences.description'))
|
||||
.description(t.html('preferences.description'))
|
||||
.iconName('fas-user-cog')
|
||||
.sections([
|
||||
uiSectionPrivacy(context)
|
||||
|
||||
@@ -465,7 +465,7 @@ export function uiPresetList(context) {
|
||||
var tooltipIdSuffix = isAutoHidden ? 'zoom' : 'manual';
|
||||
var tooltipObj = { features: t('feature.' + hiddenPresetFeaturesId + '.description') };
|
||||
d3_select(this).call(uiTooltip()
|
||||
.title(t('inspector.hidden_preset.' + tooltipIdSuffix, tooltipObj))
|
||||
.title(t.html('inspector.hidden_preset.' + tooltipIdSuffix, tooltipObj))
|
||||
.placement(index < 2 ? 'bottom' : 'top')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export function uiSectionBackgroundList(context) {
|
||||
.attr('class', 'minimap-toggle-item')
|
||||
.append('label')
|
||||
.call(uiTooltip()
|
||||
.title(t('background.minimap.tooltip'))
|
||||
.title(t.html('background.minimap.tooltip'))
|
||||
.keys([t('background.minimap.key')])
|
||||
.placement('top')
|
||||
);
|
||||
@@ -79,7 +79,7 @@ export function uiSectionBackgroundList(context) {
|
||||
.attr('class', 'background-panel-toggle-item')
|
||||
.append('label')
|
||||
.call(uiTooltip()
|
||||
.title(t('background.panel.tooltip'))
|
||||
.title(t.html('background.panel.tooltip'))
|
||||
.keys([uiCmd('⌘⇧' + t('info_panels.background.key'))])
|
||||
.placement('top')
|
||||
);
|
||||
@@ -101,7 +101,7 @@ export function uiSectionBackgroundList(context) {
|
||||
.attr('class', 'location-panel-toggle-item')
|
||||
.append('label')
|
||||
.call(uiTooltip()
|
||||
.title(t('background.location_panel.tooltip'))
|
||||
.title(t.html('background.location_panel.tooltip'))
|
||||
.keys([uiCmd('⌘⇧' + t('info_panels.location.key'))])
|
||||
.placement('top')
|
||||
);
|
||||
@@ -205,7 +205,7 @@ export function uiSectionBackgroundList(context) {
|
||||
.append('button')
|
||||
.attr('class', 'layer-browse')
|
||||
.call(uiTooltip()
|
||||
.title(t('settings.custom_background.tooltip'))
|
||||
.title(t.html('settings.custom_background.tooltip'))
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
.on('click', editCustom)
|
||||
@@ -215,7 +215,7 @@ export function uiSectionBackgroundList(context) {
|
||||
.append('div')
|
||||
.attr('class', 'best')
|
||||
.call(uiTooltip()
|
||||
.title(t('background.best_imagery'))
|
||||
.title(t.html('background.best_imagery'))
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
.append('span')
|
||||
|
||||
@@ -96,14 +96,14 @@ export function uiSectionDataLayers(context) {
|
||||
if (d.id === 'osm') {
|
||||
d3_select(this)
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.' + d.id + '.tooltip'))
|
||||
.title(t.html('map_data.layers.' + d.id + '.tooltip'))
|
||||
.keys([uiCmd('⌥' + t('area_fill.wireframe.key'))])
|
||||
.placement('bottom')
|
||||
);
|
||||
} else {
|
||||
d3_select(this)
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.' + d.id + '.tooltip'))
|
||||
.title(t.html('map_data.layers.' + d.id + '.tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ export function uiSectionDataLayers(context) {
|
||||
.each(function(d) {
|
||||
d3_select(this)
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.' + d.id + '.tooltip'))
|
||||
.title(t.html('map_data.layers.' + d.id + '.tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
});
|
||||
@@ -314,7 +314,7 @@ export function uiSectionDataLayers(context) {
|
||||
var labelEnter = liEnter
|
||||
.append('label')
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.custom.tooltip'))
|
||||
.title(t.html('map_data.layers.custom.tooltip'))
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
@@ -331,7 +331,7 @@ export function uiSectionDataLayers(context) {
|
||||
.append('button')
|
||||
.attr('class', 'open-data-options')
|
||||
.call(uiTooltip()
|
||||
.title(t('settings.custom_data.tooltip'))
|
||||
.title(t.html('settings.custom_data.tooltip'))
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
.on('click', editCustom)
|
||||
@@ -341,7 +341,7 @@ export function uiSectionDataLayers(context) {
|
||||
.append('button')
|
||||
.attr('class', 'zoom-to-data')
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.custom.zoom'))
|
||||
.title(t.html('map_data.layers.custom.zoom'))
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
.on('click', function() {
|
||||
@@ -399,7 +399,7 @@ export function uiSectionDataLayers(context) {
|
||||
.attr('class', 'history-panel-toggle-item')
|
||||
.append('label')
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.history_panel.tooltip'))
|
||||
.title(t.html('map_data.history_panel.tooltip'))
|
||||
.keys([uiCmd('⌘⇧' + t('info_panels.history.key'))])
|
||||
.placement('top')
|
||||
);
|
||||
@@ -421,7 +421,7 @@ export function uiSectionDataLayers(context) {
|
||||
.attr('class', 'measurement-panel-toggle-item')
|
||||
.append('label')
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.measurement_panel.tooltip'))
|
||||
.title(t.html('map_data.measurement_panel.tooltip'))
|
||||
.keys([uiCmd('⌘⇧' + t('info_panels.measurement.key'))])
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
@@ -42,7 +42,7 @@ export function uiSectionFeatureType(context) {
|
||||
.append('button')
|
||||
.attr('class', 'preset-list-button preset-reset')
|
||||
.call(uiTooltip()
|
||||
.title(t('inspector.back_tooltip'))
|
||||
.title(t.html('inspector.back_tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ export function uiSectionPhotoOverlays(context) {
|
||||
else titleID = d.id.replace(/-/g, '_') + '.tooltip';
|
||||
d3_select(this)
|
||||
.call(uiTooltip()
|
||||
.title(t(titleID))
|
||||
.title(t.html(titleID))
|
||||
.placement('top')
|
||||
);
|
||||
});
|
||||
@@ -137,7 +137,7 @@ export function uiSectionPhotoOverlays(context) {
|
||||
.each(function(d) {
|
||||
d3_select(this)
|
||||
.call(uiTooltip()
|
||||
.title(t('photo_overlays.photo_type.' + d + '.tooltip'))
|
||||
.title(t.html('photo_overlays.photo_type.' + d + '.tooltip'))
|
||||
.placement('top')
|
||||
);
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ export function uiSectionPrivacy(context) {
|
||||
.attr('class', 'privacy-third-party-icons-item')
|
||||
.append('label')
|
||||
.call(uiTooltip()
|
||||
.title(t('preferences.privacy.third_party_icons.tooltip'))
|
||||
.title(t.html('preferences.privacy.third_party_icons.tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
|
||||
|
||||
@@ -134,7 +134,11 @@ export function uiSectionRawMembershipEditor(context) {
|
||||
|
||||
|
||||
function fetchNearbyRelations(q, callback) {
|
||||
var newRelation = { relation: null, value: t('inspector.new_relation') };
|
||||
var newRelation = {
|
||||
relation: null,
|
||||
value: t('inspector.new_relation'),
|
||||
display: t.html('inspector.new_relation')
|
||||
};
|
||||
|
||||
var entityID = _entityIDs[0];
|
||||
|
||||
@@ -378,7 +382,7 @@ export function uiSectionRawMembershipEditor(context) {
|
||||
addRelationButton
|
||||
.call(svgIcon('#iD-icon-plus', 'light'));
|
||||
addRelationButton
|
||||
.call(uiTooltip().title(t('inspector.add_to_relation')).placement(localizer.textDirection() === 'ltr' ? 'right' : 'left'));
|
||||
.call(uiTooltip().title(t.html('inspector.add_to_relation')).placement(localizer.textDirection() === 'ltr' ? 'right' : 'left'));
|
||||
|
||||
addRowEnter
|
||||
.append('div')
|
||||
|
||||
@@ -23,23 +23,23 @@ export function uiToolOldDrawModes(context) {
|
||||
|
||||
var modes = [
|
||||
modeAddPoint(context, {
|
||||
title: t('modes.add_point.title'),
|
||||
title: t.html('modes.add_point.title'),
|
||||
button: 'point',
|
||||
description: t('modes.add_point.description'),
|
||||
description: t.html('modes.add_point.description'),
|
||||
preset: presetManager.item('point'),
|
||||
key: '1'
|
||||
}),
|
||||
modeAddLine(context, {
|
||||
title: t('modes.add_line.title'),
|
||||
title: t.html('modes.add_line.title'),
|
||||
button: 'line',
|
||||
description: t('modes.add_line.description'),
|
||||
description: t.html('modes.add_line.description'),
|
||||
preset: presetManager.item('line'),
|
||||
key: '2'
|
||||
}),
|
||||
modeAddArea(context, {
|
||||
title: t('modes.add_area.title'),
|
||||
title: t.html('modes.add_area.title'),
|
||||
button: 'area',
|
||||
description: t('modes.add_area.description'),
|
||||
description: t.html('modes.add_area.description'),
|
||||
preset: presetManager.item('area'),
|
||||
key: '3'
|
||||
})
|
||||
|
||||
@@ -58,7 +58,7 @@ export function uiToolSave(context) {
|
||||
|
||||
if (tooltipBehavior) {
|
||||
tooltipBehavior
|
||||
.title(t(_numChanges > 0 ? 'save.help' : 'save.no_changes'))
|
||||
.title(t.html(_numChanges > 0 ? 'save.help' : 'save.no_changes'))
|
||||
.keys([key]);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export function uiToolSave(context) {
|
||||
tool.render = function(selection) {
|
||||
tooltipBehavior = uiTooltip()
|
||||
.placement('bottom')
|
||||
.title(t('save.no_changes'))
|
||||
.title(t.html('save.no_changes'))
|
||||
.keys([key])
|
||||
.scrollContainer(context.container().select('.top-toolbar'));
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export function uiToolSidebarToggle(context) {
|
||||
})
|
||||
.call(uiTooltip()
|
||||
.placement('bottom')
|
||||
.title(t('sidebar.tooltip'))
|
||||
.title(t.html('sidebar.tooltip'))
|
||||
.keys([t('sidebar.key')])
|
||||
.scrollContainer(context.container().select('.top-toolbar'))
|
||||
)
|
||||
|
||||
@@ -51,8 +51,8 @@ export function uiToolUndoRedo(context) {
|
||||
.placement('bottom')
|
||||
.title(function (d) {
|
||||
return d.annotation() ?
|
||||
t(d.id + '.tooltip', { action: d.annotation() }) :
|
||||
t(d.id + '.nothing');
|
||||
t.html(d.id + '.tooltip', { action: d.annotation() }) :
|
||||
t.html(d.id + '.nothing');
|
||||
})
|
||||
.keys(function(d) {
|
||||
return [d.cmd];
|
||||
|
||||
@@ -44,7 +44,7 @@ export function uiVersion(context) {
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/blob/release/CHANGELOG.md#whats-new')
|
||||
.call(svgIcon('#maki-gift-11'))
|
||||
.call(uiTooltip()
|
||||
.title(t('version.whats_new', { version: currVersion }))
|
||||
.title(t.html('version.whats_new', { version: currVersion }))
|
||||
.placement('top')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,22 +15,22 @@ export function uiZoom(context) {
|
||||
var zooms = [{
|
||||
id: 'zoom-in',
|
||||
icon: 'iD-icon-plus',
|
||||
title: t('zoom.in'),
|
||||
title: t.html('zoom.in'),
|
||||
action: zoomIn,
|
||||
disabled: function() {
|
||||
return !context.map().canZoomIn();
|
||||
},
|
||||
disabledTitle: t('zoom.disabled.in'),
|
||||
disabledTitle: t.html('zoom.disabled.in'),
|
||||
key: '+'
|
||||
}, {
|
||||
id: 'zoom-out',
|
||||
icon: 'iD-icon-minus',
|
||||
title: t('zoom.out'),
|
||||
title: t.html('zoom.out'),
|
||||
action: zoomOut,
|
||||
disabled: function() {
|
||||
return !context.map().canZoomOut();
|
||||
},
|
||||
disabledTitle: t('zoom.disabled.out'),
|
||||
disabledTitle: t.html('zoom.disabled.out'),
|
||||
key: '-'
|
||||
}];
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ export function uiZoomToSelection(context) {
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
.title(function() {
|
||||
if (isDisabled()) {
|
||||
return t('inspector.zoom_to.no_selection');
|
||||
return t.html('inspector.zoom_to.no_selection');
|
||||
}
|
||||
return t('inspector.zoom_to.title');
|
||||
return t.html('inspector.zoom_to.title');
|
||||
})
|
||||
.keys([t('inspector.zoom_to.key')]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user