multilang first try

This commit is contained in:
Claude 2013-04-14 13:21:17 +02:00
parent 77ec34da7d
commit 3992b8297d
6 changed files with 17 additions and 16 deletions

View File

@ -64,7 +64,7 @@ $autoload['libraries'] = array('database', 'db_session', 'carabiner');
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url', 'date');
$autoload['helper'] = array('url', 'date', 'language');
/*

View File

@ -239,6 +239,7 @@ class Main extends CI_Controller
$this->dbforge->add_key('hits_updated');
$this->dbforge->add_column('pastes', $fields);
}
$this->lang->load('stikked', 'english');
}
function _form_prep($lang = false, $title = '', $paste = '', $reply = false)

View File

@ -1,10 +0,0 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,10 @@
<?php
$lang['paste_create_new'] = "No migrations were found.";
$lang['migration_not_found'] = "This migration could not be found.";
$lang['migration_multiple_version'] = "This are multiple migrations with the same version number: %d.";
$lang['migration_class_doesnt_exist'] = "The migration class \"%s\" could not be found.";
$lang['migration_missing_up_method'] = "The migration class \"%s\" is missing an 'up' method.";
$lang['migration_missing_down_method'] = "The migration class \"%s\" is missing an 'down' method.";
$lang['migration_invalid_filename'] = "Migration \"%s\" has an invalid filename.";

View File

@ -39,17 +39,17 @@
*/
if ( ! function_exists('lang'))
{
function lang($line, $id = '')
function lang($index, $id = '')
{
$CI =& get_instance();
$line = $CI->lang->line($line);
$line = $CI->lang->line($index);
if ($id != '')
{
$line = '<label for="'.$id.'">'.$line."</label>";
}
return $line;
return ($line != '' ? $line : '[' . $index . ']');
}
}

View File

@ -5,7 +5,7 @@
<form action="<?php echo base_url(); ?>" method="post">
<h1><?php if(!isset($page['title'])){ ?>
Create a new paste
<?php echo lang('paste_create_new'); ?>
<?php } else { ?>
<?php echo $page['title']; ?>
<?php } ?></h1>