Page MenuHomePhabricator

TemplateData: Creating TemplateData blocks should be direction neutral
Closed, ResolvedPublic

Description

This is a bug/design issuse with TemplateData.

To use TemplateData in RTL wikis, the syntax mix English and Arabic/Hebrew (etc).

Editing mixed languages with different direction is hard and should be avoided as much as possible because of BiDi issues. (in some cases, such as Lua modules it isn't possible to completely avoid it).

Example :
<templatedata>
{

"description": "תבנית כלשהי.",
"params": {
        "שם": {
                "label": "שם",
                "type": "string/wiki-user-name",
                "required": true,
                "description": "שם של משתמש",
                "aliases": ["1"]
        }
},
"sets": [
        {
                "label": "Date",
                "params": ["שנה", "חודש", "יום"]
        }
]

}
</templatedata>
It is very hard to edit such syntax as above. (<templatedata> is OK since it is in different line - but the JSON isn't [if we don't want to define special indentation convention due to direction issues])
The syntax for the JSON keywords (description, params, label etc) should be either translatable or should have some neutral direction alternative to defines it (JSON by itself is directionless - [{}:,] doesn't have direction information).

See also:

  • bug 50169 - implementing this feature may reduce the severity of this bug (this solution will force template editors in RTL wiki to use visual editor at least for templatedata definitions).
  • bug 50370 - translation of interface items

Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=50370

Details

Reference
bz50436

Related Objects

StatusSubtypeAssignedTask
ResolvedJdforrester-WMF
InvalidJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedNone
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedMooeypoo
ResolvedMooeypoo
ResolvedLtrlg
ResolvedMooeypoo
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:51 AM
bzimport added projects: TemplateData, I18n.
bzimport set Reference to bz50436.

The ideal thing here would be to build a tree-like visual TemplateData editor, that would save its data to JSON. Kinda like http://www.jsoneditoronline.org/ (first Google result for "json editor").

Separating labels and data would easily solve the RTL problem, and would also make TemplateData easier to edit for users in all languages.

See bug 51734 (Create a non-VisualEditor plugin tool to add/edit template hinting) for visual interface.

(In reply to comment #2)

The ideal thing here would be to build a tree-like visual TemplateData
editor,
that would save its data to JSON. Kinda like http://www.jsoneditoronline.org/
(first Google result for "json editor").

It kinda exists now, http://tools.wikimedia.pl/~mlazowik/templatedata/, but is currently not translateable (only in Polish). The code is on GitHub (https://github.com/mlazowik/templatedata/) and author accepts pull requests :) (CC'ing him).

A user interface exists also as a script on enwiki (which can be used directly from other wikis)
http://en.wikipedia.org/wiki/User:NicoV/TemplateDataEditor

It was written by Ltrlg (see 2 posts above) on frwiki, I translated it into English.

I've addded rtl support to my editor (http://tools.wikimedia.pl/~mlazowik/templatedata/). You can send me translations. More info in the bottom of the page.

Is it possible to edit templatedata or just create new? Is it possible to populate the form with existing tempaltedata?

The main problem isn't creation of tempaltedata (which for many cases can be done by bots), but to maintain it - e.g changing the description, adding/removing parameters etc.

I'm working on a TemplateData Generator extension that will allow the editing or creation from scratch of templatedata json. It will allow the editing of the json data visually, so you could maintain the parameters or description as you please with a GUI.

I'm also making sure it works with RTL languages and the GUI is completely translation-ready. I hope it will be ready in the next few days (at least a basic working version of it)

I forgot to attach the link... here it is:

https://github.com/mooeypoo/MediaWiki-TemplateDataGenerator

It's still being tested, and there are a couple of changes we should still implement, but it's getting there. I hope it will be ready for wider test in the next few days.

Ltrlg's script can edit an existing templatedata. I don't know if it works correctly with rtl languages, but if it doesn't you could always ask Ltrlg to fix it.

Michal tool seems interesting but it currently lacks the ability to edit an existing templatedata. Michal, is that something you're planning to add?

(In reply to comment #10)

Michal tool seems interesting but it currently lacks the ability to edit an
existing templatedata. Michal, is that something you're planning to add?

Absolutely! Working on that now. At first you'll have to copy JSON data to the tool, but I'll try to add auto copying from a given template.

Change 85400 had a related patch set uploaded by Mooeypoo:
TemplateData Generator GUI

https://gerrit.wikimedia.org/r/85400

Change 85400 merged by jenkins-bot:
Implement edit interface for TemplateData documentation

https://gerrit.wikimedia.org/r/85400

So… I'm not sure how to dispose of this bug:

  • FIXED – except it's not fixed, it's just "worked around" by bug 51734
  • INVALID – except it's still a valid concern
  • WORKSFORME – but only because I'm willing to put up with this (and I don't do RTL much)
  • WONTFIX – closest to the truth, but feels a little blunt

Perhaps we should wait for the template editor to be deployed for all languages, then close this as WONTFIX?

How about marking it as a duplicate of bug 51734?

Thanks Moriel for implementing a nice workaround to this bug.
I think this bug can be disposed after template editor will be deployed to all wikis.

(In reply to comment #15)

How about marking it as a duplicate of bug 51734?

I don't think it's really a duplicate, though; the problem remains (so if you want to edit the source directly you still have to deal with it).

(In reply to comment #16)

Thanks Moriel for implementing a nice workaround to this bug.
I think this bug can be disposed after template editor will be deployed to
all wikis.

That seems like a reasonable resolution. Will do.

Would be nice to deploy it the template data editor to Hebrew Wikipedia - it is more important then in other wikis because of this bug

This is now effectively "solved" through general availability of the GUI to edit TemplateData.