Tag syntax is counter intuitive #826
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.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...I agree that id is better than name.
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.I get your point about the name clash with "id", however there are other options as well. How about any of these alternatives:
IIRC we also had the idea of using
key
when we discussed about it oncekey
would 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.
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 forkey
although it isn't perfect either.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.
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.