Help talk:Extension:Translate

Jump to: navigation, search

About this board

Lyrixn (talkcontribs)

On a wiki project I'm working on, I've had an issue for a while, where Special:MyLanguage doesn't redirect properly and instead shows me someone else's version of a cached/static article.

E.g. if it's a logged out user, it shows me a static of being logged out and if I stumble upon a registered user's static, then it will display me as if I'm logged in as someone else.

Any ideas how to fix this? Because currently I'm unable to utilize Special:MyLanguage as its intended purpose. It's more of a burden, than of help.

Nikerabbit (talkcontribs)

First of all, Special:MyLanguage has been in MediaWiki core for some time. Secondly, it sounds like you have a frontend cache that is not properly configured. I've never seen MediaWiki give out pages intended for some other use.

Reply to "Requirements for Special:MyLanguage" (talkcontribs)

When we mark a page for translation it always generates the /en language which is the same as the source. Can this be switched off or is it a requirement? If the latter, please indicate this clearly in the documentation. (@Wimjongman)

Wimjongman (talkcontribs)

[22:17] <wimjongman> Does the translate module always need the /en language even if this is the source?

[22:28] <Nemo_bis> wimjongman: only if it's the source

[22:31] <wimjongman> So if english is the source I cannot block the /en generation?

[22:34] <Nemo_bis> wimjongman: with sufficient effort you might be able to break it, but are you sure you understand the consequences?

[22:34] <Nemo_bis> What are you trying to achieve?

[22:36] <wimjongman> Nemo_bis: I just want to understand if this is the intended behavior.

[22:38] <Nemo_bis> wimjongman: yes, it is

[22:39] <Nemo_bis> The subpage is needed so that all language codes are treated equally and so that a version of the page without Translate's markup is always available

[22:39] <Nemo_bis> Without the /en subpage, you would not really be able to make templates translatable, for instance. The subpages are what gets transcluded

[22:42] <wimjongman> Nemo_bis: I understand. Thanks. Another thing is that our translators have found the Special:MyLanguage tag and starting to put that in the source pages. Is that best practice?

[23:16] <Nemo_bis> wimjongman: yes, we currently have no way to redirect links to the correct page without wikitext changes

[22:46] <wimjongman> Nemo_bis: is SpecialMyLanguage needed in combination with $wgTranslatePageTranslationULS?

[23:16] <Nemo_bis> $wgTranslatePageTranslationULS only works for the first click

Nikerabbit (talkcontribs)

It is not possible to switch this off with configuration. The existence of such pages is mentioned in Help:Extension:Translate/Page translation administration

Reply to "Do we always need /en"

Is it possible to disable the split in units?

ClemFlip (talkcontribs)

Hi Friends,

I'd like to know if it's possible to disable the auto split in units?

When the page is mark for translation, the system will insert tags like inside the wiki-text.

I'd like to avoid that, so that the entire text inside the <Translate> tag will be translated in one string (Even if there is a hard return inside the <Translate>).

I hope I am clear. Thanks a lot for your help.

Quiddity (WMF) (talkcontribs)

Hi. Could you give us a link to the page you're working on, so that we can understand the use-case/problem you're trying to solve?

And/or, paste the content (or similar) into a sandbox? (Feel free to use User:Quiddity (WMF)/sandboxtranslation).

ClemFlip (talkcontribs)

Hi @Quiddity (WMF), thanks for your quick reply.

Unfortunatly, I can't share a link with you since I am working on a local environment.

However, on the sandbox, if you switch to the wikitext edit mode:

You can see that






,... have been inserted inside the wikitext to split all the content inside <translate> and </translate> into translatable strings (Witch is fine).

However, on my wiki, when I switch to the VE edit mode, I see little grey mark that looks like !T:2 in lieu of the


tag (witch is not very convenient for the user).

On the sandbow, however, those little marks don't seems to show up. Is it something that as been solved in a new version of VE maybe?


Another question, is their a way to simply disable the auto split? (so disable the fact that the extension automatically insert






into the wiki-text)

Thanks a lot.

Quiddity (WMF) (talkcontribs)

Re: Visual editor - no, I'm afraid that editor does not currently support Extension:Translate (which is an old and complicated extension).

