You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to have the option to get translation pages deleted when original pages are edited and saved. So whenever the translated page is visited thereafter, the direct mode is triggered to translate the page again (because it was edited) to asure translations are always up-to-date.
I did a hack myself. Since I did not know, how to integrate this properly into your plugin's code, I did the obvious and hacked the exact spot, where pages are saved in the DokuWiki core's source code. I know, this is terrible practice, but I do not know better. (For I am a programming novice.) So here comes the code, only for you to see, how this is a straight forward approach. I added this code at the end of the function saveWikiText( ) in /dokuwiki/inc/common.php after the useheading handler:
$id_transl = 'en:' . $id;
if ( page_exists($id_transl) ) { // checks if translated page exists
sleep(1); // hold for 1 sec before recursive page save
saveWikiText($id_transl, '', 'Success Message'); // deletes translated page
}
And for me this works like a charm! Maybe you could integrate this (as a full blown function) in your magnificent plugin. 😀
The text was updated successfully, but these errors were encountered:
Chris75forumname
changed the title
[direct mode] delete translated pages when original page is edited, so direct translations are always up-to-date
[Feature request] [direct mode] delete translated pages when original page is edited, so direct translations are always up-to-date
Jun 15, 2023
It would be great to have the option to get translation pages deleted when original pages are edited and saved. So whenever the translated page is visited thereafter, the direct mode is triggered to translate the page again (because it was edited) to asure translations are always up-to-date.
I did a hack myself. Since I did not know, how to integrate this properly into your plugin's code, I did the obvious and hacked the exact spot, where pages are saved in the DokuWiki core's source code. I know, this is terrible practice, but I do not know better. (For I am a programming novice.) So here comes the code, only for you to see, how this is a straight forward approach. I added this code at the end of the function saveWikiText( ) in
/dokuwiki/inc/common.php
after theuseheading handler
:And for me this works like a charm! Maybe you could integrate this (as a full blown function) in your magnificent plugin. 😀
The text was updated successfully, but these errors were encountered: