Skip to content

@pascalchevrel /gist:9623606
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
String Distribution for Firefox Aurora, based on data from Transvision
<?php
function cleanEntity($entity)
{
$component = explode('/', $entity);
array_pop($component); // suppress entity
$component = array_filter(
$component,
function($val) { return $val != 'chrome'; }
);
return implode('/', $component);
}
function excludeProducts($entity)
{
$component = explode('/', $entity);
if (in_array($component[0], ['chat', 'calendar', 'suite',
'mail', 'editor', 'extensions'] ))
{
return false;
}
return true;
}
include __DIR__ . '/TMX/aurora/en-US/cache_en-US.php';
$tmx = array_keys($tmx);
$tmx = array_map('cleanEntity', $tmx);
$tmx = array_filter($tmx, 'excludeProducts');
$results = [];
$devtools = 0;
foreach ($tmx as $val) {
$component = explode('/', $val);
$main_component = $component[0];
if (in_array('devtools', $component)) {
$devtools++;
}
if (! isset($results[$main_component])) {
$results[$main_component] = 1;
} else {
$results[$main_component] += 1;
}
}
foreach ($results as $component => $number) {
print $component . ' : ' . $number . '<br>';
}
print "(of which devtools: $devtools )<br>";
print 'Total: ' . count($tmx) . '<br>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.