aboutsummaryrefslogtreecommitdiffstats
path: root/langs.inc.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-05-27 14:25:04 +0000
committerRomain d'Alverny <rda@mageia.org>2011-05-27 14:25:04 +0000
commite78ec2fea07e1da8c3d32f41ccafbecc5d0262da (patch)
tree79e05ac2a5550cf784d5b6a214566abb82af8918 /langs.inc.php
parent7eee78c16386f0a7aef275a6933c893028dd34f8 (diff)
downloadwww-e78ec2fea07e1da8c3d32f41ccafbecc5d0262da.tar
www-e78ec2fea07e1da8c3d32f41ccafbecc5d0262da.tar.gz
www-e78ec2fea07e1da8c3d32f41ccafbecc5d0262da.tar.bz2
www-e78ec2fea07e1da8c3d32f41ccafbecc5d0262da.tar.xz
www-e78ec2fea07e1da8c3d32f41ccafbecc5d0262da.zip
special query to list available locales
Diffstat (limited to 'langs.inc.php')
-rw-r--r--langs.inc.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/langs.inc.php b/langs.inc.php
index f5d7d9654..e64913c30 100644
--- a/langs.inc.php
+++ b/langs.inc.php
@@ -46,4 +46,29 @@ function relocate($langs, $page = '', $default_locale = 'en')
$page
));
die;
+}
+
+/**
+*/
+function show_langs($langs)
+{
+ header('Content-Type: text/html; charset=utf-8');
+ $count = count($langs);
+ $s = <<<S
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <charset="utf-8">
+ <meta name="robots" content="noindex,nosnippet">
+ <title>Mageia</title>
+</head>
+<body>
+<p><a href="/">Mageia.org</a> is available in {$count} languages:</p>
+<ul>
+S;
+ foreach ($langs as $k => $v) {
+ $s .= sprintf('<li><a href="/%s/" hreflang="%s">%s</a></li>',
+ $k, $k, $v);
+ }
+ echo $s, '</ul><hr /></body></html>';
} \ No newline at end of file