Modify

Opened 7 weeks ago

Last modified 6 weeks ago

#21308 assigned task

defaultpresets.xml revamp

Reported by: reichg Owned by: reichg
Priority: normal Milestone:
Component: Core Version: tested
Keywords: defaultpresets Cc: skyper

Description

The defaultpresets.xml file needs some organizational updates. Maybe some thought could go into defining the needs of each preset?

Attachments (0)

Change History (6)

comment:1 Changed 6 weeks ago by marcello@…

I'm working on a patch that fixes read-only comboboxes. Maybe start thinking which tags could profit by that.

comment:2 Changed 6 weeks ago by marcello@…

A proposal for easier customization.

For all tags that a user might reasonably wish to localize, use a reference to a chunk instead of directly using a preset item.
Eg. always use

<chunk id="name">
  <text key="name" text="Name" />
</chunk>
...
<reference ref="name" />

instead of

<text key="name" text="Name" />

This way a user that maintains a trilingual zone can easily customize all presets at once by editing defaultpresets.xml and substituting:

<chunk id="name">
  <text key="name:de"  text="German Name"  de.text="Deutscher Name"     it.text="Nome tedesco"  lld.text="Inuem tudesc" />
  <text key="name:it"  text="Italian Name" de.text="Italienischer Name" it.text="Nome italiano" lld.text="Inuem talian"/>
  <text key="name:lld" text="Ladin Name"   de.text="Ladinischer Name"   it.text="Nome ladino"   lld.text="Inuem ladin" />
  <text key="name" text="Name"
        value_template="?{'{name:lld} - {name:de} - {name:it}' | '{name:lld} - {name:de}' | '{name:lld} - {name:it}' | '{name:de} - {name:it}' | '{name:lld}' | '{name:de}' | '{name:it}'}" />
</chunk>

Of course this would get even better if we had xml include files and later chunks overriding earlier ones. After defining all default chunks in defaultpresets.xml one would include localpresets.xml. Latter file can then be configured by the user to override some of the default chunks with no need to touch defaultpresets.xml.

Last edited 6 weeks ago by Don-vip (previous) (diff)

comment:3 in reply to:  1 Changed 6 weeks ago by skyper

Replying to marcello@…:

I'm working on a patch that fixes read-only comboboxes. Maybe start thinking which tags could profit by that.

This came too fast, did not test it so far. I am used to this broken feature, that I have to think about it again to find places where this restriction is useful. In the end this can be added step by step, but you may want to open a separate ticket for editable="".

comment:4 in reply to:  2 ; Changed 6 weeks ago by skyper

Replying to marcello@…:

A proposal for easier customization.

For all tags that a user might reasonably wish to localize, use a reference to a chunk instead of directly using a preset item.
Eg. always use

Similar had been discussed in the past and there was the strong opinion to not clutter defaultspresets that much. The more chunks are used the more you have to jump around within the file for each preset which makes it more and more complicated.

Without doubt chunks are useful for grouping and for tags with lots of values and/or description on the other hand you can easily loose the overview jumping around and precision as e.g. values may depend on the primary tag or a combination.

This way a user that maintains a trilingual zone can easily customize all presets at once by editing defaultpresets.xml and substituting:

defaultpresets.xml is translated with launchpad and there is #11392.
You do not really want to have all languages within this file, do you? How should translation for all languages work then?

For external presets, where, atm, only inline translation works, this is and was an option but I doubt that it is the major reason that external presets are less frequently translated.

Of course this would get even better if we had xml include files and later chunks overriding earlier ones. After defining all default chunks in defaultpresets.xml one would include localpresets.xml. Latter file can then be configured by the user to override some of the default chunks with no need to touch defaultpresets.xml.

Now, these are valid points, but do not really depend on defaultpresets. I like to reuse chunks from defaultpresets in external presets. Besides complete override, I would like to extend or at least add a preset_link to presets from defaultpresets. Extending the menu/groups with additional items would be useful.
Maybe new tickets?

comment:5 in reply to:  description Changed 6 weeks ago by skyper

Replying to reichg:

The defaultpresets.xml file needs some organizational updates. Maybe some thought could go into defining the needs of each preset?

+1 for some reorganization.

  • Some of these chunks should be look at and at their order in general (quite mixed up, atm.).
  • Menu order, especially some growing groups could be split.
  • Checking for proper preset_links between similar but different presets is another task
  • Updating secondary keys and useful combinations plus rechecking the wiki links is a never ending story.

Usually, I try to add/fix the nearby presets when working on additional presets but the overview can get lost in this long file. Maybe we can look at specific sections and work through, step by step. What are your thoughts?

Few month ago I tried to get items for the PT-relations also under "Relations" but I failed as presets with the same name are not allowed but I guess I did not try preset_links in menus.

comment:6 in reply to:  4 Changed 6 weeks ago by marcello@…

Replying to skyper:

Similar had been discussed in the past and there was the strong opinion to not clutter defaultspresets that much. The more chunks are used the more you have to jump around within the file for each preset which makes it more and more complicated.

I was thinking only of those tags that allow for uncontrolled free text, eg. *name, addr:*, description, operator. That would add a dozen chunks at most. Not too much clutter and very useful for those who really need it.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain reichg.
as The resolution will be set.
to The owner will be changed from reichg to the specified user.
The owner will change to reichg
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.