Re: merging all "translatable units" into a single unit - I don't think so, beyond using <br> at the end of every line. (Which I strongly advise against) -- The extension is designed to make it easy for various people to do "little bits, one at a time" (So if they get bored or busy, halfway through the work, then at least some of the page is translated); therefor, to have "multiple paragraphs all in a single translation unit" isn't possible (as far as I know, and I cannot think of any other hacks/workarounds to make it do that). Sorry, but hope that helps.

Reply to "Is it possible to disable the split in units?"
Tuxxic (talkcontribs)


I am using Special:ImportTranslations to import .po translations from offline translators.

When I import them, I can "Execute" (see screenshot)

But when I go to my page, the translations are not taken into account.

What do I do wrong ?

StefanN91 (talkcontribs)

Hey there,

@Tuxxic the same thing is happening in my wiki setup. It would be realy nice if you could share your solution to us.

Did you already solved this Problem??? I realy need to now.

Tuxxic (talkcontribs)

Hi @StefanN91, what I did was importing the .po files manually, by using Translate/script/poimport.php script, mentioned here:

I know it's not optimal, but it did the job. I am still waiting for help on the special page, too, since I can't access my web server freely ...

StefanN91 (talkcontribs)

Thanks for your help. I'm going to use the poimport.php script and see if I works.

Do you know if someone is working on that problem?

Tuxxic (talkcontribs)

No, I don't, but feel free to open a bug on :)

StefanN91 (talkcontribs)

Looks like the bug is known and already solved.

I used this patch and it realy worked.

Be careful, the last added version caused a different bug in my version. Couldn't change translation Language.

Good luck ;)

Tuxxic (talkcontribs)

Aha ! Thanks for help, we get closer to the perfection as patches are put !

Reply to "Can't import .po files on my setup"

Automatically switch to reader's preferred language if it is available.

Mjamesderocher (talkcontribs)


I want the page to automatically show the translation for the user's selected laguage if the page is available in that language. I see that on the Extension:Translate page, if I switch my language to Spanish, then it automatically loads the Spanish translation of the page, but on my site it does not do the same thing.

Is there a setting that I need to change?

Nikerabbit (talkcontribs)

Yes there is. It is called $wgTranslatePageTranslationULS.

Reply to "Automatically switch to reader's preferred language if it is available."

How can I make <languages /> appear in MediaWiki:Sitenotice?

JamesPoulson (talkcontribs)

The idea is to have the languages links appear on all pages.

If you have any alternative suggestions then I'm interested.

Nikerabbit (talkcontribs)

Not possible with Translate extension. The sitenotice does not know which translations exist. I am not sure it even knows which page it is displayed on, but if it does, you could make your own template that mimics the look of the language box.

Reply to "How can I make <languages /> appear in MediaWiki:Sitenotice?"
Kghbln (talkcontribs)

Hmm... which page is canonical for e.g. search engines. I have an English language source page and an English language subpage with /en. Well this does not just apply to search engines: Which English language page is supposed to be served to users?

Nikerabbit (talkcontribs)

Currently, the /en (or whatever is the source language) is only there to be used for transclusions (Template:TNT for example).

Kghbln (talkcontribs)

Well all languages should be treated equally so the /language code pages are the once to be served to the audience. Still not sure what search engines like Google make of it and what this means for sitemaps

Kghbln (talkcontribs)

Ah, did not see Nike's post.

Reply to "Canonical page for source language"
Kghbln (talkcontribs)

I have this on my page:


and I get


does help at all since the result is the same as above. However since I cannot expect English speaking people to know what "Beispiele" means the only way is seems to label the category.

This may be a noob question. I am sure there is a way but I currently do not get it. This example does not cover it so I am a bit lost.

Nikerabbit (talkcontribs)

Currently, as far as I know, MediaWiki does not support changing category names from what they actually are. There is a task requesting to support this: task T26139.

Tuxxic (talkcontribs)

@Nikerabbit : has plans changed on this task by any chance ? Because in fact this is what I request in my comment below.

Nikerabbit (talkcontribs)

I am not sure why you are asking me. My priorities are currently elsewhere.

