Santhosh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71328
Change subject: Remove namespace parameter from ApiULSLocalization
......................................................................
Remove namespace parameter from ApiULSLocalization
Return messages from all known namespaces for the language
Change-Id: I3fe70108458dd5dfa6689a6d30c65f510e94b4d8
---
M api/ApiULSLocalization.php
1 file changed, 7 insertions(+), 18 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector
refs/changes/28/71328/1
diff --git a/api/ApiULSLocalization.php b/api/ApiULSLocalization.php
index 0768588..0e45c3d 100644
--- a/api/ApiULSLocalization.php
+++ b/api/ApiULSLocalization.php
@@ -29,28 +29,23 @@
$params = $this->extractRequestParams();
$language = $params['language'];
- $namespace = $params['namespace'];
if ( !Language::isValidCode( $language ) ) {
$this->dieUsage( 'Invalid language', 'invalidlanguage'
);
}
$contents = array();
// jQuery.uls localization
- if ( !$namespace || $namespace === 'uls' ) {
- $filename = __DIR__ .
"/../lib/jquery.uls/i18n/$language.json";
- if ( file_exists( $filename ) ) {
- $contents += json_decode( file_get_contents(
$filename ), true );
- }
+ $filename = __DIR__ . "/../lib/jquery.uls/i18n/$language.json";
+ if ( file_exists( $filename ) ) {
+ $contents += json_decode( file_get_contents( $filename
), true );
}
// mediaWiki.uls localization
- if ( !$namespace || $namespace === 'ext-uls' ) {
- $filename = __DIR__ . "/../i18n/$language.json";
- if ( file_exists( $filename ) ) {
- $contents += json_decode( file_get_contents(
$filename ), true );
- }
+ $filename = __DIR__ . "/../i18n/$language.json";
+ if ( file_exists( $filename ) ) {
+ $contents += json_decode( file_get_contents( $filename
), true );
}
// Output the file's contents raw
- $this->getResult()->addValue( null, 'text', json_encode(
$contents ) );
+ $this->getResult()->addValue( null, 'text', json_encode(
$contents ) );
$this->getResult()->addValue( null, 'mime', 'application/json'
);
}
@@ -68,17 +63,12 @@
ApiBase::PARAM_REQUIRED => true,
ApiBase::PARAM_TYPE => 'string',
),
- 'namespace' => array(
- ApiBase::PARAM_TYPE => 'string',
- ApiBase::PARAM_REQUIRED => false,
- ),
);
}
public function getParamDescription() {
return array(
'language' => 'Language string',
- 'namespace' => 'Namespace string. If not given loads
messages for all namespaces known',
);
}
@@ -90,7 +80,6 @@
return array(
'api.php?action=ulslocalization&language=ta',
'api.php?action=ulslocalization&language=hi',
-
'api.php?action=ulslocalization&language=or&namespace=ext-uls',
);
}
--
To view, visit https://gerrit.wikimedia.org/r/71328
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fe70108458dd5dfa6689a6d30c65f510e94b4d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits