[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Info request on new Wiki translations - any automatic handling of translation headers and translated pages?



On Fri, 2025-08-08 at 17:15 +0100, Andrew Sayers wrote:
> On Fri, Aug 08, 2025 at 08:56:06PM +0800, Maytham Alsudany wrote:
> > On Fri, 2025-08-08 at 12:15 +0200, Beatrice Torracca wrote:
> > > Hi all,
> > > 
> > > sorry if this is been discussed elsewhere. I gave a look at the new test 
> > > wiki at wiki2025.debian.org and I wasn't able to find a dummy translated 
> > > page to have an idea.
> > > 
> > > Is there a more "automatic" way in which translations will be handled by 
> > > the new wiki. Especially considering that, in the current one, the 
> > > translation header at the top has to be maintained manually both for the 
> > > English master page and the translations (though for that we created the 
> > > work around of including the header from the master page). I think there 
> > > is, if I look at Wikipedia for instance.
> > 
> > https://www.mediawiki.org/wiki/Extension:Translate
> > Not installed yet but we plan to set this up.
> 
> I haven't tried that extension before, but from the documentation I don't see a
> way to e.g. create a "translations" header automatically.  Here's a potential
> solution - [0] and [1] show translated versions of a page,
> [2] will automatically gain a header if someone creates [3].
[...]

It's not immediately obvious from the documentation, but it does support
adding translation headers with the <languages /> tag.
https://www.mediawiki.org/wiki/Help:Extension:Translate#:~:text=In%20addition%20you%20can%20easily%20add%20a%20language%20bar%20with%20the%20%E2%80%8E%3Clanguages%20/%3E%20tag
You'll see on the source of MediaWiki wiki pages that they have this tag
at the top.

> > > What about links inside a page, would there be an automated way to 
> > > create links to translated pages.
> > > What I mean is, right now when there is a (interwiki)link in a page, a 
> > > translator (at least me, I hope I was not missing some obvious feature) 
> > > has to check if there is a translated page for that link and point the 
> > > link there or otherwise point to the English page. Will there be an 
> > > automated way in which the Wiki knows if there is a translated version 
> > > of a page and points there if there is, or automatically defaults to 
> > > English if there is not?
> > 
> > I believe the current solution that is used on all the other wikis is
> > prefixing every URL with "/Special:MyLanguage/". Most of the time, this
> > is hidden away behind a template that adds the prefix for you.
> 
> That's a good idea.  I've put together a possible implementation at [7],
> which tries /Special:MyLanguage/, then the language for the current page,
> then finally English.  We could add some logic around e.g. pt_BR -> pt_PT
> translations some day, but it's probably best to wait until requested
> (zh_HK -> zh_CN translations may not be appreciated!)
> 
> Again, a better name than "Lang" would be welcome :)

The name that MW use is "ll" (for "localized link"). Result:
{{ll|MyPage}} or {{ll|MyPage|anchor text}}.
See also: https://www.mediawiki.org/wiki/Template:Localized_link
("ll" can be used because Template:Ll redirects to this.)

--
Maytham

> [0] https://wiki2025.debian.org/wiki/ExampleForTranslation
> [1] https://wiki2025.debian.org/wiki/It/ExampleForTranslation
> [2] https://wiki2025.debian.org/wiki/ExampleForProposedMerge
> [3] https://wiki2025.debian.org/wiki/It/ExampleForProposedMerge
> [4] https://wiki2025.debian.org/wiki/Template:PageHeader
> [5] https://wiki2025.debian.org/wiki/Template:TranslationList
> [6] https://wiki2025.debian.org/wiki/Category:LanguageMachinery
> [7] https://wiki2025.debian.org/wiki/Template:Lang

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: