Help talk:Extension:Translate

About this board

How to translate category labels

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"

Using current page language instead of Special:MyLanguage for links

C schmitz (talkcontribs)


we have been using syntax like this for links

[[Special:MyLanguage/Getting Started|<translate>[[Special:MyLanguage/Getting Started|<translate><!--T:55--> Getting Started</translate>]]</translate>]]

But the problem is that if the user clicks any link it will redirect to the user language, not the current document language. Is there a way to use something like

[[Getting Started/{{TRANSLATIONLANGUAGE}}|<translate>Getting Started</translate>]]<translate><!--T:55--> Getting Started</translate></translate>]]

I saw that with this commit it was introduced but cannot find it in the current release.

TLDR: I want easily maintainable links which automatically point to the page of the current document language, NOT user language.

Any insight would be very helpful.

Thank you in advance. C schmitz (talk) 18:36, 25 October 2021 (UTC)

Nikerabbit (talkcontribs)

{{TRANSLATIONLANGUAGE}} only works inside translation units, and is probably not what you want anyway. You can hardcode links to [[TargetPage/{{PAGELANGUAGE}}]] if you don't mind about links pointing to non-existent pages when translation is missing.

C schmitz (talkcontribs)

Thank you. It would be nice to have such an operator that, if needed, falls back to the base language, if no translation exists yet.

Reply to "Using current page language instead of Special:MyLanguage for links"
Bouzinac (talkcontribs)

Hi Someone told me that Translate does not support the various chinese languages zh-tw, etc ?

Nikerabbit (talkcontribs)

Translate supports any language. Perhaps they mean the configuration at Wikimedia wikis?

Bouzinac (talkcontribs)

Hi Tacsipacsi, could you specify examples of not working chinese with this Translate ?

Tacsipacsi (talkcontribs)

Translation into Chinese variants like zh-tw, zh-hans etc. is disabled on Special:Translate. (I don’t know if it’s a Wikimedia setting or Translate’s default setting, but it doesn’t matter either.) This is fine as long as one translates pages, since the variant selector appears on the top (and I’m pretty sure this is why the manual translation into variants is disabled). However, it doesn’t work, at least not out of the box, in templates unless they are used on such extension-translated pages. These templates may be used on pages that are translated manually, without the Translate extension (these should be converted to the extension in the long run), or may be used on non-translatable pages like talk pages or file description pages (these usually use the user interface language with the {{int:lang}} hack, and won’t be converted to the extension ever, so probably they won’t variant selectors). I’ve read about the <langconvert> parser tag, which may solve the issue if it’s built into {{TNT}} et al., but haven’t got around trying it yet. (The thing I’m worried about is that, according to the Phabricator task, it expects a variant identifier as the input variant, but {{TNT}} only knows that it’s some variant of zh.)

Reply to "Chinese"

Unaccesible page Special:SearchTranslations

Want (talkcontribs)

I have installed extension Translate from 2019-07-22 (3da1d7c). Page is in code, but Special page not accessible because wiki does not have a translation search service. What I must set for available it? Thank you – Want (talk) 12:06, 13 March 2021 (UTC)

Nikerabbit (talkcontribs)
Want (talkcontribs)

Thank you about your answer. But ElasticSearch isn't open source solution, and in addition depends on java engine. Exist any alternative for it? Want (talk) 11:53, 15 March 2021 (UTC)

Nikerabbit (talkcontribs)

The currently supported versions of ElasticSearch are open source. 7.x is not yet supported. The future is still unclear, but perhaps there will be open source fork of ElasticSearch.

It's not worth the effort for us to write a search engine ourselves. Besides, MediaWiki itself requires ElasticSearch for advanced search features.

Want (talkcontribs)

Thank you for the explanation. Want (talk) 16:29, 15 March 2021 (UTC)

Reply to "Unaccesible page Special:SearchTranslations"

Translate + VisualEditor, not working?

Lamjon (talkcontribs)

After wrap the text by "<translate>" & "</translate>" to the entire paragraph, enter edit mode,

message prompts: "You are editing a translatable page. Editing these in this editor is not yet officially supported."

MLBP version: 2021.01

Mediawiki version: 1.34.12

php version: 7.3.20

MySQL: 5.7.31

VisualEditor version: 1.35

Is it a know-problem w/o fix? my users is general clerical users, it would be difficult to persuade them to input w/o rich-text editing or MSWord-style editing

Nikerabbit (talkcontribs)
Reply to "Translate + VisualEditor, not working?"

Everytime I publish a translation the api.php returns "permissiondenied"

4 (talkcontribs)

