Skip to content

Commit

Permalink
lang chooser update
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Sep 6, 2009
1 parent 028f67e commit e5db7d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 23 additions & 3 deletions app/translate/controllers/translations.php
Expand Up @@ -86,7 +86,6 @@ function _index( &$vars ) {
$translation_files = array();

$loadpath = 'wp-content/language/';

if (!empty($loadpath) && $handle = opendir($loadpath)) {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..' && substr($file,-3) == 'php' && $file != 'lang_chooser.php') {
Expand All @@ -104,8 +103,29 @@ function _index( &$vars ) {
'code' => $code,
'data' => ''
);
}}}

}
}
}

$loadpath = 'wp-content/language/import/';
if (!empty($loadpath) && $handle = opendir($loadpath)) {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..' && substr($file,-3) == 'txt') {
$txt = array();
$data = split("\n", file_get_contents($loadpath.$file));
$code = substr($file,0,-4);
$lang = "";
if (isset($data[0]))
$lang = $data[0];
$translation_files[] = array(
'id' => 0,
'name' => $lang,
'code' => $code,
'data' => ''
);
}
}
}

//$tran['id/name/code/data']
$fieldcount = count($txt);
Expand Down
2 changes: 2 additions & 0 deletions app/translate/views/translations/_index.html
Expand Up @@ -127,6 +127,8 @@
<td><p><?php print $tran['code']; ?></p></td>
<?php if ($tran['code'] == 'eng') : ?>
<td><p>@<a href="http://openmicroblogger.com/brian">Brian</a></p></td>
<?php elseif ($tran['code'] == 'sve') : ?>
<td><p>@<a href="http://blurbs.se/">Ostro</a></p></td>
<?php else : ?>
<td><p>@<a href="http://tiquer.me/johannesschirge">Shen84</a></p></td>
<?php endif; ?>
Expand Down

0 comments on commit e5db7d8

Please sign in to comment.