Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
internationalization
Browse files Browse the repository at this point in the history
  • Loading branch information
highstrike committed Feb 21, 2018
1 parent 22022b9 commit a61cc67
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Form/Backend/SearchForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function _buildSchema(Schema $schema) {
protected function _buildValidator(Validator $validator) {
return $validator->allowEmpty('search')->add('search', 'length', [
'rule' => ['minLength', 2],
'message' => 'Search query is too short'
'message' => __d('Unimatrix/backend', 'Search query is too short')
]);
}

Expand Down
14 changes: 13 additions & 1 deletion src/Locale/backend.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2018-02-13 12:52+0200\n"
"POT-Creation-Date: 2018-02-21 15:43+0200\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
Expand All @@ -30,6 +30,10 @@ msgstr ""
msgid "You have successfully auto-logged in as {0}."
msgstr ""

#: /Form/Backend/SearchForm.php:33
msgid "Search query is too short"
msgstr ""

#: /Template/Backend/Login/index.ctp:3
msgid "Actions"
msgstr ""
Expand Down Expand Up @@ -98,3 +102,11 @@ msgstr ""
msgid "Generated in"
msgstr ""

#: /View/Widget/MediaWidget.php:75
msgid "Full Image"
msgstr ""

#: /View/Widget/TagWidget.php:69
msgid "Or select some from this list:"
msgstr ""

14 changes: 13 additions & 1 deletion src/Locale/ro_RO/backend.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2018-02-13 12:52+0200\n"
"POT-Creation-Date: 2018-02-21 15:43+0200\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
Expand All @@ -30,6 +30,10 @@ msgstr "Nu sunteți autorizat să accesați această pagină."
msgid "You have successfully auto-logged in as {0}."
msgstr "Autentificare automată reușită ca și {0}."

#: /Form/Backend/SearchForm.php:33
msgid "Search query is too short"
msgstr "Textul de căutare este prea scurt"

#: /Template/Backend/Login/index.ctp:3
msgid "Actions"
msgstr "Acțiuni"
Expand Down Expand Up @@ -98,3 +102,11 @@ msgstr "Pentru a continua te rugăm să te autentifici"
msgid "Generated in"
msgstr "Generat în"

#: /View/Widget/MediaWidget.php:75
msgid "Full Image"
msgstr "Toată Imaginea"

#: /View/Widget/TagWidget.php:69
msgid "Or select some from this list:"
msgstr "Sau selectează din lista asta:"

2 changes: 1 addition & 1 deletion src/View/Widget/MediaWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function item(View $view, $value, $new = false) {
// create item
$out = '<media id="' . Text::uuid(). '"' . ($new ? " class='new'" : null) . '>';
$out .= $view->Html->image($new ? 'Unimatrix/Backend.widgets/media-plus.png' : $value);
$out .= $view->Html->link('<i class="fa fa-eye" aria-hidden="true"></i> Full Image', $new ? '#' : $value, ['escape' => false, 'target' => '_blank']);
$out .= $view->Html->link('<i class="fa fa-eye" aria-hidden="true"></i> ' . __d('Unimatrix/backend', 'Full Image'), $new ? '#' : $value, ['escape' => false, 'target' => '_blank']);
$out .= '<i class="fa fa-times" aria-hidden="true"></i>';
$out .= '</media>';

Expand Down
2 changes: 1 addition & 1 deletion src/View/Widget/TagWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function render(array $data, ContextInterface $context) {
// calculate existing tags
$tags = null;
if(isset($data['list'])) {
$tags = "<div class='list'><label>Or select some from this list:</label>";
$tags = "<div class='list'><label>" . __d('Unimatrix/backend', 'Or select some from this list:') . "</label>";
$existing = explode(',', str_replace(', ', ',', $data['val']));
foreach(explode(',', str_replace(', ', ',', $data['list'])) as $value)
$tags .= "<tag". (in_array($value, $existing) ? ' class="hidden"' : false) ."><div><span title='{$value}'>{$value}</span></div></tag>";
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ var dump = function(what) { 'use strict';
console.log(what);
};

// not defined? assume it
if(typeof WEBROOT == 'undefined') WEBROOT = '/';
if(typeof DEV_ENV == 'undefined') DEV_ENV = true;

// start backend
var Backend = function() { 'use strict';
var store = {

Expand Down

0 comments on commit a61cc67

Please sign in to comment.