MediaWiki-feature for automatic redirections to non-english pages

Discussions about the wiki documentation of FreeCAD and its translation.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
csm
Posts: 17
Joined: Sat Dec 07, 2019 8:14 am
Location: /de

MediaWiki-feature for automatic redirections to non-english pages

Post by csm »

I wonder for some time, why the mediawiki-feature for automatic redirections to non-english pages: "Special:MyLanguage/" (https://www.mediawiki.org/wiki/Help:Ext ... MyLanguage) is not used in FreeCad-wiki ?

In my opinion that would save much labor, because it becomes superfluous to edit links manually during translation (only labels needs to be translated). Links will be redirected automatically to pages in readers preset language (at least if these exists; otherwise the english page will be loaded as default). Therefore the 2nd advantage is to avoid broken (red) links, that appears, if a non-english target-page not yet exists at the time of translation (by manually edited links).

What's the reason for this? Is this useful feature simply not sufficiently well-known or not installed/implemented in FC-wiki or perhaps it causes troubles by coverting wiki to FC-included helpfile ?
Last edited by csm on Sun Mar 01, 2020 11:20 pm, edited 2 times in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: mediawiki-feature for automatic redirections to non-english pages is not used in FreeCAD wiki?

Post by Kunda1 »

Is this a feautre in mediawiki that needs to be turned on by the admin ?
Can you find documentation on this for us ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: mediawiki-feature for automatic redirections to non-english pages is not used in FreeCAD wiki?

Post by vocx »

csm wrote: Wed Feb 26, 2020 8:58 pm ...Is this useful feature simply not sufficiently well-known or not installed/implemented in FC-wiki or perhaps it causes troubles by coverting wiki to FC-included helpfile ?
Indeed MediaWiki is pretty big and has many extensions, not all of them are known by the wiki administrators. If you have ideas and tips, please write them down, and provide links to useful features and their documentation.

Also, a historical note, the wiki that you see now isn't in a dedicated host, which means the wiki administrators don't have direct access to many functions of the wiki, in order to do proper installation and maintenance. The wiki as well as many FreeCAD services are currently being moved to a new dedicated server. Once this transition is done, the wiki administrators will be able to do more maintenance.

This wiki wasn't even the original one, it was migrated from somewhere, maybe SourceForge. So, it has gone through a few major changes over the years.
kkremitzki wrote: Mon Jan 27, 2020 3:57 am I have finally moved the first of our services to Digital Ocean. ...
Up next is the wiki.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: mediawiki-feature for automatic redirections to non-english pages is not used in FreeCAD wiki?

Post by mario52 »

Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
csm
Posts: 17
Joined: Sat Dec 07, 2019 8:14 am
Location: /de

Re: mediawiki-feature for automatic redirections to non-english pages is not used in FreeCAD wiki?

Post by csm »

I got it !

During my self-study how to translate wikitext some weeks ago I stumbled across a video explaning MediaWiki Translate extension at https://www.mediawiki.org/wiki/Help:Ext ... on_example (on the right side)

(DirectLink to video: https://upload.wikimedia.org/wikipedia/ ... p.vp9.webm )

So I took a closer look to this video again: at 10min:20s the usage of the feature "Special:MyLanguage/" is explained: it is already a part of Mediawiki Translate extension and has to be inserted as variable prepending a link in the original english wiki-page with following syntax:

Code: Select all

[[<tvar|VE>Special:MyLanguage/"target"</>|"label"]]
After this is done the link will be automatically redirected to readers preselected language.

As a test I used the currently available "big sandbox" ;-) and changed at page https://wiki.freecadweb.org/Tutorials the link to "drawing tutorial" -> take a look by yourselves: whatever you set as your default language now - the link will point to the corresponding translated page correctly!

And the best: after editing the english page all the (former manually set) links at translated pages were updated automatically! -> this means in effect, to integrate this feature only english pages themselves have to be edited manually just once; but after this no one of the already translated pages needs any revise relating to this. (my apprehension, that all the manually edited links at already translated pages have to edited back (remove /de, /fr, /es and so on...), fortunately don't come true...)

Edit: Correction because of mistaking
Last edited by csm on Sun Mar 01, 2020 11:24 pm, edited 1 time in total.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: mediawiki-feature for automatic redirections to non-english pages is not used in FreeCAD wiki?

Post by vocx »

csm wrote: Fri Feb 28, 2020 10:50 pm ...
As a test I used the currently available "big sandbox" ;-) and changed at page https://wiki.freecadweb.org/Tutorials the link to "drawing tutorial" -> take a look by yourselves: whatever you set as your default language now - the link will point to the corresponding translated page correctly!
...
Good job. This sounds impressive.

However, this would mean every single link in the entire wiki would need to be changed in this way. This sounds like a huge task, and moreover, adding the markup <tvar|VE>Special:MyLanguage/ </> seems a bit cumbersome in the source.

I wonder if it would be possible to activate this special command globally so that every link stays the same. That sounds much more sensible.

Can you investigate further?

Maybe you can test what happens with pages that link to each other.

Say that page A has links to page B, and page B also has links to page A. Do the links in both pages need to be changed with the markup you describe?
Last edited by vocx on Sat Feb 29, 2020 12:58 am, edited 1 time in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
chrisb
Veteran
Posts: 54309
Joined: Tue Mar 17, 2015 9:14 am

Re: mediawiki-feature for automatic redirections to non-english pages is not used in FreeCAD wiki?

Post by chrisb »

csm wrote: Fri Feb 28, 2020 10:50 pm I got it !
That's interesting and shoud ease the work of translators.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
csm
Posts: 17
Joined: Sat Dec 07, 2019 8:14 am
Location: /de

Re: MediaWiki-feature for automatic redirections to non-english pages

Post by csm »

hmm, I'm afraid I was too euphoric and have to row back a little... :oops:

@vocx: I've seen that you have edited the link on english source page @ freecadweb.org/wiki/Tutorials similar to my test-edit @ wiki.freecadweb.org/Tutorials. But your edit doesn't work for me as anticipated: whatever I choose as default language there - always the link forwards me to german translated target page. Oddly enough it still works for me at wiki.freecadweb.org (also tested at another device) but not at freecadweb.org/wiki. Currently I don't understand why it occurs that kind. Perhaps the variable needs to be initialized anyway ? Do you have tested both successfully ?

My 2nd mistaking: unfortunately now it seems to me that already translated pages - contrary to my 1st assessment - still have to edited too (i.e. no auto-removal of /de, /fr, /it and so on). I can't reenact anymore how I came to my former thesis - now de facto it isn't so, sorry. :cry:
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: MediaWiki-feature for automatic redirections to non-english pages

Post by Kunda1 »

Note the staging wiki aka wiki.freecadweb.org is 4 major versions ahead of our production wiki aka freecadweb.org/wiki
So it makes sense that it would work on the former and not the latter
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: MediaWiki-feature for automatic redirections to non-english pages

Post by vocx »

csm wrote: Sun Mar 01, 2020 11:28 pm @vocx: I've seen that you have edited the link on english source page @ freecadweb.org/wiki/Tutorials similar to my test-edit @ wiki.freecadweb.org/Tutorials. But your edit doesn't work for me as anticipated: ...
The new wiki has a newer translate extension, so it probably works there fine, but it fails in the old wiki which has an older translate extension. We need to test this more once the migration happens.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply