Help talk:Extension:Translate

Jump to navigation Jump to search

About this board

Process for migrating translated pages between wikis?

Billinghurst (talkcontribs)

Can someone please explain the process to move a set of translated pages from one wiki to another? There are numbers of templates and translated pages that I wish to bring to wikimaniawiki from meta and the like. The xml import doesn't allow the writing of the Translations: ns. pages, and I cannot tell whether that is a straight permissions issue, or whether it is wanting to see pre-existing files prior to occuring. The export translations function seems to be a one translation in one language at a time process. Help pages don't seem to overtly cover this, or I am completely misunderstanding. Thanks for any direction.

Reply to "Process for migrating translated pages between wikis?"

Source page language differs from the wiki language

Axdr (talkcontribs)

Wiki language = English

Suppose there is a page LifeOfCats

Special:MyLangauge works like this:

LifeOfCats = English

LifeOfCats/fr = French

LifeOfCats/ru = Russian

If I create a page in Russian, it should obviously be LifeOfCats/ru

When I translate it into English, I want that the parent page LifeOfCats to be created. But there is no such possibility.

If I create LifeOfCats/ru and assign it the language Russian, then the translation into English produces LifeOfCats/ru/en. It is wrong. The English version must be LifeOfCats - the parent page relative to other languages. Only then will the hierarchy of translations and Special: MyLanguage work correctly

Is there an easy way to create pages with a source language different from the wiki language so that they can be translated?

Matěj Suchánek (talkcontribs)
Axdr (talkcontribs)

I solved this problem with "Shaman's Magic Tambourine".

Does it make sense to publish the algorithm here in the discussion?

Matěj Suchánek (talkcontribs)

I'm interested in what that means...

Axdr (talkcontribs)

When the source text is created in another language, there is an algorithm that will help translate it into the main language and at the same time maintain the correct page hierarchy, as well as ensure the proper operation of the Special:MyLanguage links.

Quiddity (talkcontribs)
Reply to "Source page language differs from the wiki language"

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.

Axdr (talkcontribs)

Re: 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"

How to insert a fully translated text to the place of the translated text?

Maybe there is a ready-made fully translated text. In addition, texts for different languages may differ in content and may be they are not a direct translation of one into another.

Quiddity (talkcontribs)

"texts for different languages may differ in content and may be they are not a direct translation of one into another."

This extension is generally intended for direct translations. It is primarily used for keeping multilingual copies of documentation updated.

"How to insert a fully translated text to the place of the translated text?"

Section by section.

Axdr (talkcontribs)

Probably, it is time for you to expand the idea of why a CMS exists. Not only to translate texts in it.

Where do you discuss system tasks?

Quiddity (talkcontribs)
Axdr (talkcontribs)

I think that another extension is needed, which only keeps track of whether there are language-versions of text, and by analogy of the <languages /> tag shows a switch of languages.

Quiddity (talkcontribs)

Links or examples almost always help! They can show other people what you're thinking of, or what you've found that wasn't ideal (and why), or related examples from elsewhere. Your current comments are too short and abstract for me to understand quite what you mean. Please link to or explain the specific use-case(s) that you are thinking of.

Axdr (talkcontribs)

The <languages /> tag works only when the text is translated into other languages with the Translate extension.

But in a situation where the text is not translated, but simply there are other corresponding texts in other languages, the <languages /> tag does not work. But it does need to work.

I think it would be helpful to have a tag capable of displaying a language switch for cases where the texts are not "translated section by section".

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

Multilanguage import and translate

AssetDenmark (talkcontribs)

I have a 'practical' question, but i am not sure where to put it - please direct me elsewhere if this is not the correct "talk" page…

I setup a new Wiki (V1.30) on a NAS and I want to import all of a old (V1.81) Wiki - located on a PC.

The 'source language' for the wiki is 'da' (Danish), but I want to add en' (English) as an option - so I guess that i need to prepare a bit to get that right…

I have some 2-400 Wiki pages of English text… that I want to import and then translate. For that I need to import the pages to say wiki/n1:whatever/en - but when I translate this, to 'da' ,will that then end up in \whatever\dk or will it go in \whatever… ?

Furthermore - I need to split up these pages into namespaces (like, n1:, n2:, n3:… say I will have a name space like this: wiki/n1:whatever\en

My general questions are:

  • Can I somehow import texts to land in the "correct" place...
    • wiki/n1:whatever1/en
    • wiki/n1:whatever2/en etc.

When i translate from the /en version, where will this end.. and will the Wiki work with a mix of /da, /en and <source language> pages…  what happens if there are the following page combinations at the same time:

wiki/n1:whatever1/en the english page

wiki/n1:whatever1/da page in danish

wiki/n1:whatever1 - standard name for the 'n1:whatever1' page, should also be in Danish

p.s. I did this interface to goggeltranslate at some time in the past.

Nikerabbit (talkcontribs)

I would do it like this:

  1. Import all English pages into the wiki in a way you want (no language codes in the page names)
  2. Mark them translatable
  3. "Translate" them to English by just copying the source text
  4. Translate the source text page into Danish manually
  5. Re-mark the source page for translation
  6. Mark the English translations as non-fuzzy
AssetDenmark (talkcontribs)

Naturally! Clever.. :-) - could have thought about that, but would I have.. before it was too late?

Than How do I handle the 'da' language tags - the "source languag" will be Danish, so can I simply translate to a page "without" the page name language code? Over time the wiki would probably contain a mix of no-tag, da and en - but can I do anything to prevent that from happening...

I guess I could leave out the 'da' option all together.. but will that create oher issues?

Nikerabbit (talkcontribs)

The system will create /en and /da pages for you. There will be no automatically generated links to /da, because links to that language will point to the page without language code.

Reply to "Multilanguage import and translate"

Existing translations must be moved

Perhelion (talkcontribs)

I mean this is one of the main reasons why this extension not get wider used, because there is no function to do this simple time consuming work. Normally there exist already around 20 target subpages e.q. on Commons. So it's not fun to use it. Maybe use Extension:Replace Text.

Perhelion (talkcontribs)

PS: Beside the fact we can't move any page under i18n/ if the page /i18n exists (so we must delete them first?).

EDIT: That was a very bad idea from me [[phab:T114592]] (<-- I love this flow)

Nikerabbit (talkcontribs)

It is not clear whether you mean existing non-Translate translations (for that use Special:PageMigration) or renaming pages (use the move action), but both are supported with some known issues.

Perhelion (talkcontribs)

Thanks for answer, there is a serious problem on Template:Mozilla Public License/(after moving, which was unnecessary in my opinion too). I edited the /i18n subpage again to refresh the ext.translate (bot), and now any language got overwritten with English (I guess restoring the "bot deletion" was a very bad idea). I really do not feel like re-entering each language manually. An undo of Move or something would be very good!? PS:Maybe a detailed documentation, what is going wrong here, would be good too.

PS: I trying the Special:PageMigration thing, but I got an JS error on the page (nothing happen). I guess it comes from "mediawiki.searchSuggest" (Uncaught TypeError: Cannot read property 'indexOf' of undefined)

Nikerabbit (talkcontribs)

I'll look into these errors later when I have time. Perhaps there is easy way to restore the translations.

Reply to "Existing translations must be moved"

Requirements for Special:MyLanguage

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)
Reply to "Do we always need /en"

Can't import .po files on my setup

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)
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)
StefanN91 (talkcontribs)
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?"