https://www.mediawiki.org/wiki/Special:Code/MediaWiki/115177
Revision: 115177
Author: siebrand
Date: 2012-05-10 14:14:14 +0000 (Thu, 10 May 2012)
Log Message:
-----------
Various tweaks.
Modified Paths:
--------------
trunk/translatewiki/Mozilla/genMozilla.php
Modified: trunk/translatewiki/Mozilla/genMozilla.php
===================================================================
--- trunk/translatewiki/Mozilla/genMozilla.php 2012-05-10 11:36:02 UTC (rev
115176)
+++ trunk/translatewiki/Mozilla/genMozilla.php 2012-05-10 14:14:14 UTC (rev
115177)
@@ -15,7 +15,6 @@
// Array of supported products. Any of browser, calendar, chat, dom, editor,
// embedding, extensions, mail, mobile, netwerk, other-licenses, security,
// services, suite, toolkit.
-$supportedProducts = array( 'browser' );
// Folder below $projectFolder in which source files are.
$sourceFolder = 'en';
// File pattern for gettext template files.
@@ -24,6 +23,10 @@
'dtd' => array( 'dtd', 'Dtd' ),
'properties' => array( 'properties', 'Java' ),
);
+// excluded files.
+$excludedFiles = array(
+ 'chrome/browser/browser.properties',
+);
$baseFolder = "$projectsFolder/$projectFolder/${sourceFolder}/";
@@ -35,6 +38,7 @@
$files = shell_exec( "find ${baseFolder} -name '*.${fileExtension}'" );
$files = explode( "\n", $files );
$files = array_filter( $files );
+
foreach ( $files as $index => $file ) {
$files[$index] = str_replace( $baseFolder, '', $file );
}
@@ -61,7 +65,7 @@
class: MessageChecker
checks:
- printfCheck
----
+
PHP;
$output .= $header . "\n";
@@ -72,15 +76,16 @@
// Add config for each file.
foreach ( $files as $file ) {
+ // Exclude some files.
+ if( in_array( $file, $excludedFiles ) ) {
+ echo "$file\n";
+ continue;
+ }
+
// Strip extension from file name and break into parts for
plugin name.
// Later on, used to create a group name.
$groupName = explode( "/", str_replace( '.' . $fileExtension,
'', $file ) );
- // Only process for supported products.
- if ( !in_array( $groupName[0], $supportedProducts ) ) {
- continue;
- }
-
// File name in lower case.
$fileL = strtolower( $file );
@@ -88,6 +93,7 @@
// file extension was stripped.
$groupId = str_replace( "/", '-', $fileL );
$groupId = str_replace( '.' . $fileExtension, '', $groupId );
+ $groupId .= '-' . strtolower( $FFS );
// Create a group name by concatenating the directory and file
name parts
// after capitalising them.
@@ -95,8 +101,10 @@
$groupName[$index] = ucfirst( $groupNamePart );
}
$groupName = implode( ' - ', $groupName );
+ $groupName .= " - ${FFS}";
// Actual configuration.
+ $output .= "---\n";
$output .= "BASIC:\n";
$output .= " id: mozilla-${groupId}\n";
$output .= " label: Mozilla - ${groupName}\n";
@@ -109,7 +117,6 @@
$output .= "MANGLER:\n";
$output .= " prefix: ${groupId}-\n";
$output .= "\n";
- $output .= "---\n";
}
// Write a file for each file type to Mozilla<FFSName>.yaml in current
@@ -119,4 +126,4 @@
fclose( $fp );
}
-echo "Done.";
+echo "Done.\n";
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs