Commit 09cecb56 authored by cividesk's avatar cividesk

Added human-legible languages rather than iso codes, and sum per root language

parent 65c79481
......@@ -28,6 +28,43 @@ CREATE TABLE IF NOT EXISTS `common_month` (
-- --------------------------------------------------------
--
-- Table structure for table `common_language`
--
DROP TABLE IF EXISTS `common_language`;
CREATE TABLE IF NOT EXISTS `common_language` (
`iso` char(2) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
`language` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`iso`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `common_language`
--
INSERT INTO `common_language` (`iso`, `language`) VALUES
('en', 'English'),
('fr', 'French'),
('de', 'German'),
('nl', 'Dutch'),
('es', 'Spanish'),
('it', 'Italian'),
('pt', 'Portuguese'),
('pl', 'Polish'),
('ru', 'Russian'),
('da', 'Danish'),
('hu', 'Hungarian'),
('sv', 'Swedish'),
('nb', 'Norwegian Bokmål'),
('fi', 'Finnish'),
('zh', 'Chinese'),
('el', 'Greek'),
('he', 'Hebrew'),
('ja', 'Japanese'),
('lt', 'Lithuanian'),
('ca', 'Catalan');
--
-- Table structure for table `github_commit`
--
......
......@@ -31,10 +31,11 @@ $queries[] = array(
$queries[] = array(
'file' => 'active-sites-lang.json',
'query' => "
SELECT lang, COUNT(*) AS num_sites
FROM pingback_site
SELECT COALESCE(l.language, 'Other') AS language, COUNT(*) AS num_sites
FROM pingback_site s
LEFT JOIN common_language l ON l.iso = LEFT(s.lang,2)
WHERE is_active = 1
GROUP BY lang
GROUP BY language
ORDER BY num_sites DESC
",
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment