Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/187431
Change subject: Made mwcore-export not fail horribly
......................................................................
Made mwcore-export not fail horribly
Semi-hardcoded some file locations and fixed the missing default
paramater for lang option.
Change-Id: I805ffa2bfb9e309d20dcf355475e955aaf3f5288
---
M scripts/mwcore-export.php
1 file changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/31/187431/1
diff --git a/scripts/mwcore-export.php b/scripts/mwcore-export.php
index 668d9fb..31ce058 100644
--- a/scripts/mwcore-export.php
+++ b/scripts/mwcore-export.php
@@ -47,7 +47,7 @@
$this->error( 'Target directory is not writable.', 1 );
}
- $langs = TranslateUtils::parseLanguageCodes( $this->getOption(
'lang' ) );
+ $langs = TranslateUtils::parseLanguageCodes( $this->getOption(
'lang', '*' ) );
$group = MessageGroups::getGroup( 'core' );
$type = $this->getOption( 'type' );
@@ -89,10 +89,11 @@
$variable = preg_quote( $matches[1], '~' );
- /**
- * @var FileBasedMessageGroup $group
- */
+ /// @var FileBasedMessageGroup $group
$file = $group->getSourceFilePath( $l );
+ // bandage
+ $real = Language::getFileName( '/messages/Messages', $l
);
+ $file = preg_replace( '~/i18n/(.+)\.json$~', $real,
$file );
if ( !file_exists( $file ) ) {
$this->error( "File $file does not exist!" );
@@ -105,6 +106,7 @@
$escExport = addcslashes( $export, '\\$' ); # Darn
backreferences
$outFile = $this->getOption( 'target' ) . '/' .
$group->getTargetFilename( $l );
+ $outFile = preg_replace( '~/i18n/(.+)\.json$~', $real,
$outFile );
$count = 0;
$data = preg_replace( "~$variable\s*=.*?\n\);\n~s",
$escExport, $data, 1, $count );
--
To view, visit https://gerrit.wikimedia.org/r/187431
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I805ffa2bfb9e309d20dcf355475e955aaf3f5288
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits