[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
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

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

Post by Evgeniy »

kaktus wrote: Wed Aug 25, 2021 2:13 pm Then the English version can be displayed ...
Then everything is ok.
User avatar
Roy_043
Veteran
Posts: 8578
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

kaktus wrote: Wed Aug 25, 2021 2:13 pm Then the English version can be displayed ...
Yes that is how the system work. I never really thought about this until now. We are using it only for the categories at the bottom of the page, but {{#translation:}} can be used anywhere.

{{Docnav{{#translation:}} }}
{{GuiCommand{{#translation:}} }}

See also here:
https://forum.freecadweb.org/viewtopic. ... 17#p527617
User avatar
Roy_043
Veteran
Posts: 8578
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

To use a Top template the Wiki code would look like this I suppose:
</translate>{{Top{{#translation:}}}}<translate>
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: Thu Aug 26, 2021 11:05 am To use a Top template the Wiki code would look like this I suppose:
</translate>{{Top{{#translation:}}}}<translate>
I understand that this will be converted to:

{{Top/en}}
{{Top/ru}}
{{Top/it}}
etc...?

It is quite good.
When the english variant of template is be complete, I will make a translation into my own language.

And needs to update at least one page with a new template for check how it works.
User avatar
kaktus
Veteran
Posts: 1186
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

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

Post by kaktus »

Evgeniy wrote: Thu Aug 26, 2021 11:14 am ...

{{Top/en}}
{{Top/ru}}
{{Top/it}}
etc...?

...
no no no ...
The syntax must be as Roy wrote.
Everything happens "automatically".
;)
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: Thu Aug 26, 2021 11:05 am To use a Top template the Wiki code would look like this I suppose:
</translate>{{Top{{#translation:}}}}<translate>
Ok. Then then show what is in result.
User avatar
Roy_043
Veteran
Posts: 8578
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

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.

The code to use is:

Code: Select all

</translate>{{Top}}<translate>

If you replace [[#top|top]] you should also remove the translation tag above it:

Code: Select all

<!--T:nn-->
[[#top|top]]
Becomes:

Code: Select all

</translate>{{Top}}<translate>
User avatar
kaktus
Veteran
Posts: 1186
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

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

Post by kaktus »

Roy_043 wrote: Fri Aug 27, 2021 11:24 am
...

Code: Select all

</translate>{{Top}}<translate>
:mrgreen:

It works perfectly.

8-)


Edit:
It would be good to improve the description on the page. https://wiki.freecadweb.org/WikiPages#Links
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
Roy_043
Veteran
Posts: 8578
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

kaktus wrote: Sat Aug 28, 2021 6:06 am to improve the description
What do you miss in this text?:

To link to the top of the page you can use:
</translate>{{Top}}<translate>
User avatar
kaktus
Veteran
Posts: 1186
Joined: Sun Aug 11, 2019 11:59 am
Location: opolskie
Contact:

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

Post by kaktus »

I'll explain,
at https://wiki.freecadweb.org/WikiPages
we have a prepared description for writers and translators, with templates and with examples of their use.

We have a new version of one template, so it's worth writing about, the syntax of how to use it has changed. :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".
Post Reply