Languages support

This commit is contained in:
dignajar 2015-07-03 19:56:24 -03:00
parent 970a41c61e
commit 59b0c3955e
4 changed files with 53 additions and 22 deletions

View File

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your page title</title>
<title>Bludit</title>
<link rel="stylesheet" href="./css/kube.min.css">
<link rel="stylesheet" href="./css/default.css">
@ -43,9 +43,9 @@ $(document).ready(function() {
<nav class="navbar nav-fullwidth">
<h1>Bludit</h1>
<ul>
<li>Welcome back, <?php echo $Login->username() ?></li>
<li><a target="_blank" href="<?php echo HTML_PATH_ROOT ?>">Website</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>logout">Logout</a></li>
<li><?php $Language->p('Welcome back') ?>, <?php echo $Login->username() ?></li>
<li><a target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><?php $Language->p('Website') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>logout"><?php $Language->p('Logout') ?></a></li>
</ul>
</nav>
</div>
@ -57,17 +57,17 @@ $(document).ready(function() {
<div id="sidebar" class="nav">
<ul>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>dashboard"><i class="fa fa-sun-o"></i>Dashboard</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-post"><i class="fa fa-pencil-square-o"></i>New post</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-page"><i class="fa fa-pencil"></i>New page</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>manage-posts"><i class="fa fa-file-text-o"></i>Manage</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>dashboard"><i class="fa fa-sun-o"></i><?php $Language->p('Dasbhoard') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-post"><i class="fa fa-pencil-square-o"></i><?php $Language->p('New post') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-page"><i class="fa fa-pencil"></i><?php $Language->p('New page') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>manage-posts"><i class="fa fa-file-text-o"></i><?php $Language->p('Manage') ?></a></li>
<?php if($Login->role()==='admin') { ?>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>settings"><i class="fa fa-cogs"></i>Settings</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>users"><i class="fa fa-users"></i>Users</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>themes"><i class="fa fa-adjust"></i>Themes</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>plugins"><i class="fa fa-rocket"></i>Plugins</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>settings"><i class="fa fa-cogs"></i><?php $Language->p('Settings') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>users"><i class="fa fa-users"></i><?php $Language->p('Users') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>themes"><i class="fa fa-adjust"></i><?php $Language->p('Themes') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>plugins"><i class="fa fa-rocket"></i><?php $Language->p('Plugins') ?></a></li>
<?php } else { ?>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>edit-user/<?php echo $Login->username() ?>"><i class="fa fa-file-text-o"></i>Profile</a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>edit-user/<?php echo $Login->username() ?>"><i class="fa fa-file-text-o"></i><?php $Language->p('Profile') ?></a></li>
<?php } ?>
</ul>

View File

@ -19,7 +19,7 @@
<nav class="navbar nav-fullwidth">
<h1>Bludit</h1>
<ul>
<li><a href="<?php echo HTML_PATH_ROOT ?>">Home</a></li>
<li><a href="<?php echo HTML_PATH_ROOT ?>"><?php $Language->p('Home') ?></a></li>
</ul>
</nav>
</div>
@ -50,4 +50,4 @@
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
?>
</body>
</html>
</html>

View File

@ -63,15 +63,10 @@ class dbLanguage extends dbJSON
return $this->get($string);
}
public function print($string)
{
echo $this->get($string);
}
// Print the translation.
public function p($string)
{
$this->print($string);
echo $this->get($string);
}
public function add($array)

View File

@ -35,9 +35,45 @@
"draft": "Draft",
"delete": "Delete",
"registered": "Registered",
"Notifications": "notifications",
"Notifications": "Notifications",
"profile": "Profile",
"email": "Email",
"settings": "Settings",
"general": "General",
"advanced": "Advanced",
"regional": "Regional",
"about": "About",
"logout": "Logout",
"dasbhoard": "Dasbhoard",
"manage": "Manage",
"themes": "Themes",
"site-title": "Site title",
"site-slogan": "Site slogan",
"site-description": "Site description",
"footer-text": "Footer text",
"posts-per-page": "Posts per page",
"site-url": "Site url",
"writting-settings": "Writting settings",
"url-filters": "URL filters",
"pages": "Pages",
"home": "Home",
"welcome-back": "Welcome back",
"language": "Language",
"website": "Website",
"timezone": "Timezone",
"locale": "Locale",
"notifications": "Notifications",
"new-post": "New post",
"html-and-markdown-code-supported": "HTML and Markdown code supported",
"new-page": "New page",
"manage-posts": "Manage posts",
"published-date": "Published date",
"modified-date": "Modified date",
"empty-title": "Empty title",
"plugins": "Plugins",
"install-plugin": "Install plugin",
"uninstall-plugin": "Uninstall plugin",
"new-password": "New password",
"edit-user": "Edit user",
"publish-now": "Publish now",
"first-name": "First name",