Changes between Version 184 and Version 198 of TaggingPresets
- Timestamp:
- (multiple changes)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TaggingPresets
v184 v198 49 49 <presets>:: 50 50 Has to be the main tag of the file. Supports following attributes 51 * '''xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"'''52 * '''author'''- the name of the author of the preset53 * '''version'''- the version number of the file. For automatic version adjustment of presets managed in this wiki you have to use two internal variables: `[[revision]]` (the latest version number of the wiki page) and `[[date]]` (the date of the last edit), e.g. `version="1.[[revision]]_[[date]]"`.54 * '''description'''(i18n) - description what the file contains55 * '''shortdescription'''(i18n) - very short overview description i.e. the "name" of the preset56 * '''link'''(i18n) - web link to further details (optional)57 * '''icon'''- icon for the whole preset58 * '''baselanguage'''- when the base language is not English, specify it here (using non English preset texts will prevent automatic translation, once it is implemented (#11392))51 * **xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"** 52 * **author** - the name of the author of the preset 53 * **version** - the version number of the file. For automatic version adjustment of presets managed in this wiki you have to use two internal variables: `[[revision]]` (the latest version number of the wiki page) and `[[date]]` (the date of the last edit), e.g. `version="1.[[revision]]_[[date]]"`. 54 * **description** (i18n) - description what the file contains 55 * **shortdescription** (i18n) - very short overview description i.e. the "name" of the preset 56 * **link** (i18n) - web link to further details (optional) 57 * **icon** - icon for the whole preset 58 * **baselanguage** - when the base language is not English, specify it here (using non English preset texts will prevent automatic translation, once it is implemented (#11392)) 59 59 60 60 (i18n) means the values may also be localized (e.g. `de.description`). … … 85 85 Add a horizontal separator line between items. 86 86 <link />:: 87 Specify a web link for this feature or to anything else of use. Either the `wiki=""` (referring to an OSM wiki page, e.g. `"Tag:leisure=park"`) or the `href=""` (full URL) attribute is required. When the `wiki=""` attribute is used the link points to the wiki page of the language JOSM is set to. If it doesn't exist the English page is shown. 87 Specify a web link for this feature or to anything else of use. Either the `wiki=""` (referring to an OSM wiki page, e.g. `"Tag:leisure=park"`) or the `href=""` (full URL) attribute is required. When the `wiki=""` attribute is used the link points to the wiki page of the language JOSM is set to. If it doesn't exist the English page is shown. If using `wiki=""`, the OSM wiki page must not be URL encoded, e.g., it must not be `"Tag:leisure%3Dpark"` and must instead be `"Tag:leisure=park"`. 88 88 <checkgroup>:: 89 89 To group checks. The `columns=""` attribute is required. … … 91 91 This is required around `<role />` and adds the heading ("Available roles role count elements") to the table which is generated by several `<role />`. 92 92 <role />:: 93 To specify possible roles of members in relations. The `key=""` attribute is required, `text=""`, `requisite=""`, `count=""`, `type=""` and`member_expression=""` are optional.93 To specify possible roles of members in relations. The `key=""` attribute is required, `text=""`, `requisite=""`, `count=""`, `type=""`, `member_expression=""` and `regexp=""` are optional. 94 94 <preset_link />:: 95 95 Adds a link to an other preset with a label on top. The `preset_name=""` attribute is required, `text=""` to override the label (default is `"Edit also …"`) and `text_context=""` are optional. A sequence of `<preset_link />` without `text=""` or a identical `text=""` value are grouped below one label. \\ 96 96 **Watch out** for presets with identical **`name=""`** as it is not predictable to which preset the link will lead to, see #12716. \\ 97 97 Having the same tag in both presets does not work, see #18992. \\ 98 Using `<preset_link />` in presets opened from [wikitr:/Help/Dialog/RelationEditor relation editor] produces unexpected changes, see #19392.98 Using `<preset_link />` in presets opened from [wikitr:/Help/Dialog/RelationEditor relation editor] produces exceptions, see #20044. 99 99 \\ 100 100 … … 170 170 Whether the off value of a `<check />` is disabled in the dialog, i.e., only unset or `"yes"` are provided. 171 171 editable="false":: 172 The combo box is read only, which means that the user can only select an item in the list. Default is `"true"`, which means, the user can add other values as text. **Featureis broken, see #6157**.172 The combo box is read only, which means that the user can only select an item in the list. Default is `"true"`, which means, the user can add other values as text. (Feature was not working properly for a long time but should work again since r18221, see #6157.) 173 173 use_last_as_default="true|false|force":: 174 174 For `<combo />`, `<multiselect />` or `<text />` fields the last used value is used as default. Using `"force"` enforces this behavior also for already tagged objects. Default is `"false"`. 175 175 rows="count":: 176 Specify the number of rows to display in `<multiselect />` entry (if not set, it is auto determined by java or the look and feel and results in e.g. 8). Currently, you need to add one additional row to display all values, see #19013.176 Specify the number of rows to display in `<multiselect />` entry (if not set, it is auto determined by java or the look and feel and results in e.g. 8). 177 177 name_template="template", name_template_filter="search expression":: 178 178 Custom name formatter for osm primitives matching this preset. See [#name_templatedetails name template details] below. … … 187 187 match_expression="search expression":: 188 188 additional criteria for matching primitives, specified in [wikitr:/Help/Action/Search JOSM search] syntax. ''(since r17662)'' \\ 189 Quotes (`"`) need to be written as `"`. \\ 189 190 For instance, a preset with `match_expression="foo=bar"` requires OSM objects to have the tag `foo=bar`. You may want to use the `match_expression=""` to exclude certain OSM objects, e.g. when a more specific preset is present. 190 191 id="unique_identifier":: … … 199 200 How often can a role occur (if not given unlimited number is assumed) 200 201 member_expression="search expression":: 201 an expression, in [wikitr:/Help/Action/Search JOSM search] syntax, for objects of this role 202 an expression, in [wikitr:/Help/Action/Search JOSM search] syntax, for objects of this role \\ 203 Quotes (`"`) need to be written as `"`. 202 204 regexp="true":: 203 205 set to `"true"` if the key of a role is a regular expression. \\ … … 220 222 `<list_entry value="" display_value="" short_description="" icon="" icon_size="" />` 221 223 values_searchable="true|false":: 222 Whether to search in `values=""` and `display_values=""`, respectively, `value=""` and `display_value=""` of `<combo />` or `<multiselect />` searching for presets.224 Whether to search in `values=""` and `display_values=""`, respectively, `value=""` and `display_value=""` of `<combo />` or `<multiselect />` searching for presets. 223 225 value_template="template":: 224 A template to generate the value automatically based on other tag values of the object. The syntax of `name_template=""` is use, [#NameTemplateSyntax see below]. ''(since r17639)'' \\ 225 For instance, `"Bus {ref}: {from} → {to}"` can be used to generate the name of a bus route relation. 226 \\ 227 228 ===== name_template details ===== 229 Name templates can be used to define custom formatting for OSM primitives or GPX waypoints (for example in the Relations or the Selection). 226 A template to generate the value automatically based on other tag values of the object. The same syntax as in `name_template=""` is used, [#NameTemplateSyntax see below]. ''(since r17639)'' \\ 227 For instance, `"Bus {ref}: {from} → {to}"` can be used to generate the name of a bus route relation. \\ 228 **Note**: There are some minor problems with this attribute, see #20851 and #20861. 229 \\ 230 231 ===== name_template and value_template details ===== #name_templatedetails 232 Name templates can be used to define custom formatting for OSM primitives or GPX waypoints (for example in the Relations or Selection panels). 230 233 231 234 {{{ … … 240 243 }}} 241 244 242 '''Samples'''245 **Samples** 243 246 ||= Template =||= Tags =||= Result =|| 244 247 || `House number {addr:housenumber}` || `addr:housenumber=10` || House number 10 … … 247 250 || `?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | admin_level = 6 'NUTS 3' | 'Admin level {admin_level}'}` || `admin_level=4` || NUTS 2 248 251 || || `admin_level=5` || Admin level 5 249 || `{admin_level} - {name} !{parent() type=boundary '?{'(part of {admin_level} - {name})' | ''}'}` || `admin_level=6 name=Vysocina`, member of relation `admin_level=4 name=Jihovychod` || 6 - Vysocina (part of Jihovychod) 252 || `{admin_level} - {name} !{parent() type=boundary '?{'(part of {admin_level} - {name})' | ''}'}` || `admin_level=6 name=Vysocina`, member of relation `admin_level=4 name=Jihovychod` || 6 - Vysocina (part of 4 - Jihovychod) 250 253 || || `admin_level=2 name=Czech republic` (no parents) || 2 - Czech republic 251 254 \\ 252 255 253 256 ====== Syntax ======#NameTemplateSyntax 254 * `{ var}` - use value ofvariable var255 * `?{condition1 'value1' | condition2 'value2 | 'value3'}` - use ''value1'' if ''condition1'' is satisfied, ''value3'' if no condition is satisfied. Condition can be either explicit - in [wikitr:/Help/Action/Search JOSM search] syntax - or implicit ; the value is used when allvariables used inside exist257 * `{tag}` - insert the value of the tag. 258 * `?{condition1 'value1' | condition2 'value2' | 'value3'}` - use ''value1'' if ''condition1'' is satisfied, else use ''value2'' if ''condition2'' is satisfied, finally use ''value3'' if no condition is satisfied. Condition can be either explicit - in [wikitr:/Help/Action/Search JOSM search] syntax - or implicit: The value is used when all tags referenced inside exist. 256 259 * `!{search_expression 'template'}` - search_expression is evaluated and first matching primitive is used as context for template. Useful for example to get tags of parent relation. 260 * `\` - use a backslash to escape special characters '{', '}', '?', '!'. E.g. `What is this\? It is a {type}\!`. 257 261 \\ 258 262 259 263 ====== Available values ====== 260 For formatting of OSM primitives , the value of any tag can be used.You can use`{special:everything}` tosee what values areavailableforyour gpx waypoints.261 262 Some additional variables are available via the special prefix:264 For formatting of OSM primitives, the value of any tag can be used. Use the tag `{special:everything}` to display all available tags, eg. on your gpx waypoints. 265 266 You can also use these virtual tags: 263 267 - `{special:everything}` prints all available values, available for formatting of both primitives and waypoints. 264 - `{special:id}` prints the ID of anosm primitive265 - `{special:localName}` prints the localized name, that is the value of `name:lang` for your language if it is available or the value of the name tagif itdoesn't.268 - `{special:id}` prints the ID of the osm primitive. 269 - `{special:localName}` prints the localized name, that is the value of `name:lang` for your language if it is available, or the value of `name` if it is not. 266 270 \\ 267 271 … … 276 280 277 281 == Translation == 278 To support translations, all textual elements (`name=""`, `text=""`, `display_values=""`) may also be localized. E.g. `de.name=""` would represent the name in case the German language support is loaded. In the preset code the English term must be the first before possible translations are added. 279 280 In JOSM internally ([source:josm/trunk/resources/data/defaultpresets.xml internal preset]) all `name=""`, `text=""` and `display_values=""` are translated when no specific translation has been given in XML file. When no `display_values=""` are supplied, then `values=""` will be treated as `display_values=""` and translated instead. When translations of equal words but different meanings may conflict, a translation context should be specified. Use `name_context=""`, `text_context=""` or `values_context=""` for this. The context should be a meaningful short description to help translators. 281 282 The translation for the internal preset is done at [https://translations.launchpad.net/josm/trunk Launchpad] (and will probably change to another service in the future, since the Launchpad web interface often produces timeout errors, see #8645). 283 284 The translation of external presets on this website is, so far, only possible inline within the preset source code, see #11392. 282 To support translations, all textual elements (`name=""`, `text=""`, `display_values=""`) can be localized. E.g. `de.name=""` would represent the name when the German language support is loaded. In the preset XML code the English term must be the first, before possible translations can be added. 283 284 === Internal Preset === 285 The translation for the internal preset is done at [https://translations.launchpad.net/josm/trunk Launchpad]. 286 287 In the [source:josm/trunk/resources/data/defaultpresets.xml internal preset], all `name=""`, `text=""` and `display_values=""` are translated via the above service, as long as no specific translation has been given within XML file. When no `display_values=""` are supplied, then `values=""` will be treated as `display_values=""` and translated instead. 288 289 When the same English word has different translations in different contexts, the specific translation context needs to be specified. Use `name_context=""`, `text_context=""` or `values_context=""` for this purpose. The context should be a meaningful short description to help translators. 290 291 === External Presets === 292 293 The translation of external presets on this website is, so far, only possible inline within the preset XML source code, see #11392. 294 295 Presets hosted elsewhere can also add a `data` directory with the JOSM-style {{{.lang}}} files for translation (like in JOSM itself or plugins). 296 297 However, when words are used in the external preset that already exist in the internal preset, the translation from the internal preset applies to the external as well. This is useful as long as the context is the same. When the context in the external preset is different, it needs to be distinguished by adding `name_context=""`, `text_context=""` or `values_context=""`. 285 298 286 299 == Icon handling ==
