Topic on Extension talk:Translate

Setting default priority languages

5
Derf Jagged (talkcontribs)

I have a wiki that I'd like to gather a couple groups of people to translate to Spanish and Japanese specifically. Is there a setting in the config I can use to limit it so the only available languages to translate to are Japanese and Spanish?

Essentially, I am looking for a way to enforce "Prevent translations to languages other than the priority languages" at a site-wide level or at least make it the default option for when you mark a page for translation.

Nikerabbit (talkcontribs)

Putting this in your LocalSettings.php may work (haven't tested):

$wgHooks['TranslateSupportedLanguages'][] = static function( &$list ) {
    $list = array_intersect_key( $list, [ 'es' => true, 'ja' => true ] );
};
Derf Jagged (talkcontribs)

That worked! Though I also added 'en' to the list, otherwise it has a little warning about 'en' not being a valid language (though it will do this for anyone who has their language set to something not in the list).

It does still show "Message Documentation" which would be nice to hide (tried 'qqq' => false, no luck). But this still miles better for my purposes.

Thank you!!!

Nikerabbit (talkcontribs)

You should be able to set $wgTranslateDocumentationLanguageCode = false; in your LocalSettings.php to completely disable message documentation.

Derf Jagged (talkcontribs)

Ah, I didn't understand the purpose of that from the config page. Makes sense now, thank you!

Reply to "Setting default priority languages"