From fab750d3539a3f94eac96c5a678e838f2841f7a3 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Mon, 29 Jun 2020 12:46:06 -0400 Subject: [PATCH] Use more placeholder references in the help docs Use a reusable format for the section title counts --- data/core.yaml | 21 ++++++++++---------- dist/locales/en.json | 21 ++++++++++---------- modules/ui/panes/help.js | 4 ++++ modules/ui/sections/raw_member_editor.js | 3 ++- modules/ui/sections/raw_membership_editor.js | 3 ++- modules/ui/sections/raw_tag_editor.js | 2 +- modules/ui/sections/selection_list.js | 2 +- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index dc3d92cf2..3e7d5a9f6 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -610,10 +610,11 @@ en: view_on_keepRight: View on keepright.at feature_type: Feature Type fields: Fields - tags_count: "Tags ({count})" - members_count: "Members ({count})" - relations_count: "Relations ({count})" - features_count: "Features ({count})" + tags: Tags + members: Members + relations: Relations + features: Features + title_count: "{title} ({count})" add_to_relation: Add to a relation new_relation: New relation... choose_relation: Choose a parent relation @@ -1337,11 +1338,11 @@ en: type: "You can click on the feature type to change the feature to a different type. Everything that exists in the real world can be added to OpenStreetMap, so there are thousands of feature types to choose from." type_picker: "The type picker displays the most common feature types, such as parks, hospitals, restaurants, roads, and buildings. You can search for anything by typing what you're looking for in the search box. You can also click the {inspect} **Info** icon next to the feature type to learn more about it." fields_h: "Fields" - fields_all_fields: "The \"Fields\" section contains all of the feature's details that you may edit. In OpenStreetMap, all of the fields are optional, and it's OK to leave a field blank if you are unsure." + fields_all_fields: "The \"{fields}\" section contains all of the feature's details that you may edit. In OpenStreetMap, all of the fields are optional, and it's OK to leave a field blank if you are unsure." fields_example: "Each feature type will display different fields. For example, a road may display fields for its surface and speed limit, but a restaurant may display fields for the type of food it serves and the hours it is open." fields_add_field: "You can also click the \"Add field\" dropdown to add more fields, such as a description, Wikipedia link, wheelchair access, and more." tags_h: "Tags" - tags_all_tags: "Below the fields section, you can expand the \"Tags\" section to edit any of the OpenStreetMap *tags* for the selected feature. Each tag consists of a *key* and *value*, data elements that define all of the features stored in OpenStreetMap." + tags_all_tags: "Below the fields section, you can expand the \"{tags}\" section to edit any of the OpenStreetMap *tags* for the selected feature. Each tag consists of a *key* and *value*, data elements that define all of the features stored in OpenStreetMap." tags_resources: "Editing a feature's tags requires intermediate knowledge about OpenStreetMap. You should consult resources like the [OpenStreetMap Wiki](https://wiki.openstreetmap.org/wiki/Main_Page) or [Taginfo](https://taginfo.openstreetmap.org/) to learn more about accepted OpenStreetMap tagging practices." points: title: Points @@ -1398,8 +1399,8 @@ en: title: Relations intro: "A *relation* is a special type of feature in OpenStreetMap that groups together other features. The features that belong to a relation are called *members*, and each member can have a *role* in the relation." edit_relation_h: "Editing Relations" - edit_relation: "At the bottom of the feature editor, you can expand the \"Relations\" section to see if the selected feature is a member of any relations. You can then click on the relation to select and edit it." - edit_relation_add: "To add a feature to a relation, select the feature, then click the {plus} add button in the \"Relations\" section of the feature editor. You can choose from a list of nearby relations, or choose the \"New relation...\" option." + edit_relation: "At the bottom of the feature editor, you can expand the \"{relations}\" section to see if the selected feature is a member of any relations. You can then click on the relation to select and edit it." + edit_relation_add: "To add a feature to a relation, select the feature, then click the {plus} add button in the \"{relations}\" section of the feature editor. You can choose from a list of nearby relations, or choose the \"{new_relation}\" option." edit_relation_delete: "You can also click the {delete_icon} **{delete}** button to remove the selected feature from the relation. If you remove all of the members from a relation, the relation will be deleted automatically." maintain_relation_h: "Maintaining Relations" maintain_relation: "For the most part, iD will maintain relations automatically as you edit. You should take care when replacing features that might be members of relations. For example if you delete a section of road and draw a new section of road to replace it, you should add the new section to the same relations (routes, turn restrictions, etc.) as the original." @@ -1414,10 +1415,10 @@ en: turn_restriction_editing: "In the \"Turn Restrictions\" field, click to select a \"from\" road, and see whether turns are allowed or restricted to any of the \"to\" roads. You can click on the turn icons to toggle them between allowed and restricted. iD will create relations automatically and set the from, via, and to roles based on your choices." route_h: "Routes" route: "A *route* relation is a group of one or more line features that together form a route network, like a bus route, train route, or highway route." - route_add: "To add a feature to a route relation, select the feature and scroll down to the \"Relations\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation." + route_add: "To add a feature to a route relation, select the feature and scroll down to the \"{relations}\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation." boundary_h: "Boundaries" boundary: "A *boundary* relation is a group of one or more line features that together form an administrative boundary." - boundary_add: "To add a feature to a boundary relation, select the feature and scroll down to the \"Relations\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation." + boundary_add: "To add a feature to a boundary relation, select the feature and scroll down to the \"{relations}\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation." notes: title: Notes intro: "*Notes* are used to alert other users that a feature requires fixing or attention. Notes mark a specific location on the map. To view existing notes or add new ones, click the {data_icon} **{map_data}** panel to enable the OpenStreetMap notes layer." diff --git a/dist/locales/en.json b/dist/locales/en.json index c6fa3fdde..0f359c239 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -772,10 +772,11 @@ "view_on_keepRight": "View on keepright.at", "feature_type": "Feature Type", "fields": "Fields", - "tags_count": "Tags ({count})", - "members_count": "Members ({count})", - "relations_count": "Relations ({count})", - "features_count": "Features ({count})", + "tags": "Tags", + "members": "Members", + "relations": "Relations", + "features": "Features", + "title_count": "{title} ({count})", "add_to_relation": "Add to a relation", "new_relation": "New relation...", "choose_relation": "Choose a parent relation", @@ -1674,11 +1675,11 @@ "type": "You can click on the feature type to change the feature to a different type. Everything that exists in the real world can be added to OpenStreetMap, so there are thousands of feature types to choose from.", "type_picker": "The type picker displays the most common feature types, such as parks, hospitals, restaurants, roads, and buildings. You can search for anything by typing what you're looking for in the search box. You can also click the {inspect} **Info** icon next to the feature type to learn more about it.", "fields_h": "Fields", - "fields_all_fields": "The \"Fields\" section contains all of the feature's details that you may edit. In OpenStreetMap, all of the fields are optional, and it's OK to leave a field blank if you are unsure.", + "fields_all_fields": "The \"{fields}\" section contains all of the feature's details that you may edit. In OpenStreetMap, all of the fields are optional, and it's OK to leave a field blank if you are unsure.", "fields_example": "Each feature type will display different fields. For example, a road may display fields for its surface and speed limit, but a restaurant may display fields for the type of food it serves and the hours it is open.", "fields_add_field": "You can also click the \"Add field\" dropdown to add more fields, such as a description, Wikipedia link, wheelchair access, and more.", "tags_h": "Tags", - "tags_all_tags": "Below the fields section, you can expand the \"Tags\" section to edit any of the OpenStreetMap *tags* for the selected feature. Each tag consists of a *key* and *value*, data elements that define all of the features stored in OpenStreetMap.", + "tags_all_tags": "Below the fields section, you can expand the \"{tags}\" section to edit any of the OpenStreetMap *tags* for the selected feature. Each tag consists of a *key* and *value*, data elements that define all of the features stored in OpenStreetMap.", "tags_resources": "Editing a feature's tags requires intermediate knowledge about OpenStreetMap. You should consult resources like the [OpenStreetMap Wiki](https://wiki.openstreetmap.org/wiki/Main_Page) or [Taginfo](https://taginfo.openstreetmap.org/) to learn more about accepted OpenStreetMap tagging practices." }, "points": { @@ -1739,8 +1740,8 @@ "title": "Relations", "intro": "A *relation* is a special type of feature in OpenStreetMap that groups together other features. The features that belong to a relation are called *members*, and each member can have a *role* in the relation.", "edit_relation_h": "Editing Relations", - "edit_relation": "At the bottom of the feature editor, you can expand the \"Relations\" section to see if the selected feature is a member of any relations. You can then click on the relation to select and edit it.", - "edit_relation_add": "To add a feature to a relation, select the feature, then click the {plus} add button in the \"Relations\" section of the feature editor. You can choose from a list of nearby relations, or choose the \"New relation...\" option.", + "edit_relation": "At the bottom of the feature editor, you can expand the \"{relations}\" section to see if the selected feature is a member of any relations. You can then click on the relation to select and edit it.", + "edit_relation_add": "To add a feature to a relation, select the feature, then click the {plus} add button in the \"{relations}\" section of the feature editor. You can choose from a list of nearby relations, or choose the \"{new_relation}\" option.", "edit_relation_delete": "You can also click the {delete_icon} **{delete}** button to remove the selected feature from the relation. If you remove all of the members from a relation, the relation will be deleted automatically.", "maintain_relation_h": "Maintaining Relations", "maintain_relation": "For the most part, iD will maintain relations automatically as you edit. You should take care when replacing features that might be members of relations. For example if you delete a section of road and draw a new section of road to replace it, you should add the new section to the same relations (routes, turn restrictions, etc.) as the original.", @@ -1755,10 +1756,10 @@ "turn_restriction_editing": "In the \"Turn Restrictions\" field, click to select a \"from\" road, and see whether turns are allowed or restricted to any of the \"to\" roads. You can click on the turn icons to toggle them between allowed and restricted. iD will create relations automatically and set the from, via, and to roles based on your choices.", "route_h": "Routes", "route": "A *route* relation is a group of one or more line features that together form a route network, like a bus route, train route, or highway route.", - "route_add": "To add a feature to a route relation, select the feature and scroll down to the \"Relations\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation.", + "route_add": "To add a feature to a route relation, select the feature and scroll down to the \"{relations}\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation.", "boundary_h": "Boundaries", "boundary": "A *boundary* relation is a group of one or more line features that together form an administrative boundary.", - "boundary_add": "To add a feature to a boundary relation, select the feature and scroll down to the \"Relations\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation." + "boundary_add": "To add a feature to a boundary relation, select the feature and scroll down to the \"{relations}\" section of the feature editor, then click the {plus} add button to add this feature to a nearby existing relation or a new relation." }, "notes": { "title": "Notes", diff --git a/modules/ui/panes/help.js b/modules/ui/panes/help.js index 9905846c4..7b99d09df 100644 --- a/modules/ui/panes/help.js +++ b/modules/ui/panes/help.js @@ -271,6 +271,10 @@ export function uiPaneHelp(context) { merge: t('operations.merge.title'), disconnect: t('operations.disconnect.title'), map_data: t('map_data.title'), + fields: t('inspector.fields'), + tags: t('inspector.tags'), + relations: t('inspector.relations'), + new_relation: t('inspector.new_relation'), background_settings: t('background.description'), start_the_walkthrough: t('splash.walkthrough') }; diff --git a/modules/ui/sections/raw_member_editor.js b/modules/ui/sections/raw_member_editor.js index 5e263a87d..387dfce0b 100644 --- a/modules/ui/sections/raw_member_editor.js +++ b/modules/ui/sections/raw_member_editor.js @@ -33,7 +33,8 @@ export function uiSectionRawMemberEditor(context) { if (!entity) return ''; var gt = entity.members.length > _maxMembers ? '>' : ''; - return t('inspector.members_count', { count: gt + entity.members.slice(0, _maxMembers).length }); + var count = gt + entity.members.slice(0, _maxMembers).length; + return t('inspector.title_count', { title: t('inspector.members'), count: count }); }) .disclosureContent(renderDisclosureContent); diff --git a/modules/ui/sections/raw_membership_editor.js b/modules/ui/sections/raw_membership_editor.js index 3d3da9fb7..eef0502b3 100644 --- a/modules/ui/sections/raw_membership_editor.js +++ b/modules/ui/sections/raw_membership_editor.js @@ -33,7 +33,8 @@ export function uiSectionRawMembershipEditor(context) { var parents = context.graph().parentRelations(entity); var gt = parents.length > _maxMemberships ? '>' : ''; - return t('inspector.relations_count', { count: gt + parents.slice(0, _maxMemberships).length }); + var count = gt + parents.slice(0, _maxMemberships).length; + return t('inspector.title_count', { title: t('inspector.relations'), count: count }); }) .disclosureContent(renderDisclosureContent); diff --git a/modules/ui/sections/raw_tag_editor.js b/modules/ui/sections/raw_tag_editor.js index 7b25ff41d..b24a0a75b 100644 --- a/modules/ui/sections/raw_tag_editor.js +++ b/modules/ui/sections/raw_tag_editor.js @@ -17,7 +17,7 @@ export function uiSectionRawTagEditor(id, context) { .classes('raw-tag-editor') .title(function() { var count = Object.keys(_tags).filter(function(d) { return d; }).length; - return t('inspector.tags_count', { count: count }); + return t('inspector.title_count', { title: t('inspector.tags'), count: count }); }) .expandedByDefault(false) .disclosureContent(renderDisclosureContent); diff --git a/modules/ui/sections/selection_list.js b/modules/ui/sections/selection_list.js index 439800976..e639ac009 100644 --- a/modules/ui/sections/selection_list.js +++ b/modules/ui/sections/selection_list.js @@ -17,7 +17,7 @@ export function uiSectionSelectionList(context) { return _selectedIDs.length > 1; }) .title(function() { - return t('inspector.features_count', { count: _selectedIDs.length }); + return t('inspector.title_count', { title: t('inspector.features'), count: _selectedIDs.length }); }) .disclosureContent(renderDisclosureContent);