commit | dd5d8a1eab936ac5d5ba55349b2cff3835043774 | [log] [tgz] |
---|---|---|
author | Translation updater bot <l10n-bot@translatewiki.net> | Mon Jul 01 09:24:56 2024 +0200 |
committer | Translation updater bot <l10n-bot@translatewiki.net> | Mon Jul 01 09:24:56 2024 +0200 |
tree | 860b0ddae38d9921d48642d2e880718a80333999 | |
parent | ff88224d969676611c8f6591b66c30a3a78c78d0 [diff] |
Localisation updates from https://translatewiki.net. Change-Id: I9a17fcbb5fbed62cd6857e09bb616ff43e094c53
This extension is a part of the Community configuration 2.0 project of the Wikimedia Foundation's Growth team. It backs Community configuration itself and is accompanied by the CommunityConfigurationExample as an example usage of Community configuration in a feature.
An end to end setup of Community configuration depends on three components:
CommunityConfiguration
CommunityConfigurationExample
To set up Community configuration 2.0, please follow those instructions:
# clone the necessary extensions core $ git clone https://gitlab.wikimedia.org/repos/growth/community-configuration-example extensions/CommunityConfigurationExample core $ git clone https://gitlab.wikimedia.org/repos/growth/community-configuration extensions/CommunityConfiguration # enable extensions in LocalSettings.php core $ echo "wfLoadExtensions( ['CommunityConfiguration', 'CommunityConfigurationExample' ] );" >> LocalSettings.php
Once done, you should be able to access CommunityConfiguration from Special:CommunityConfigurationExample
. Interacting with the Community configuration interface should be also working:
core $ php maintenance/run.php shell > $config = \MediaWiki\MediaWikiServices::getInstance()->get('CommunityConfiguration.ProviderFactory')->newProvider('static-example')->loadValidConfiguration() = StatusValue {#5739 +value: [ "wgFooBar" => 42, ], +success: [], +successCount: 0, +failCount: 0, } > $config->isOK() = true > $config->getValue() = [ "wgFooBar" => 42, ] >
For a given JSON schema defintion, eg: community-configuration-example/src/Schemas/schema_draft-07.json
core $ php maintenance/run.php shell > $provider = \MediaWiki\MediaWikiServices::getInstance()->get('CommunityConfiguration.ProviderFactory')->newProvider('FooBar'); = MediaWiki\Extension\CommunityConfiguration\Provider\DataConfigurationProvider {#5696} > $provider->getValidator()->validate( [ 'FooBar' => 1 ] )->isOk(); = false > $provider->getValidator()->validate( [ 'FooBar' => 1 ] )->getErrors(); = [ [ "type" => "error", "message" => "communityconfiguration-schema-validation-error", "params" => [ "/FooBar", "The data (integer) must match the type: string", Opis\JsonSchema\Errors\ValidationError {#6802}, ], ], ] >