Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n and l10n improvements #985

Merged
merged 3 commits into from
Oct 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controllers/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function login() {

$this->view->jsonSuccess([
'success' => false,
'error' => 'invalid username/password'
'error' => \F3::get('lang_login_invalid_credentials'),
]);
}

Expand Down
5 changes: 5 additions & 0 deletions public/lang/cs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ lang_timestamp={0,date} {0,time}
lang_hours=před {0,plural,one {1 hodinou},other {# hodinami}}
lang_minutes=před {0,plural,one {1 minutou},other {# minutami}}
lang_seconds=před {0,plural,one {chvílí},other {# sekundami}}
lang_days={0,plural,zero {dnes},one {včera},other {před # dny}}
lang_star=označit
lang_unstar=odznačit
lang_mark=označit jako přečtené
Expand All @@ -34,17 +35,21 @@ lang_source_new=nový neuložený zdroj
lang_source_title=Název
lang_source_autotitle_hint=Pro automatické vyplnění ponechte prázdné
lang_source_tags=Štítky
lang_source_pwd_placeholder=beze změny
lang_source_comma=oddělené čárkou
lang_source_select=vyberte prosím zdroj
lang_source_type=Typ
lang_source_save=uložit
lang_source_cancel=zrušit
lang_source_saved=uloženo
lang_source_last_post=Poslední příspěvek spatřen
lang_source_refresh=Obnovit tento zdroj
lang_no_entries=žádný záznam
lang_more=více
lang_login=přihlásit
lang_login_username=jméno
lang_login_password=heslo
lang_login_invalid_credentials=špatné jméno nebo heslo
lang_no_title=Bez titulku
lang_error=nastala chyba
lang_streamerror=Nenačteny žádné položky, zkusit znovu?
1 change: 1 addition & 0 deletions public/lang/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ lang_more=more
lang_login=login
lang_login_username=username
lang_login_password=password
lang_login_invalid_credentials=invalid username/password
lang_no_title=no title
lang_error=an error occured
lang_streamerror=No items loaded, reload?
4 changes: 2 additions & 2 deletions templates/home.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
<form action="<?= $this->base; ?>" method="post">
<ul id="login">
<li><h1>selfoss login</h1></li>
<li><label for="username"><?= trim(\F3::get('lang_login_username')); ?>:</label> <input type="text" name="username" id="username"></li>
<li><label for="password"><?= trim(\F3::get('lang_login_password')); ?>:</label> <input type="password" name="password" id="password"></li>
<li><label for="username"><?= trim(\F3::get('lang_login_username')); ?></label> <input type="text" name="username" id="username"></li>
<li><label for="password"><?= trim(\F3::get('lang_login_password')); ?></label> <input type="password" name="password" id="password"></li>
<li class="error"></li>
<li class="button"><label>&nbsp;</label><input type="submit" value="<?= \F3::get('lang_login'); ?>" /></li>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions templates/source.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
<!-- edit -->
<ul class="source-edit-form">
<!-- title -->
<li><label for="title-<?= $idAttr ?>"><?= \F3::get('lang_source_title')?>:</label> <input id="title-<?= $idAttr ?>" type="text" name="title" value="<?= isset($this->source) ? $this->source['title'] : ''; ?>" placeholder="<?= F3::get('lang_source_autotitle_hint'); ?>" /></li>
<li><label for="title-<?= $idAttr ?>"><?= \F3::get('lang_source_title')?></label> <input id="title-<?= $idAttr ?>" type="text" name="title" value="<?= isset($this->source) ? $this->source['title'] : ''; ?>" placeholder="<?= F3::get('lang_source_autotitle_hint'); ?>" /></li>


<!-- tags -->
<li><label for="tags-<?= $idAttr ?>"><?= \F3::get('lang_source_tags'); ?>:</label>
<li><label for="tags-<?= $idAttr ?>"><?= \F3::get('lang_source_tags'); ?></label>
<input id="tags-<?= $idAttr ?>" type="text" name="tags" value="<?= isset($this->source) ? $this->source['tags'] : ''; ?>" /> <span class="source-edit-form-help"> <?= \F3::get('lang_source_comma')?></span>
</li>

<!-- filter -->
<li><label for="filter-<?= $idAttr ?>"><?= \F3::get('lang_source_filter')?>:</label> <input id="filter-<?= $idAttr ?>" type="text" name="filter" value="<?= isset($this->source) ? $this->source['filter'] : ''; ?>" placeholder="<?= F3::get('lang_source_optional'); ?>" /></li>
<li><label for="filter-<?= $idAttr ?>"><?= \F3::get('lang_source_filter')?></label> <input id="filter-<?= $idAttr ?>" type="text" name="filter" value="<?= isset($this->source) ? $this->source['filter'] : ''; ?>" placeholder="<?= F3::get('lang_source_optional'); ?>" /></li>

<!-- type -->
<li><label for="type-<?= $idAttr ?>"><?= \F3::get('lang_source_type')?>:</label>
<li><label for="type-<?= $idAttr ?>"><?= \F3::get('lang_source_type')?></label>
<select id="type-<?= $idAttr ?>" class="source-spout" name="spout">
<option value=""><?= \F3::get('lang_source_select')?></option>
<?php foreach ($this->spouts as $spouttype => $spout) : ?>
Expand Down
8 changes: 4 additions & 4 deletions templates/source_params.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ foreach ($this->spout->params as $spoutParamName => $spoutParam) {
|| $spoutParam['type'] == 'checkbox'
|| $spoutParam['type'] == 'url') {
echo '<li>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . ':</label>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . '</label>
<input id="' . $spoutParamName . '-' . $this->idAttr . '" type="' . $spoutParam['type'] . '"
name="' . $spoutParamName . '"
value="' . $value . '"
Expand All @@ -26,13 +26,13 @@ foreach ($this->spout->params as $spoutParamName => $spoutParam) {
if ($spoutParam['type'] == 'password') {
if (empty($value)) {
echo '<li>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . ':</label>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . '</label>
<input id="' . $spoutParamName . '-' . $this->idAttr . '" type="' . $spoutParam['type'] . '"
name="' . $spoutParamName . '" />
</li>';
} else {
echo '<li>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . ':</label>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . '</label>
<input id="' . $spoutParamName . '-' . $this->idAttr . '" type="' . $spoutParam['type'] . '"
name="' . $spoutParamName . '"
placeholder="' . \F3::get('lang_source_pwd_placeholder') . '" />
Expand All @@ -46,7 +46,7 @@ foreach ($this->spout->params as $spoutParamName => $spoutParam) {
}

echo '<li>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . ':</label>
<label for="' . $spoutParamName . '-' . $this->idAttr . '">' . $spoutParam['title'] . '</label>
<select id="' . $spoutParamName . '-' . $this->idAttr . '" name="' . $spoutParamName . '" size="1">' . $options . '
</select>
</li>';
Expand Down