Jump to content

Help talk:Extension:Translate

About this board

Please enable subcategorizing translated pages on Commons

2
Summary by Prototyperspective

Solution was given via Translator's noticeboard: just reformat the categories on the base-page (not any of the translated pages) from [[Category:CatName]] to [[Category:CatName{{#if:{{#translation:}}|/Translations}}]]

Prototyperspective (talkcontribs)
Nikerabbit (talkcontribs)

How to translate category labels

10
Kghbln (talkcontribs)

I have this on my page:

[[Kategorie:Beispiele{{#translation:}}|Beispiele]]

and I get

[[Kategorie:Beispiele/en]]
[[Kategorie:Beispiele{{#translation:}}|<translate>Beispiele</translate>]]

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:}}}}<!-- 
else
-->|Kategorie:Beispiel{{#translation:}}
}}

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

{{#ifexist: {{Translations:{{FULLPAGENAME}}/Page display title{{#translation:}}}}<!-- 
then-->|{{Translations:{{FULLPAGENAME}}/Page display title{{#translation:}}}}<!-- 
else-->|{{FULLPAGENAME}}{{#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>]]

[[Category:General{{|translation:}}]]

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)

Hi,

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"

After update MW 1.35 -> 1.42 translation editor is not displayed..

3
2A02:810D:6040:64A:96A:ACCF:4337:2214 (talkcontribs)

Hi, today I've updated my wiki and all the extensions. Everything is wokring so far. But when clicking on translate button for a site, it will only show an empty section. I.e. clicking

2A02:810D:6040:64A:96A:ACCF:4337:2214 (talkcontribs)

translate on the page "Manuals:Test" will lead to ".../index.php?title=Special:Translate&group=page-Manuals%3ATest&action=page&filter=".

Here it only shows "Translate to German" (I'm from Germany). But the editor to translate is missing. Also I can't select any other language to translate to. As far as I can remember I could select any language before.

The above buttons also work, I can view the translation stats. Here all my sites are shown as translated.

What is missing here? Checking the debug log and console did not give me any clue. Please help, thanks!!

Tacsipacsi (talkcontribs)

It sounds much like a JavaScript problem. Maybe the upgrade coincided with you disabling JavaScript (using NoScript, browser preferences etc.)? Or there is some JavaScript error on the browser console? If your wiki is publicly available, it would make debugging a lot easier if you could share its URL.

Reply to "After update MW 1.35 -> 1.42 translation editor is not displayed.."
Truemib (talkcontribs)

Hey,


Is it not possible to translate Sidebar without ULS?

Reply to "Sidebars"
193.91.164.56 (talkcontribs)

I have a page called "Resources", English version of it works fine, but any translated not,

I believe it's because resources is one of the folders in mediawiki engine, and when that page gets translated, it changes to /wiki/Resources/de


Is there any solution for this, how to fix that in .htaccess? Or renaming the page is the only way?

193.91.164.56 (talkcontribs)

fixed

Reply to "Page named Resources"

Integrating English Articles with Polish URLs in MediaWiki

2
Jacekpoleszak (talkcontribs)

I'm managing a MediaWiki site with Polish as the primary language. However, we occasionally receive content in English that needs to be incorporated seamlessly into our site, including adopting Polish page titles/URLs without the "/pl" suffix typically used for translated content. For example, I wish to translate the title "My new page" from English to Polish and use it as the main content, ensuring the URL reflects the Polish version without indicating it's a translation. Our site primarily translates content from English (or Spanish) to Polish, displaying it in Polish by default. I'm looking for advice on how to manually mark these articles for translation and adjust their URLs to blend with our Polish content. Any suggestions on setting this up efficiently would be greatly appreciated.

Nikerabbit (talkcontribs)

That's not supported by the Translate extension because general solution is not possible due to naming conflicts. You can create redirects manually.

Reply to "Integrating English Articles with Polish URLs in MediaWiki"

Hide "Translate this page" link, or protect translations of page?

2
Summary by PKFP

Thanks for the reply. I guess I just found a good solution. I just edited the source code of the Main Page to: <languages/><translate><!--T:2--> <!--If you want to edit or translate the Main Page you have to edit or translate the sub-templates of Template:Main_Page--></translate>{{Main Page}} So editors and translators both get the hint.

PKFP (talkcontribs)

Hi, Our main page has the following source code: <languages/><translate></translate>{{Main Page}}. So there is nothing to edit or translate (except the title "Main Page") and people should edit or translate the template instead. Is there a possibility to hide the "Translate this page" link, so I can replace it with a link to the Template? Thanks.

Tacsipacsi (talkcontribs)

I don’t think there’s an officially supported solution for that, but I don’t think it makes sense either. You should decide whether you want the page to be translatable: if yes, the link shouldn’t be hidden; if no, the page shouldn’t be marked for translation. If nothing except for the title is translatable, then there is something that’s translatable: the title.

You have some options:

  • (Supported and IMO best solution) Merge the template into the main page
  • (Supported) Keep the link for translating the main page, add a link in wikitext to Special:Translate/page-Template:Main Page
  • (Unsupported, I recommend against it) Add the link in wikitext and hide the link for translating the main page itself using the CSS .mw-pt-translate-header { display: none; }

Am I the only one who thinks this sucks?

4
Manifestation (talkcontribs)

I just expanded the Setup section of FlaggedRevs, an extension that gave me lots of problems that could have been prevented with proper instructions.

I was taken aback by these <translate> tags. I did the best I could, but I have no idea if I broke something or did something wrong. Is this really the best way to make MediaWiki multilingual?

Nikerabbit (talkcontribs)
Manifestation (talkcontribs)

Thanks. User:Shirayuki has altered my edit and made it compatible with the translation system... I think.

I honestly have no idea how this convoluted system works. I can't make heads or tails of it. For example, what are these <!--T:[number]--> markers?

Nikerabbit (talkcontribs)
Reply to "Am I the only one who thinks this sucks?"

Importing translation content

2
MarblehorseNet (talkcontribs)

I manage an English wiki with 7,000 pages written in English. To enhance its bilingual nature, I've generated machine translations for all those pages. These translations are stored in text files located in separate subdirectories like "/translations/es" and "/translations/fr".

Right now whenever I import my text files into MediaWiki I use Manual:ImportTextFiles.php/, is there a certain namespace or formatting that I have to use to upload the translations?

Is there a way I can easily import these pages into the Translate Extension?

MarblehorseNet (talkcontribs)
Reply to "Importing translation content"

Do we always need /en

4
213.127.250.211 (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)
109.181.53.25 (talkcontribs)

Is there a way to stop the source language pages appearing in search results?


We end up with two sets of search results for the page in the source language, one with /en, and one without.

Reply to "Do we always need /en"