Jump to content

Project talk:Terminology gadget

From translatewiki.net
Latest comment: 10 minutes ago by Tacsipacsi in topic Automatic mode support
This discussion page previously used LiquidThreads. You can see and continue those discussions on the LiquidThreads archive page (all archives).


German localization broken because of FORMAL

@Jon Harald Søby: While I was working with the interface today I noticed that the "Add term" dialog shows the German translation MediaWiki:Gadget-term-dialog-footnote/de raw, unparsed. I believe this revert was done for this reason, and undoing it was not correct. But I don't want to get involved in an edit-war. It looks like messages that are parsed in the frontend really can't use the FORMAL feature as long as phab:T366602 is not fixed (and deployed here). The responsible jqueryMsg and mw.language modules don't contain any code for FORMAL and apparently break and stop working when curly braces are nested in a way the code can't understand. TMg (talk) 11:00, 6 August 2024 (UTC)Reply

@TMg: That's not the reason the revert was made, that user just really doesn't like this feature. But yeah, I've just reverted it now until gerrit:1038812 (or an alternative) is merged. Jon Harald Søby (talk) 11:26, 6 August 2024 (UTC)Reply

Newlines eaten on the legacy interface

Please take a look at https://translatewiki.net/w/i.php?title=MediaWiki:Blockedtext-partial/hu&action=edit. Before the gadget loads (or if it’s disabled), the English message contains several line breaks. Once the gadget loads, they disappear. The same message appears as expected on Special:Translate; the newlines are kept there. Could you please fix the legacy interface? Thanks in advance! —Tacsipacsi (talk) 16:33, 13 August 2024 (UTC)Reply

@Tacsipacsi: Thanks for the report! It should be fixed with this and this edit. Please verify. :-) Jon Harald Søby (talk) 11:05, 14 August 2024 (UTC)Reply
@Jon Harald Søby: Thanks, looks good! However, the JS change looks a bit scary: what if the line break is formatted differently (<br />, <br style=""> etc.)? Maybe the Translate code should be changed so that it also uses white-space:pre-wrap instead of HTML line breaks. —Tacsipacsi (talk) 11:16, 14 August 2024 (UTC)Reply
Created phab:T372463. —Tacsipacsi (talk) 11:38, 14 August 2024 (UTC)Reply
@Tacsipacsi: I think it should be safe, because the <br /> tags are inserted by the extension (converting line breaks into <br \>), and I don't see any reason why that would change to something different in the foreseeable future. But yeah, changing it in the extension would also solve the problem, but I'll leave that to someone else for the moment. :-) Jon Harald Søby (talk) 11:41, 14 August 2024 (UTC)Reply

Automatic mode support

@Jon Harald Søby: currently, the gadget works fine in night mode, but it doesn’t support automatic mode with prefers-color-scheme: dark. Can you modify MediaWiki:Gadget-terminology.css to also have automatic mode support, as shown in mw:Recommendations for night mode compatibility on Wikimedia wikis#Target night mode using standard media query as well as HTML classes? stjn[ru] 14:53, 19 October 2024 (UTC)Reply

Additionally, in my opinion, it would be good to not duplicate styles between MediaWiki:Gadget-terminology.css#L-111 and Template:Discuss term and just put all of them into Template:Discuss term/styles.css. I moved the existing styles to that page to solve the Special:LintErrors/night-mode-unaware-background-color lint error that was coming from the template usage. stjn[ru] 11:23, 21 October 2024 (UTC)Reply
I don’t think merging them is feasible. Editing gadget styles requires a higher level of trust than TemplateStyles. While storing the gadget styles as TemplateStyles closes many of the attack vectors, some still remain (e.g. TemplateStyles constrain the styles to parser output as a security measure, but this doesn’t happen if you load the page as if it was a gadget style page).
On the other hand, supporting automatic dark mode is absolutely possible and necessary; in fact, I also wanted to complain about it, but you were quicker. —Tacsipacsi (talk) 18:33, 23 October 2024 (UTC)Reply