Hi. This solution is just for now. I'm planning to create an RfC task to discuss all the issues and all the options for language direction question in the extension, but it can take a year or more. There is a need to fix the worst problem right now, quickly, and the solution can remain or not in the long distance future. So, I'm publishing the task and starting to work on a Gerrit change just after that.
Reminder to the problem: the Wikibase sections in the watchlist are completely unreadable, because of the edit comments formatting. Here is my usual Wikidata watchlist:
The bidirectional parts are randomly ordered, sometimes without spaces because they are on the wrong side. This happens because Wikidata has ltr direction, but the parsedcomments are in RTL, the language I chose in local Wikidata user preferences to understand the page name labels. I thought for weeks about a good quick solution, and I found one today. Here are my criterias for the good quick solution:
- Do not refactor the system, the change should be small.
- Use only the existing api calls, or in worst case add a minimum of them.
- Fix the problem at least in 99%.
- Do not break anything existing.
Here is the solution I'm implementing:
- Add to the list=watchlist API call the parameter responselanginfo=1, which returns the language of the call answer.
- If the site has isWikibase=true in its extension code config, ignore the site direction and use the direction from 1. above.
- To get the direction we add languageinfo to siteinfo on first iteration and keep in per run variable the whole dictionary. This will keep also the same number of API calls.
- Use the language from 1. above for the subsequent edit tags call.
- Use the language from 1. above for mw.msg of "Tags:" system message, if possible, enclose in <bdi> tags otherwise.
- Enclose in <bdi> tags every edit tag, all the "Tags: ..." part, edit comment and log action description.
That's all. Thank you.
