29
30
Fork 85

Tag syntax is counter intuitive #826

Geschlossen
2019-03-08 07:34:27 +00:00 von reinhard geöffnet · 10 Kommentare
Mitglied

The current tag format is <tag content="Label of the tag">Tag code</tag>.

However, for virtually everything else in the source files, text visible to the user (and thus subject to translation) is outside of <...> and everything inside <...> should not be translated. This leads to translators intuitively translating the tag code rather than the tag label.

I suggest to change the tag format to <tag name="Tag code">Label of the tag</tag>.

This would mean updating all source files with <tag>s in them, and updating the XSL code that actually reads the tags. I could certainly do the latter.

The current tag format is `<tag content="Label of the tag">Tag code</tag>`. However, for virtually everything else in the source files, text visible to the user (and thus subject to translation) is *outside* of <...> and everything inside <...> should not be translated. This leads to translators intuitively translating the tag code rather than the tag label. I suggest to change the tag format to `<tag name="Tag code">Label of the tag</tag>`. This would mean updating all source files with `<tag>`s in them, and updating the XSL code that actually reads the tags. I could certainly do the latter.
reinhard hat die Labels
tagging
xsl
build
2019-03-08 07:34:28 +00:00 hinzugefügt
Mitglied

Is there anything that speaks against the syntax <tag id="tag code">Label of the tag</tag>? I guess "name" as attribute could be misinterpreted as translatable content, especially since we are swapping the position of id and label...

Is there anything that speaks against the syntax `<tag id="tag code">Label of the tag</tag>`? I guess "name" as attribute could be misinterpreted as translatable content, especially since we are swapping the position of id and label...
Autor
Mitglied

I agree that id is better than name.

I agree that id is better than name.
Autor
Mitglied

After thinking about it again, I find myself strongly disagreeing with myself :-)

In HTML, the "id" attribute is always used to identify an element within the document tree, without any external meaning of the content of this attribute. If you look at attributes that contain a code which has any meaning other than addressing the element in the document tree, it is "name", as e.g. in <input name="...">.

So I go back to thinking that it should be <tag name="Tag code">Label of the tag</tag>, for the sake of being consistent with life, universe and all the rest.

After thinking about it again, I find myself strongly disagreeing with myself :-) In HTML, the "id" attribute is always used to identify an element *within the document tree*, without any external meaning of the content of this attribute. If you look at attributes that contain a code which has any meaning other than addressing the element in the document tree, it is "name", as e.g. in `<input name="...">`. So I go back to thinking that it should be `<tag name="Tag code">Label of the tag</tag>`, for the sake of being consistent with life, universe and all the rest.
Mitglied

I get your point about the name clash with "id", however there are other options as well. How about any of these alternatives:

  • tagid
  • tag
  • identifier
  • staticid
I get your point about the name clash with "id", however there are other options as well. How about any of these alternatives: * tagid * tag * identifier * staticid
Besitzer

IIRC we also had the idea of using key when we discussed about it once

IIRC we also had the idea of using `key` when we discussed about it once
Mitglied

key would work for me...

`key` would work for me...
Autor
Mitglied

I would still prefer name (from the analogy to the other HTML attributes which are called "name"), but key would also work for me.

I would still prefer name (from the analogy to the other HTML attributes which are called "name"), but key would also work for me.
Besitzer

Thanks for the input!

I agree to @jzarl that name might be misleading in this case for our translators, although there are similar examples in HTML. id would make the most sense for me, but I see @reinhard's point. So I'd go for key although it isn't perfect either.

Thanks for the input! I agree to @jzarl that `name` might be misleading in this case for our translators, although there are similar examples in HTML. `id` would make the most sense for me, but I see @reinhard's point. So I'd go for `key` although it isn't perfect either.
Mitglied

So in lack of a perfect solution let's settle for the key one.

I've created an xsl transformation file that fixes the syntax for the xml files. (I've attached it because it probably doesn't make much sense to put it into git as it will only be used once).

We also need to change the existing build scripts to deal with the new syntax, but I haven't looked into this yet. If @reinhard doesn't beat me to it, I may have some time at the end of next week to continue working on this issue.

So in lack of a perfect solution let's settle for the `key` one. I've created an xsl transformation file that fixes the syntax for the xml files. (I've attached it because it probably doesn't make much sense to put it into git as it will only be used once). We also need to change the existing build scripts to deal with the new syntax, but I haven't looked into this yet. If @reinhard doesn't beat me to it, I may have some time at the end of next week to continue working on this issue.
Autor
Mitglied

Actually, most of the xsl scripts already handle the <tag key="..."> syntax, obviously this conversion has already been planned and prepared years ago, but never finished.

AFAICT, all you would need to change would be build/xslt/get_tags.xsl and tools/tagtool/tagsToCSV.xsl.

However, after the conversion, we can clean up a number of xsl script which cover both old and new syntax and do lowercase conversion of tag keys.

Actually, most of the xsl scripts already handle the `<tag key="...">` syntax, obviously this conversion has already been planned and prepared years ago, but never finished. AFAICT, all you would need to change would be build/xslt/get_tags.xsl and tools/tagtool/tagsToCSV.xsl. However, *after* the conversion, we can clean up a number of xsl script which cover both old and new syntax and do lowercase conversion of tag keys.
reinhard hat diesen Issue 2020-04-26 13:29:57 +00:00 geschlossen
Anmelden, um an der Diskussion teilzunehmen.
Kein Meilenstein
Niemand zuständig
3 Beteiligte
Nachrichten
Fällig am
Das Fälligkeitsdatum ist ungültig oder außerhalb des zulässigen Bereichs. Bitte verwende das Format „jjjj-mm-tt“.

Kein Fälligkeitsdatum gesetzt.

Abhängigkeiten

Keine Abhängigkeiten gesetzt.

Referenz: FSFE/fsfe-website#826
Keine Beschreibung angegeben.