Language display optimized

Language is now no longer direct array access but provided through a
function. This can be later used to hot load language files instead of
pre-loading them.
This commit is contained in:
Dennis Eichhorn 2016-07-02 14:14:31 +02:00
parent 768c2ceffe
commit e49b37c692
5 changed files with 44 additions and 44 deletions

View File

@ -1,6 +1,6 @@
<template id="acc-grp-tpl"> <template id="acc-grp-tpl">
<section id="acc-grp" class="box w-50" style="z-index: 9; position: absolute; margin: 0 auto; left: 50%; top: 50%; transform: translate(-50%, -50%);"> <section id="acc-grp" class="box w-50" style="z-index: 9; position: absolute; margin: 0 auto; left: 50%; top: 50%; transform: translate(-50%, -50%);">
<header><h1><?= $this->l11n->lang['Profile']['Account/Group']; ?></h1></header> <header><h1><?= $this->l11n->getText('Profile', 'Account/Group'); ?></h1></header>
<div class="inner"> <div class="inner">
<form id="fAccGrp" method="GET" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/accgrp'); ?>"> <form id="fAccGrp" method="GET" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/accgrp'); ?>">
@ -15,7 +15,7 @@
<tbody> <tbody>
<tfoot> <tfoot>
</table> </table>
<tr><td colspan="2"><input type="submit" value="<?= $this->l11n->lang[0]['Search']; ?>"><input type="hidden" name="type" value="<?= \Modules\Tasks\Models\TaskType::SINGLE; ?>"> <tr><td colspan="2"><input type="submit" value="<?= $this->l11n->getText(0, 'Search'); ?>"><input type="hidden" name="type" value="<?= \Modules\Tasks\Models\TaskType::SINGLE; ?>">
</table> </table>
</form> </form>
</div> </div>

View File

