Skip to content

getNamespaceBaseLanguage should be replaced with getPageLanguage #3

Open
@DankRank

Description

@DankRank

Similar code exists in our Translate fork, but upstream now uses getPageLanguage, so it makes more sense to just set up a PageContentLanguage hook in our LocalSettings like so:

$wgHooks['PageContentLanguage'][] = function( Title $title, &$pageLang, $userLang ) {
    global $wgLanguageCode;
    $pageLang = Language::factory( $title->getNamespace() !== NS_MAIN ? $wgLanguageCode : 'ja' );
}

Should probably not run this hook when Translate's own hook is activated (in_array( $namespace, $wgTranslateMessageNamespaces );)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions