Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Discussions about the wiki documentation of FreeCAD and its translation.
mario52
Posts: 3217
Joined: Wed May 16, 2012 2:13 pm

Re: [Solved] Broken Docnav template ?

Postby mario52 » Thu Feb 06, 2020 1:29 pm

hi

is the wiki tools PHP CDf GGG TYTY is complete or he is restrained

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
User avatar
Kunda1
Posts: 8698
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Solved] Broken Docnav template ?

Postby Kunda1 » Thu Feb 06, 2020 1:42 pm

mario52 wrote:
Thu Feb 06, 2020 1:29 pm
is the wiki tools PHP CDf GGG TYTY is complete or he is restrained
Can you use different words to ask the question? (language barrier :mrgreen: )
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
mario52
Posts: 3217
Joined: Wed May 16, 2012 2:13 pm

Re: [Solved] Broken Docnav template ?

Postby mario52 » Thu Feb 06, 2020 4:43 pm

hi

peut être qu'il manque quelque-chose dans notre wiki pour faire fonctionner les templates comme {{PAGELANGUAGE}}

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
User avatar
Kunda1
Posts: 8698
Joined: Thu Jan 05, 2017 9:03 pm

Re: Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Postby Kunda1 » Thu Feb 06, 2020 5:26 pm

mario52 wrote:
Thu Feb 06, 2020 4:43 pm
maybe something is missing in our wiki to make templates like {{PAGELANGUAGE}} work
Yes, good point ;)
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 8698
Joined: Thu Jan 05, 2017 9:03 pm

Re: Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Postby Kunda1 » Thu Feb 06, 2020 6:30 pm

mario52 wrote:
Thu Feb 06, 2020 4:43 pm
maybe something is missing in our wiki to make templates like {{PAGELANGUAGE}} work
@mario52 I figured it out..I think. it needs to be inside <translate> tags

Look at the bottom of https://www.freecadweb.org/wiki/Import_Export
Now look at:
https://www.freecadweb.org/wiki/Import_Export/de
https://www.freecadweb.org/wiki/Import_Export/es
https://www.freecadweb.org/wiki/Import_Export/fr etc...
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 8698
Joined: Thu Jan 05, 2017 9:03 pm

Re: Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Postby Kunda1 » Thu Feb 06, 2020 7:13 pm

So the next 2 question are
1. can we use conditional formatting in the {{Workbench Tools navi}} that automagically adds the /{{PAGELANGUAGE}} to each page referenced within the template?
2. how do we use conditional mediawiki formatting to do this?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
mario52
Posts: 3217
Joined: Wed May 16, 2012 2:13 pm

Re: Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Postby mario52 » Thu Feb 06, 2020 9:55 pm

hi

adding it is possible but the translate must be done manually then one template docnav fr, it, ...

for my the + simple:

1 : master page = only english
2 : the browser translate the page in user language (as Google Chrome)
3 : the user FreeCAD translator correct the not good expression and this expression is saved in on dictionary (of this language) in the wiki

et voila

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Postby vocx » Thu Feb 06, 2020 11:13 pm

Kunda1 wrote:
Thu Feb 06, 2020 7:13 pm
...
1. can we use conditional formatting in the {{Workbench Tools navi}} that automagically adds the /{{PAGELANGUAGE}} to each page referenced within the template?
It could be done theoretically like this.

Code: Select all

{{Workbench Tools navi/{{PAGELANGUAGE}}}}
2. how do we use conditional mediawiki formatting to do this?
Maybe it can be done with the {{#if}} commands. The exact syntax needs to be checked in MediaWiki. I don't know if it would work in any page or just inside a template.
Something like this. It is basically if-then-else.

Code: Select all

{{#if:{{{{{PAGELANGUAGE}}|en}}}
    |{{Workbench Tools navi}}
    |{{Workbench Tools navi/{{PAGELANGUAGE}}}}
}}
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.
User avatar
Kunda1
Posts: 8698
Joined: Thu Jan 05, 2017 9:03 pm

Re: Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Postby Kunda1 » Sun Feb 16, 2020 2:00 pm

thanks for chiming in vocx, I haven't tested your solution

But..I did dig deeper in to the translation extension docs and found:
https://www.mediawiki.org/wiki/Help:Ext ... p_examples

Specifically:
Image

I'm going to test this soon and see if it works. If so then none of the categories or the {{Userdocnavi}}'s etc.. will need to be in translation tags

Edit: It works!!! 8-) See Import_Export and it's translation pages
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Mediawiki 'Magic Words' in FC wiki (was: Broken Docnav template ?)

Postby vocx » Sun Feb 16, 2020 4:49 pm

Kunda1 wrote:
Sun Feb 16, 2020 2:00 pm
...
But..I did dig deeper in to the translation extension docs and found:...
Nice. By the way, I'm not sure if the wiki was already moved to the new servers.

I am wondering because that would mean more control over the types of extensions that could be installed, and the entire wiki configuration. Also, it would solve, I think, the problem of locked pages that we've had when they are moved.
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.