@ -27,12 +27,12 @@ $accounts = $this->getData('accounts');
<div class="box"> <div class="box">
<table class="table"> <table class="table">
<caption><?= $this->l11n->lang['Profile']['Profiles']; ?></caption> <caption><?= $this->l11n->getText('Profile', 'Profiles'); ?></caption>
<thead> <thead>
<tr> <tr>
<td><?= $this->l11n->lang[0]['ID']; ?> <td><?= $this->l11n->getText(0, 'ID'); ?>
<td class="wf-100"><?= $this->l11n->lang['Profile']['Name']; ?> <td class="wf-100"><?= $this->l11n->getText('Profile', 'Name'); ?>
<td><?= $this->l11n->lang['Profile']['Activity']; ?> <td><?= $this->l11n->getText('Profile', 'Activity'); ?>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3"><?= $footerView->render(); ?> <td colspan="3"><?= $footerView->render(); ?>
@ -45,7 +45,7 @@ $accounts = $this->getData('accounts');
<td><a href="<?= $url; ?>"><?= $account->getLastActive()->format('Y-m-d'); ?></a> <td><a href="<?= $url; ?>"><?= $account->getLastActive()->format('Y-m-d'); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if($count === 0) : ?> <?php if($count === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->l11n->lang[0]['Empty']; ?> <tr><td colspan="3" class="empty"><?= $this->l11n->getText(0, 'Empty'); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>

View File

@ -21,24 +21,24 @@ $account = $this->getData('account');
echo $this->getData('nav')->render(); echo $this->getData('nav')->render();
?> ?>
<section itemscope itemtype="http://schema.org/Person" class="box w-33"> <section itemscope itemtype="http://schema.org/Person" class="box w-33">
<header><h1><?= $this->l11n->lang['Profile']['Profile']; ?></h1></header> <header><h1><?= $this->l11n->getText('Profile', 'Profile'); ?></h1></header>
<div class="inner"> <div class="inner">
<!-- @formatter:off --> <!-- @formatter:off -->
<table class="list"> <table class="list">
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Name']; ?> <th><?= $this->l11n->getText('Profile', 'Name'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>, <span itemprop="givenName"><?= $account->getName1(); ?></span> <td><span itemprop="familyName"><?= $account->getName3(); ?></span>, <span itemprop="givenName"><?= $account->getName1(); ?></span>
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Occupation']; ?> <th><?= $this->l11n->getText('Profile', 'Occupation'); ?>
<td itemprop="jobTitle">Sailor <td itemprop="jobTitle">Sailor
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Birthday']; ?> <th><?= $this->l11n->getText('Profile', 'Birthday'); ?>
<td itemprop="birthDate">06.09.1934 <td itemprop="birthDate">06.09.1934
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Ranks']; ?> <th><?= $this->l11n->getText('Profile', 'Ranks'); ?>
<td itemprop="memberOf">Gosling <td itemprop="memberOf">Gosling
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Email']; ?> <th><?= $this->l11n->getText('Profile', 'Email'); ?>
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $account->getEmail(); ?></a> <td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $account->getEmail(); ?></a>
<tr> <tr>
<th>Address <th>Address
@ -50,7 +50,7 @@ echo $this->getData('nav')->render();
<th class="vT">Work <th class="vT">Work
<td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA <td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Phone']; ?> <th><?= $this->l11n->getText('Profile', 'Phone'); ?>
<td> <td>
<tr> <tr>
<th>Private <th>Private
@ -62,13 +62,13 @@ echo $this->getData('nav')->render();
<th>Work <th>Work
<td itemprop="telephone">+01 12345-4567 <td itemprop="telephone">+01 12345-4567
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Registered']; ?> <th><?= $this->l11n->getText('Profile', 'Registered'); ?>
<td><?= $account->getCreatedAt()->format('Y-m-d'); ?> <td><?= $account->getCreatedAt()->format('Y-m-d'); ?>
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['LastLogin']; ?> <th><?= $this->l11n->getText('Profile', 'LastLogin'); ?>
<td><?= $account->getLastActive()->format('Y-m-d'); ?> <td><?= $account->getLastActive()->format('Y-m-d'); ?>
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Status']; ?> <th><?= $this->l11n->getText('Profile', 'Status'); ?>
<td><span class="tag green"><?= $account->getStatus(); ?></span> <td><span class="tag green"><?= $account->getStatus(); ?></span>
</table> </table>
<!-- @formatter:on --> <!-- @formatter:on -->
@ -77,13 +77,13 @@ echo $this->getData('nav')->render();
<div class="box w-100"> <div class="box w-100">
<table class="table"> <table class="table">
<caption><?= $this->l11n->lang['Profile']['Media']; ?></caption> <caption><?= $this->l11n->getText('Profile', 'Media'); ?></caption>
<thead> <thead>
<tr> <tr>
<td><?= $this->l11n->lang[0]['ID']; ?> <td><?= $this->l11n->getText(0, 'ID'); ?>
<td class="wf-100"><?= $this->l11n->lang['Profile']['Title']; ?> <td class="wf-100"><?= $this->l11n->getText('Profile', 'Title'); ?>
<td><?= $this->l11n->lang['Profile']['Type']; ?> <td><?= $this->l11n->getText('Profile', 'Type'); ?>
<td><?= $this->l11n->lang['Profile']['Created']; ?> <td><?= $this->l11n->getText('Profile', 'Created'); ?>
<tfoot> <tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?> <tr><td colspan="4"><?= $footerView->render(); ?>
<tbody> <tbody>
@ -96,7 +96,7 @@ echo $this->getData('nav')->render();
<td><a href="<?= $url; ?>"><?= $value->getNewestStatus()->getStatus(); ?></a> <td><a href="<?= $url; ?>"><?= $value->getNewestStatus()->getStatus(); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if($c === 0) : ?> <?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->l11n->lang[0]['Empty']; ?> <tr><td colspan="4" class="empty"><?= $this->l11n->getText(0, 'Empty'); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>

View File

@ -27,12 +27,12 @@ $accounts = $this->getData('accounts');
<div class="box"> <div class="box">
<table class="table"> <table class="table">
<caption><?= $this->l11n->lang['Profile']['Profiles']; ?></caption> <caption><?= $this->l11n->getText('Profile', 'Profiles'); ?></caption>
<thead> <thead>
<tr> <tr>
<td><?= $this->l11n->lang[0]['ID']; ?> <td><?= $this->l11n->getText(0, 'ID'); ?>
<td class="wf-100"><?= $this->l11n->lang['Profile']['Name']; ?> <td class="wf-100"><?= $this->l11n->getText('Profile', 'Name'); ?>
<td><?= $this->l11n->lang['Profile']['Activity']; ?> <td><?= $this->l11n->getText('Profile', 'Activity'); ?>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3"><?= $footerView->render(); ?> <td colspan="3"><?= $footerView->render(); ?>
@ -45,7 +45,7 @@ $accounts = $this->getData('accounts');
<td><a href="<?= $url; ?>"><?= $account->getLastActive()->format('Y-m-d'); ?></a> <td><a href="<?= $url; ?>"><?= $account->getLastActive()->format('Y-m-d'); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if($count === 0) : ?> <?php if($count === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->l11n->lang[0]['Empty']; ?> <tr><td colspan="3" class="empty"><?= $this->l11n->getText(0, 'Empty'); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>

View File

@ -21,24 +21,24 @@ $account = $this->getData('account');
echo $this->getData('nav')->render(); echo $this->getData('nav')->render();
?> ?>
<section itemscope itemtype="http://schema.org/Person" class="box w-33"> <section itemscope itemtype="http://schema.org/Person" class="box w-33">
<header><h1><?= $this->l11n->lang['Profile']['Profile']; ?></h1></header> <header><h1><?= $this->l11n->getText('Profile', 'Profile'); ?></h1></header>
<div class="inner"> <div class="inner">
<!-- @formatter:off --> <!-- @formatter:off -->
<table class="list"> <table class="list">
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Name']; ?> <th><?= $this->l11n->getText('Profile', 'Name'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>, <span itemprop="givenName"><?= $account->getName1(); ?></span> <td><span itemprop="familyName"><?= $account->getName3(); ?></span>, <span itemprop="givenName"><?= $account->getName1(); ?></span>
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Occupation']; ?> <th><?= $this->l11n->getText('Profile', 'Occupation'); ?>
<td itemprop="jobTitle">Sailor <td itemprop="jobTitle">Sailor
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Birthday']; ?> <th><?= $this->l11n->getText('Profile', 'Birthday'); ?>
<td itemprop="birthDate">06.09.1934 <td itemprop="birthDate">06.09.1934
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Ranks']; ?> <th><?= $this->l11n->getText('Profile', 'Ranks'); ?>
<td itemprop="memberOf">Gosling <td itemprop="memberOf">Gosling
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Email']; ?> <th><?= $this->l11n->getText('Profile', 'Email'); ?>
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $account->getEmail(); ?></a> <td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $account->getEmail(); ?></a>
<tr> <tr>
<th>Address <th>Address
@ -50,7 +50,7 @@ echo $this->getData('nav')->render();
<th class="vT">Work <th class="vT">Work
<td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA <td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Phone']; ?> <th><?= $this->l11n->getText('Profile', 'Phone'); ?>
<td> <td>
<tr> <tr>
<th>Private <th>Private
@ -62,13 +62,13 @@ echo $this->getData('nav')->render();
<th>Work <th>Work
<td itemprop="telephone">+01 12345-4567 <td itemprop="telephone">+01 12345-4567
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Registered']; ?> <th><?= $this->l11n->getText('Profile', 'Registered'); ?>
<td><?= $account->getCreatedAt()->format('Y-m-d'); ?> <td><?= $account->getCreatedAt()->format('Y-m-d'); ?>
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['LastLogin']; ?> <th><?= $this->l11n->getText('Profile', 'LastLogin'); ?>
<td><?= $account->getLastActive()->format('Y-m-d'); ?> <td><?= $account->getLastActive()->format('Y-m-d'); ?>
<tr> <tr>
<th><?= $this->l11n->lang['Profile']['Status']; ?> <th><?= $this->l11n->getText('Profile', 'Status'); ?>
<td><span class="tag green"><?= $account->getStatus(); ?></span> <td><span class="tag green"><?= $account->getStatus(); ?></span>
</table> </table>
<!-- @formatter:on --> <!-- @formatter:on -->
@ -77,13 +77,13 @@ echo $this->getData('nav')->render();
<div class="box w-100"> <div class="box w-100">
<table class="table"> <table class="table">
<caption><?= $this->l11n->lang['Profile']['Media']; ?></caption> <caption><?= $this->l11n->getText('Profile', 'Media'); ?></caption>
<thead> <thead>
<tr> <tr>
<td><?= $this->l11n->lang[0]['ID']; ?> <td><?= $this->l11n->getText(0, 'ID'); ?>
<td class="wf-100"><?= $this->l11n->lang['Profile']['Title']; ?> <td class="wf-100"><?= $this->l11n->getText('Profile', 'Title'); ?>
<td><?= $this->l11n->lang['Profile']['Type']; ?> <td><?= $this->l11n->getText('Profile', 'Type'); ?>
<td><?= $this->l11n->lang['Profile']['Created']; ?> <td><?= $this->l11n->getText('Profile', 'Created'); ?>
<tfoot> <tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?> <tr><td colspan="4"><?= $footerView->render(); ?>
<tbody> <tbody>
@ -96,7 +96,7 @@ echo $this->getData('nav')->render();
<td><a href="<?= $url; ?>"><?= $value->getNewestStatus()->getStatus(); ?></a> <td><a href="<?= $url; ?>"><?= $value->getNewestStatus()->getStatus(); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if($c === 0) : ?> <?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->l11n->lang[0]['Empty']; ?> <tr><td colspan="4" class="empty"><?= $this->l11n->getText(0, 'Empty'); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>