Per @Stryn on mw.org, "If I click "Edit source" at https://meta.wikimedia.org/wiki/Tech/News/2016/51/fi it should open https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-Tech%2FNews%2F2016%2F51&action=page&filter=&language=fi as in the old wikitext editor. "
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Move translate extension hack up to 'isAvailable' | mediawiki/extensions/VisualEditor | master | +4 -3 |
Related Objects
- Mentioned In
- T155133: NewWikitextEditor not working on pages with <translate> tags
T154392: When visual editing is enabled, "Translate" tab is shown as "Edit"/"Edit source"
T154500: Changes made using NWE are blocked by Translate extension but copied into OWE they're accepted
T154081: WikitextEditor overrides the ordinary translation mechanism
Event Timeline
Btw, if I open the source of translatable message in the NWE and try to edit it, the edits are abandoned by the translation extension.
Btw, if I open the source of translatable message in the NWE and try to edit it, the edits are abandoned by the translation extension.
That's by design. The source is defined elsewhere, and editing the source message there wouldn't change anything.
Are we talking about the same thing? https://www.mediawiki.org/wiki/Help:Extension:Translate/Glossary
OK, here is the scenario:
- Opt in NWE.
- Open https://meta.wikimedia.org/wiki/Tech/News/2016/51.
- Open edit mode.
- Change something, for example remove a space after bullet.
- Try to save.
- You'll get a message "your editing was abandoned by Translation Extension. Click here to continue editing."
- Close the tab.
- Opt out NWE.
- Open the same page.
- Do the same edit.
- It works.
Naturally, there should be a way to edit translatable pages source - somebody should write them.
- I believe Translate is using the proper ways to propagate an error message, but that is not shown by VE.
- Investingating what is the issue, I find pt-shake-position which basically means that <!--T:#--> is in unexpected place. Inspecting the payload that is sent, I don't see why this would be the case.
Relevant code
$rer1 = '~^<!--T:(.*?)-->( |\n)~'; // Normal sections $rer2 = '~\s*<!--T:(.*?)-->$~m'; // Sections with title $content = preg_replace( $rer1, '', $content ); $content = preg_replace( $rer2, '', $content ); if ( preg_match( $re, $content ) === 1 ) { throw new TPException( array( 'pt-shake-position', $content ) );
My guess would be that the line feeds sent by NWE are different (\r\n perhaps?) and it does not get normalized.
Change 329053 had a related patch set uploaded (by Esanders):
Copy translate extension hack to source mode
Change 329053 merged by jenkins-bot:
Move translate extension hack up to 'isAvailable'
I can confirm that issue myself — but it's different from this task as filed. I'll mark this as done and create a new one.