[In progress] Autotranslate Template for [[#top|top]]

Discussions about the wiki documentation of FreeCAD and its translation.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Autotranslate Template for [[#top|top]]

Post by Roy_043 »

Yes, The text in my previous was already added to that page. Why do think this is not enough?
User avatar
kaktus
Veteran
Posts: 1174
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

Re: Autotranslate Template for [[#top|top]]

Post by kaktus »

Maybe it is worth to add information, that template will insert proper text in supported languages without any additional intervention.

Someone may proceed "automatically" and apply it as written:
{{top|"top"}}
which is unnecessary because you have automated this template nicely. :P
Twórca polskiej wersji Wiki dla FreeCAD, współwórca polskiej wersji GUI.
"Cierpliwym być musisz, by wiedzę zgłębiać tajemną, gdyż ciemna strona mocy niszczącą i silną jest".
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: Autotranslate Template for [[#top|top]]

Post by Evgeniy »

Roy_043 wrote: Fri Aug 27, 2021 11:24 am I was able to create a single template for all languages:
https://wiki.freecadweb.org/Template:Top

You can check if the Russian text is OK.
I test it there:

https://wiki.freecadweb.org/Special:ExpandTemplates

All works fine.

tags <p> </p> is sure needs?

and i look template inside
Why top from capital letter?
Previously, it seemed to be with a small one...

We can try to make an experiment on tag integration. For example, on this pages:

https://wiki.freecadweb.org/Path_FAQ
https://wiki.freecadweb.org/Python_scripting_tutorial
https://wiki.freecadweb.org/PySide
https://wiki.freecadweb.org/Mesh_Scripting

Probably after integration, needs to somehow delete unused translations to free up wikipedia's memory.

What about add squre brackets around top link in template? [top] to highlight this link.
Or this is bad idea?
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [In progress] Autotranslate Template for [[#top|top]]

Post by Roy_043 »

Evgeniy wrote: Sat Aug 28, 2021 7:09 pm tags <p> </p> is sure needs?
It is necessary if you put the wiki code on a single line:

Code: Select all

</translate>{{Top}}<translate>
But not if you do this:

Code: Select all

</translate>
{{Top}}
<translate>
Since I wanted to allow for both situations I have decided to add these tags.

There is already a page where I have tested the template:
Topological_data_scripting
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [In progress] Autotranslate Template for [[#top|top]]

Post by Roy_043 »

Evgeniy wrote: Sat Aug 28, 2021 7:09 pm What about add squre brackets around top link in template? [top] to highlight this link.
Or this is bad idea?
Square brackets have a specific function in wiki code. So, yes, this is a bad idea. :mrgreen:
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: [In progress] Autotranslate Template for [[#top|top]]

Post by Evgeniy »

Roy_043 wrote: Sun Aug 29, 2021 7:54 am
Evgeniy wrote: Sat Aug 28, 2021 7:09 pm What about add squre brackets around top link in template? [top] to highlight this link.
Or this is bad idea?
Square brackets have a specific function in wiki code. So, yes, this is a bad idea. :mrgreen:
What about &#91; &#93; ?

Code: Select all

<p>&#91;[[#top|{{#switch:{{#translation:}}
|/bg=Top
|/cs=Top
...
|/zh-hant=Top
|/zh-tw=Top
|Top}}]]&#93;</p><noinclude>
https://wiki.freecadweb.org/Topological ... ing/ru#top
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: [In progress] Autotranslate Template for [[#top|top]]

Post by Evgeniy »

Roy_043 wrote: Sun Aug 29, 2021 7:52 am There is already a page where I have tested the template:
Topological_data_scripting
The number of top tags in this page is excessive. In a simple example of creating a slot form, as seven times...
User avatar
kaktus
Veteran
Posts: 1174
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

Re: [In progress] Autotranslate Template for [[#top|top]]

Post by kaktus »

Evgeniy wrote: Sun Aug 29, 2021 8:47 am
...

What about &#91; &#93; ?

...
Evgeniy, I would like to ask you to clarify this for me.
What is the purpose of the control characters, or can you provide a document with a specification to refer to :?:
Twórca polskiej wersji Wiki dla FreeCAD, współwórca polskiej wersji GUI.
"Cierpliwym być musisz, by wiedzę zgłębiać tajemną, gdyż ciemna strona mocy niszczącą i silną jest".
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: [In progress] Autotranslate Template for [[#top|top]]

Post by Evgeniy »

kaktus wrote: Sun Sep 05, 2021 5:23 am Evgeniy, I would like to ask you to clarify this for me.
What is the purpose of the control characters, or can you provide a document with a specification to refer to :?:
A similar style is used in other wikis.
https://en.wikipedia.org/wiki/Template:Go_to_top
This link differs in that it does not lead to any page, but simply scrolls page to up.
Therefore, it probably makes sense to take it in brackets to highlight it.
User avatar
kaktus
Veteran
Posts: 1174
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

Re: [In progress] Autotranslate Template for [[#top|top]]

Post by kaktus »

Thank you for your answer, 8-) do you see any advantages compared to the template prepared by Roy :?:
For me Roy's template is excellent.
Twórca polskiej wersji Wiki dla FreeCAD, współwórca polskiej wersji GUI.
"Cierpliwym być musisz, by wiedzę zgłębiać tajemną, gdyż ciemna strona mocy niszczącą i silną jest".
Post Reply