Tuxxic (talkcontribs)

Sorry, I did ask because I thought you were in charge of this task.

I will wait to see it resolved or - better! - try to solve it myself when I get familiar with MediaWiki code.

Anyway you are always of good advice, and you helped me a lot. Thank you !

Kghbln (talkcontribs)

Ouch, admittedly I have never labeled a category differently. I took it for granted that this is possible. I guess this will be a nice feature with regard to content translation. Thanks a lot for pointing to the issue.

Andreas Plank (talkcontribs)

Just an idea: one could try to transclude the translated content of the page display title of the corresponding Translation name space page:

{{#ifexist: {{Translations:Kategorie:Beispiel/Page display title{{#translation:}}}}<!-- 
then transclucde content via {{…}}
-->|{{Translations:Kategorie:Beispiel/Page display title{{#translation:}}}}<!-- 

… or in general with the magic word {{FULLPAGENAME}}:

{{#ifexist: {{Translations:{{FULLPAGENAME}}/Page display title{{#translation:}}}}<!-- 
then-->|{{Translations:{{FULLPAGENAME}}/Page display title{{#translation:}}}}<!-- 
Andreas Plank (talkcontribs)

I just realized (for the record so to say) that the page I’m testing in #ifexist: must be coded correctly as Translations:… and not as page transclusion {{Translations:…}}:

{{#ifexist: Translations:{{FULLPAGENAME}}/Page display title{{translation:}}<!-- 
then -->|{{Translations:{{FULLPAGENAME}}/Page display title{{translation:}}}}<!-- 
else -->|{{FULLPAGENAME}}
Kghbln (talkcontribs)

Thanks for your suggestion. The idea I came up with is to do

<translate>Categories:</translate> [[:Category:General{{#translation:}}|<translate>General</translate>]]


and add the HIDDENCAT behaviour switch to "Category:General{{#translation:}}". This is a bit of work depending on how many categories there are as well as make the display of the category link [[:Category:General{{#translation:}}|<translate>General</translate>]] appear as if the added category was never hidden but I quite like it.

Tuxxic (talkcontribs)


I came upon this help topic and it helped a lot.

I need to do a slightly different thing than @Kghbln : my goal is to have the translated category name, but point it to the translated link

Like "Catégorie:Blanc" displays "Catégorie:White" but points to "Catégorie:Blanc/en"

Reply to "How to translate category labels"

Is it possible to hide category pages not in my current language ?

Tuxxic (talkcontribs)


I am using Translate to translate my category pages, therefore there are many pages added to them.

My goal is to display on my category page only the pages containing the language code I am using, for instance "Page title/en" should only be displayed on English version of my category page.

Is it possible to do it ?

Nikerabbit (talkcontribs)

You can leave the category inside <translate> tags and change it in translations. Or you can leave it outside <translate> tags and use something like [[Category:Name{{#translation}}]] magic word to automatically append language code of the translation page (and none for source page).

Tuxxic (talkcontribs)

For people who would read this as a means of help, the right tag to use is {{#translation:}} (see )

Thanks a lot @Nikerabbit

Tuxxic (talkcontribs)

Thanks, but how can I display translated page name instead of Name/en ? Is it possible using MsCatselect, another plugin I use for selecting categories ?

I want to use MsCatSelect to do category selection, so I put the categories out of <translate> tags.

I have so many questions lately, sorry @Nikerabbit, maybe one day I will help you with the code :)

Nikerabbit (talkcontribs)

At the moment it's not possible in MediaWiki core to display translated page names in category listings.

Tuxxic (talkcontribs)

OK, I can stop searching :) Thanks for advice !

This post was hidden by Tuxxic (history)
Reply to "Is it possible to hide category pages not in my current language ?"

How can I add "Special:MyLanguage" on all category links ?

Tuxxic (talkcontribs)


I am searching to add "Special:MyLanguage" in front of all my category links. I know I have to hook some functions, I searched and it seems that Manual:Hooks/OutputPageMakeCategoryLinks can be a good candidate to modify those links.

Can you please help me on writing a hook I can add to my LocalSettings.php ?

Thanks in advance.

Reply to "How can I add "Special:MyLanguage" on all category links ?"