mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 22:48:10 +02:00
Add ability to localize more keyboard shortcuts
(closes #4081) H: Help ?: Keyboard Shortcuts ⌘I: Infobox B: Background ⌘B: Switch Background F: Map Data W: Wireframe /: Minimap
This commit is contained in:
@@ -273,6 +273,7 @@ en:
|
||||
list: "Edits by {users}"
|
||||
truncated_list: "Edits by {users} and {count} others"
|
||||
infobox:
|
||||
key: I
|
||||
selected: "{n} selected"
|
||||
geometry: Geometry
|
||||
closed: closed
|
||||
@@ -339,6 +340,7 @@ en:
|
||||
background:
|
||||
title: Background
|
||||
description: Background settings
|
||||
key: B
|
||||
percent_brightness: "{opacity}% brightness"
|
||||
none: None
|
||||
best_imagery: Best known imagery source for this location
|
||||
@@ -353,9 +355,11 @@ en:
|
||||
minimap:
|
||||
description: Minimap
|
||||
tooltip: Show a zoomed out map to help locate the area currently displayed.
|
||||
key: '/'
|
||||
map_data:
|
||||
title: Map Data
|
||||
description: Map Data
|
||||
key: F
|
||||
data_layers: Data Layers
|
||||
fill_area: Fill Areas
|
||||
map_features: Map Features
|
||||
@@ -401,6 +405,7 @@ en:
|
||||
wireframe:
|
||||
description: No Fill (Wireframe)
|
||||
tooltip: "Enabling wireframe mode makes it easy to see the background imagery."
|
||||
key: W
|
||||
partial:
|
||||
description: Partial Fill
|
||||
tooltip: "Areas are drawn with fill only around their inner edges. (Recommended for beginner mappers)"
|
||||
@@ -507,6 +512,7 @@ en:
|
||||
view_on_mapillary: "View this image on Mapillary"
|
||||
help:
|
||||
title: "Help"
|
||||
key: H
|
||||
help: |
|
||||
# Help
|
||||
|
||||
@@ -1019,6 +1025,8 @@ en:
|
||||
shortcuts:
|
||||
title: "Keyboard shortcuts"
|
||||
tooltip: "Show the keyboard shortcuts screen."
|
||||
toggle:
|
||||
key: '?'
|
||||
key:
|
||||
alt: Alt
|
||||
backspace: Backspace
|
||||
|
||||
+8
-8
@@ -32,10 +32,10 @@
|
||||
"section": "help",
|
||||
"text": "shortcuts.browsing.help.title"
|
||||
}, {
|
||||
"shortcuts": ["H"],
|
||||
"shortcuts": ["help.key"],
|
||||
"text": "shortcuts.browsing.help.help"
|
||||
}, {
|
||||
"shortcuts": ["?"],
|
||||
"shortcuts": ["shortcuts.toggle.key"],
|
||||
"text": "shortcuts.browsing.help.keyboard"
|
||||
},
|
||||
|
||||
@@ -43,24 +43,24 @@
|
||||
"section": "display_options",
|
||||
"text": "shortcuts.browsing.display_options.title"
|
||||
}, {
|
||||
"shortcuts": ["B"],
|
||||
"shortcuts": ["background.key"],
|
||||
"text": "shortcuts.browsing.display_options.background"
|
||||
}, {
|
||||
"modifiers": ["⌘"],
|
||||
"shortcuts": ["B"],
|
||||
"shortcuts": ["background.key"],
|
||||
"text": "shortcuts.browsing.display_options.background_switch"
|
||||
}, {
|
||||
"shortcuts": ["F"],
|
||||
"shortcuts": ["map_data.key"],
|
||||
"text": "shortcuts.browsing.display_options.map_data"
|
||||
}, {
|
||||
"modifiers": ["⌃", "⌘"],
|
||||
"shortcuts": ["F", "F11"],
|
||||
"text": "shortcuts.browsing.display_options.fullscreen"
|
||||
}, {
|
||||
"shortcuts": ["W"],
|
||||
"shortcuts": ["area_fill.wireframe.key"],
|
||||
"text": "shortcuts.browsing.display_options.wireframe"
|
||||
}, {
|
||||
"shortcuts": ["/"],
|
||||
"shortcuts": ["background.minimap.key"],
|
||||
"text": "shortcuts.browsing.display_options.minimap"
|
||||
}
|
||||
]
|
||||
@@ -94,7 +94,7 @@
|
||||
"text": "shortcuts.browsing.with_selected.edit_menu"
|
||||
}, {
|
||||
"modifiers": ["⌘"],
|
||||
"shortcuts": ["I"],
|
||||
"shortcuts": ["infobox.key"],
|
||||
"text": "shortcuts.browsing.with_selected.infobox"
|
||||
},
|
||||
|
||||
|
||||
Vendored
+11
-2
@@ -349,6 +349,7 @@
|
||||
"truncated_list": "Edits by {users} and {count} others"
|
||||
},
|
||||
"infobox": {
|
||||
"key": "I",
|
||||
"selected": "{n} selected",
|
||||
"geometry": "Geometry",
|
||||
"closed": "closed",
|
||||
@@ -423,6 +424,7 @@
|
||||
"background": {
|
||||
"title": "Background",
|
||||
"description": "Background settings",
|
||||
"key": "B",
|
||||
"percent_brightness": "{opacity}% brightness",
|
||||
"none": "None",
|
||||
"best_imagery": "Best known imagery source for this location",
|
||||
@@ -436,12 +438,14 @@
|
||||
"offset": "Drag anywhere in the gray area below to adjust the imagery offset, or enter the offset values in meters.",
|
||||
"minimap": {
|
||||
"description": "Minimap",
|
||||
"tooltip": "Show a zoomed out map to help locate the area currently displayed."
|
||||
"tooltip": "Show a zoomed out map to help locate the area currently displayed.",
|
||||
"key": "/"
|
||||
}
|
||||
},
|
||||
"map_data": {
|
||||
"title": "Map Data",
|
||||
"description": "Map Data",
|
||||
"key": "F",
|
||||
"data_layers": "Data Layers",
|
||||
"fill_area": "Fill Areas",
|
||||
"map_features": "Map Features",
|
||||
@@ -500,7 +504,8 @@
|
||||
"area_fill": {
|
||||
"wireframe": {
|
||||
"description": "No Fill (Wireframe)",
|
||||
"tooltip": "Enabling wireframe mode makes it easy to see the background imagery."
|
||||
"tooltip": "Enabling wireframe mode makes it easy to see the background imagery.",
|
||||
"key": "W"
|
||||
},
|
||||
"partial": {
|
||||
"description": "Partial Fill",
|
||||
@@ -625,6 +630,7 @@
|
||||
},
|
||||
"help": {
|
||||
"title": "Help",
|
||||
"key": "H",
|
||||
"help": "# Help\n\nThis is an editor for [OpenStreetMap](http://www.openstreetmap.org/), the\nfree and editable map of the world. You can use it to add and update\ndata in your area, making an open-source and open-data map of the world\nbetter for everyone.\n\nEdits that you make on this map will be visible to everyone who uses\nOpenStreetMap. In order to make an edit, you'll need to\n[log in](https://www.openstreetmap.org/login).\n\nThe [iD editor](http://ideditor.com/) is a collaborative project with [source\ncode available on GitHub](https://github.com/openstreetmap/iD).\n",
|
||||
"editing_saving": "# Editing & Saving\n\nThis editor is designed to work primarily online, and you're accessing\nit through a website right now.\n\n### Selecting Features\n\nTo select a map feature, like a road or point of interest, click\non it on the map. This will highlight the selected feature, open a panel with\ndetails about it, and show a menu of things you can do with the feature.\n\nTo select multiple features, hold down the 'Shift' key. Then either click\non the features you want to select, or drag on the map to draw a rectangle.\nThis will draw a box and select all the points within it.\n\n### Saving Edits\n\nWhen you make changes like editing roads, buildings, and places, these are\nstored locally until you save them to the server. Don't worry if you make\na mistake - you can undo changes by clicking the undo button, and redo\nchanges by clicking the redo button.\n\nClick 'Save' to finish a group of edits - for instance, if you've completed\nan area of town and would like to start on a new area. You'll have a chance\nto review what you've done, and the editor supplies helpful suggestions\nand warnings if something doesn't seem right about the changes.\n\nIf everything looks good, you can enter a short comment explaining the change\nyou made, and click 'Save' again to post the changes\nto [OpenStreetMap.org](http://www.openstreetmap.org/), where they are visible\nto all other users and available for others to build and improve upon.\n\nIf you can't finish your edits in one sitting, you can leave the editor\nwindow and come back (on the same browser and computer), and the\neditor application will offer to restore your work.\n\n### Using the editor\n\nYou can view a list of keyboard shortcuts by pressing the `?` key.\n",
|
||||
"roads": "# Roads\n\nYou can create, fix, and delete roads with this editor. Roads can be all\nkinds: paths, highways, trails, cycleways, and more - any often-crossed\nsegment should be mappable.\n\n### Selecting\n\nClick on a road to select it. An outline should become visible, along\nwith a small tools menu on the map and a sidebar showing more information\nabout the road.\n\n### Modifying\n\nOften you'll see roads that aren't aligned to the imagery behind them\nor to a GPS track. You can adjust these roads so they are in the correct\nplace.\n\nFirst click on the road you want to change. This will highlight it and show\ncontrol points along it that you can drag to better locations. If\nyou want to add new control points for more detail, double-click a part\nof the road without a node, and one will be added.\n\nIf the road connects to another road, but doesn't properly connect on\nthe map, you can drag one of its control points onto the other road in\norder to join them. Having roads connect is important for the map\nand essential for providing driving directions.\n\nYou can also click the 'Move' tool or press the `M` shortcut key to move the entire road at\none time, and then click again to save that movement.\n\n### Deleting\n\nIf a road is entirely incorrect - you can see that it doesn't exist in satellite\nimagery and ideally have confirmed locally that it's not present - you can delete\nit, which removes it from the map. Be cautious when deleting features -\nlike any other edit, the results are seen by everyone and satellite imagery\nis often out of date, so the road could simply be newly built.\n\nYou can delete a road by clicking on it to select it, then clicking the\ntrash can icon or pressing the 'Delete' key.\n\n### Creating\n\nFound somewhere there should be a road but there isn't? Click the 'Line'\nicon in the top-left of the editor or press the shortcut key `2` to start drawing\na line.\n\nClick on the start of the road on the map to start drawing. If the road\nbranches off from an existing road, start by clicking on the place where they connect.\n\nThen click on points along the road so that it follows the right path, according\nto satellite imagery or GPS. If the road you are drawing crosses another road, connect\nit by clicking on the intersection point. When you're done drawing, double-click\nor press 'Return' or 'Enter' on your keyboard.\n",
|
||||
@@ -886,6 +892,9 @@
|
||||
"shortcuts": {
|
||||
"title": "Keyboard shortcuts",
|
||||
"tooltip": "Show the keyboard shortcuts screen.",
|
||||
"toggle": {
|
||||
"key": "?"
|
||||
},
|
||||
"key": {
|
||||
"alt": "Alt",
|
||||
"backspace": "Backspace",
|
||||
|
||||
@@ -14,7 +14,7 @@ import { tooltip } from '../util/tooltip';
|
||||
|
||||
|
||||
export function uiBackground(context) {
|
||||
var key = 'B',
|
||||
var key = t('background.key'),
|
||||
detected = utilDetect(),
|
||||
opacities = [1, 0.75, 0.5, 0.25],
|
||||
directions = [
|
||||
@@ -474,7 +474,7 @@ export function uiBackground(context) {
|
||||
.append('label')
|
||||
.call(tooltip()
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('background.minimap.tooltip'), '/'))
|
||||
.title(uiTooltipHtml(t('background.minimap.tooltip'), t('background.minimap.key')))
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
@@ -569,9 +569,8 @@ export function uiBackground(context) {
|
||||
|
||||
var keybinding = d3keybinding('background')
|
||||
.on(key, toggle)
|
||||
.on(uiCmd('⌘B'), quickSwitch)
|
||||
.on('F', hide)
|
||||
.on('H', hide);
|
||||
.on(uiCmd('⌘' + key), quickSwitch)
|
||||
.on([t('map_data.key'), t('help.key')], hide);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
+2
-3
@@ -10,7 +10,7 @@ import { tooltip } from '../util/tooltip';
|
||||
|
||||
|
||||
export function uiHelp(context) {
|
||||
var key = 'H';
|
||||
var key = t('help.key');
|
||||
|
||||
var docKeys = [
|
||||
'help.help',
|
||||
@@ -214,8 +214,7 @@ export function uiHelp(context) {
|
||||
|
||||
var keybinding = d3keybinding('help')
|
||||
.on(key, toggle)
|
||||
.on('B', hide)
|
||||
.on('F', hide);
|
||||
.on([t('background.key'), t('map_data.key')], hide);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
+2
-3
@@ -13,8 +13,7 @@ import {
|
||||
|
||||
|
||||
export function uiInfo(context) {
|
||||
var key = uiCmd('⌘I'),
|
||||
isImperial = (utilDetect().locale.toLowerCase() === 'en-us'),
|
||||
var isImperial = (utilDetect().locale.toLowerCase() === 'en-us'),
|
||||
isHidden = true;
|
||||
|
||||
|
||||
@@ -244,7 +243,7 @@ export function uiInfo(context) {
|
||||
redraw();
|
||||
|
||||
var keybinding = d3keybinding('info')
|
||||
.on(key, toggle);
|
||||
.on(uiCmd('⌘' + t('infobox.key')), toggle);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
@@ -8,7 +8,7 @@ import { tooltip } from '../util/tooltip';
|
||||
|
||||
|
||||
export function uiMapData(context) {
|
||||
var key = 'F',
|
||||
var key = t('map_data.key'),
|
||||
features = context.features().keys(),
|
||||
layers = context.layers(),
|
||||
fills = ['wireframe', 'partial', 'full'],
|
||||
@@ -286,7 +286,7 @@ export function uiMapData(context) {
|
||||
.html(true)
|
||||
.title(function(d) {
|
||||
var tip = t(name + '.' + d + '.tooltip'),
|
||||
key = (d === 'wireframe' ? 'W' : null);
|
||||
key = (d === 'wireframe' ? t('area_fill.wireframe.key') : null);
|
||||
|
||||
if (name === 'feature' && autoHiddenFeature(d)) {
|
||||
tip += '<div>' + t('map_data.autohidden') + '</div>';
|
||||
@@ -479,9 +479,8 @@ export function uiMapData(context) {
|
||||
|
||||
var keybinding = d3keybinding('features')
|
||||
.on(key, togglePanel)
|
||||
.on('W', toggleWireframe)
|
||||
.on('B', hidePanel)
|
||||
.on('H', hidePanel);
|
||||
.on(t('area_fill.wireframe.key'), toggleWireframe)
|
||||
.on([t('background.key'), t('help.key')], hidePanel);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as d3 from 'd3';
|
||||
import { d3keybinding } from '../lib/d3.keybinding.js';
|
||||
import { t } from '../util/locale';
|
||||
import { svgDebug, svgGpx } from '../svg/index';
|
||||
import { geoRawMercator } from '../geo/index';
|
||||
import { rendererTileLayer } from '../renderer/index';
|
||||
@@ -15,7 +16,6 @@ function vecScale(a, b) { return [ a[0] * b, a[1] * b ]; }
|
||||
|
||||
|
||||
export function uiMapInMap(context) {
|
||||
var key = '/';
|
||||
|
||||
|
||||
function map_in_map(selection) {
|
||||
@@ -325,7 +325,7 @@ export function uiMapInMap(context) {
|
||||
redraw();
|
||||
|
||||
var keybinding = d3keybinding('map-in-map')
|
||||
.on([key], toggle);
|
||||
.on(t('background.minimap.key'), toggle);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
@@ -10,7 +10,6 @@ import { utilDetect } from '../util/detect';
|
||||
|
||||
|
||||
export function uiShortcuts() {
|
||||
var key = '?';
|
||||
var detected = utilDetect();
|
||||
var activeTab = 0;
|
||||
var modalSelection;
|
||||
@@ -18,7 +17,7 @@ export function uiShortcuts() {
|
||||
|
||||
|
||||
var keybinding = d3keybinding('shortcuts')
|
||||
.on([key], function () {
|
||||
.on(t('shortcuts.toggle.key'), function () {
|
||||
if (d3.selectAll('.modal-shortcuts').size()) { // already showing
|
||||
if (modalSelection) {
|
||||
modalSelection.close();
|
||||
|
||||
Reference in New Issue
Block a user