I have all the group permissions set to true (I've even tried it with the "*" group), but everytime someone tries to publish a translation the translated text is yellow and in the browser's network tab, the api.php POST returns:

code: "permissiondenied", info: "You are not allowed to execute the action you have requested."

I'm not sure what I'm doing wrong

Nikerabbit (talkcontribs) (talkcontribs)

Yeah I have all of those entries in my LocalSettings.php. We have other extensions but I've already tried turning them off and was still getting the permissions error. The guide that I followed wanted to load a bunch of other extensions:

wfLoadExtension( 'Babel' );
wfLoadExtension( 'cldr' );
wfLoadExtension( 'CleanChanges' );
$wgCCTrailerFilter = true;
$wgCCUserFilter = false;
$wgDefaultUserOptions['usenewrc'] = 1;
wfLoadExtension( 'LocalisationUpdate' );
$wgLocalisationUpdateDirectory = "$IP/cache";
wfLoadExtension( 'Translate' );
$wgGroupPermissions['Translators']['skipcaptcha'] = true;
$wgGroupPermissions['Translators']['translate'] = true;
$wgGroupPermissions['Translators']['translate-messagereview'] = true;
$wgGroupPermissions['Translators']['translate-groupreview'] = true;
$wgGroupPermissions['Translators']['translate-import'] = true;
$wgGroupPermissions['Translators']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages

wfLoadExtension( 'UniversalLanguageSelector' );
Nikerabbit (talkcontribs)

I don't have other ideas then. Do note that MediaWiki namespace has restricted editing.

Reply to "Everytime I publish a translation the api.php returns "permissiondenied""

How to move a translated subpage?

Born2bgratis (talkcontribs)

My use case: somebody used the wrong language code, “zh-hans”, to translate a page. I need to move that to “zh-cn”. The documentation doesn’t cover that case.

Born2bgratis (talkcontribs)

OK, the way I did it is, I moved (without leaving a redirect) all of the translation-unit subpages, one by one (there can be hundreds!) and deleted the translated page with the wrong code. Then, in order to nod the Translate extension to refresh, I made a trivial edit to one of the newly moved translation units. This created a new translated page at zh-cn; however, the page has none of the history of the previous page, and the extension doesn’t allow me to restore the history entries neither by using Special:MergeHistory or by manually restoring entries. Yet another one of this extension’s many grave defects.

Nikerabbit (talkcontribs)

You could have unmarked the page for translation and moved the translation page as well.

But why is the lack of history of the translation page a grave defect?

Reply to "How to move a translated subpage?"
Nstrole (talkcontribs)

In an effort to minimize the number of modifications made to a page marked for translation on my wiki, I started deleting pages and then recreating them with updated content. We are still in draft mode on our wiki, so I figured deleting pages would be the cleanest way to make sure the source text and translations were up to date. I have also found that editing a page marked for translation creates multiple versions of that page in the category pages ("[pagename]," "[pagename]/en," "[pagename]/fr," etc.). Deleting and recreating these pages seemed to be the best way to prevent these problems from happening.

However, hours (or even days) after recreating and marking for translation pages that have been deleted, FuzzyBot deletes the pages again. Should I have not deleted these pages in the first place? Is there a better way to go about editing a page marked for translation without causing the errors recounted above? To prevent FuzzyBot from deleting the pages again, should I restore the original pages I deleted and then edit them?

Thank you for any advice you can give!

Martin Urbanec (talkcontribs)

FuzzyBot automatically manages translation pages, and the best thing to do is to leave FuzzyBot to do its work and not touch translation-related pages manually. FuzzyBot relies at the job queue – if you feel it takes a lot of time to FuzzyBot to delete pages, once you perform an action as a translation administrator, it's possible that the job queue is being slow for your wiki

Reply to "FuzzyBot Deleting Pages"

Disable Edit/Create Source but Enable Translate

Summary by Nstrole

I was able to prevent translators from editing the source text by protecting that page and only allowing administrators to edit it. I did not try this before because I thought protecting the source text would, in turn, protect the translations and prevent translators from publishing translations. But I was able to protect the source text and still allow translators to publish translations.

Nstrole (talkcontribs)

I would like to disable users from editing the source text for all pages in my wiki but still allow them to publish translations. Whenever I add $wgGroupPermissions['user']['edit'] = false; to Local Settings.php and $wgGroupPermissions['user']['translate'] = true; it comes up with the error "Publishing the translation failed: The action you have requested is limited to users in the group: Administrators." Is there any way to allow translators to publish translations without allowing them to edit the source text of a page?

Thanks in advance for any help you can provide!

Nikerabbit (talkcontribs)

I would simply use the protect feature to protect the source pages.

Another option would be to restrict editing using $wgNamespaceProtection in namespaces other than Translations:.

Nstrole (talkcontribs)

The protect feature did the job. Thank you so much!

How to split a page into two and keep the translations for the "new" page?

AKlapper (WMF) (talkcontribs)

As part of phab:T250700 I am thinking of moving the section How_to_become_a_MediaWiki_hacker#Communication_tips_and_guidelines (which is simply not a "MediaWiki only" thing, so it's at the wrong place) to a better place, probably New_Developers/Communication_guidelines. And after that, transclude that page into several pages.

How can I take all and any existing 25 translations for those strings that are part of that section with me?

Stuff like Help:Extension:Translate/Move_translatable_page only explains moving a complete page, but here I'm after splitting.

Any best practices documented somewhere?

Thanks in advance!

Nikerabbit (talkcontribs)

I am afraid there is no support/help for this use case currently. Basically you need to move the relevant source language parts to the new page (keeping the existing ID markers if you wish), mark it for translation and then copy over each translation. Last part can probably be automated with pywikibot or similar and a bit of scripting.

Reply to "How to split a page into two and keep the translations for the "new" page?"
Return to "Extension:Translate" page.