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

Merge I18n into master #1370

Merged
merged 30 commits into from
Jun 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4542ea6
Added Backend-Translations
May 9, 2017
a44d56f
Fixed syntax error
May 9, 2017
00d1ac8
Fixed Style-CI
May 9, 2017
341b263
Fixed Style-CI again
May 9, 2017
c61e16d
Fixed codeclimate
May 9, 2017
494d8dc
Fix Travis
May 9, 2017
483a91b
Fixed Travis next try
May 9, 2017
4674d5e
Fixed Translation in BREAD create-view
May 9, 2017
e0cf3e2
Publish language file with installation
May 9, 2017
353e009
Merge pull request #1234 from emptynick/master
marktopper Jun 15, 2017
0288907
Grouped translations
akazorg Jun 19, 2017
146a57b
Added compatible method __() on helpers
akazorg Jun 19, 2017
2447fcd
Refactor, changed method name
akazorg Jun 19, 2017
f1fa680
Updated views with translation keys
akazorg Jun 19, 2017
276a7b5
Revision voyager lang
akazorg Jun 19, 2017
3544e18
Merge remote-tracking branch 'upstream/master' into i18n
akazorg Jun 19, 2017
2259090
RolesTest
akazorg Jun 19, 2017
61587aa
RolesTest 01
akazorg Jun 19, 2017
6c1e24c
Fixed Tests
akazorg Jun 19, 2017
b7d5dec
Fix publish lang file
akazorg Jun 19, 2017
b76bc85
Publish all available langs. Added PT folder
akazorg Jun 19, 2017
a10d1de
Revised Language PT
akazorg Jun 20, 2017
9da2e85
Fixed i18n __() method
akazorg Jun 20, 2017
59234a0
Apply fixes from StyleCI
marktopper Jun 21, 2017
0699bab
Add datatable.js translations
akazorg Jun 21, 2017
e6f3594
Merge pull request #1368 from the-control-group/analysis-8w0PNE
marktopper Jun 21, 2017
3ebe77b
Fix __() method
akazorg Jun 21, 2017
8653e8a
Missing Views keys and fix translations
akazorg Jun 21, 2017
34321bc
fix edit-add.blade translations
akazorg Jun 21, 2017
5390b50
Re-added commented-out tests
marktopper Jun 21, 2017
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
58 changes: 29 additions & 29 deletions publishable/database/seeds/TranslationsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,27 @@ private function dataTypesTranslations()
$_tpl = ['data_types', $_fld];
$dtp = DataType::where($_fld, 'Post')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Post');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Post');
}
$dtp = DataType::where($_fld, 'Page')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Página');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Página');
}
$dtp = DataType::where($_fld, 'User')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Utilizador');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Utilizador');
}
$dtp = DataType::where($_fld, 'Category')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Categoria');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Categoria');
}
$dtp = DataType::where($_fld, 'Menu')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Menu');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Menu');
}
$dtp = DataType::where($_fld, 'Role')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Função');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Função');
}

// Adding translations for 'display_name_plural'
Expand All @@ -62,27 +62,27 @@ private function dataTypesTranslations()
$_tpl = ['data_types', $_fld];
$dtp = DataType::where($_fld, 'Posts')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Posts');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Posts');
}
$dtp = DataType::where($_fld, 'Pages')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Páginas');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Páginas');
}
$dtp = DataType::where($_fld, 'Users')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Utilizadores');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Utilizadores');
}
$dtp = DataType::where($_fld, 'Categories')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Categorias');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Categorias');
}
$dtp = DataType::where($_fld, 'Menus')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Menus');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Menus');
}
$dtp = DataType::where($_fld, 'Roles')->firstOrFail();
if ($dtp->exists) {
$this->trans('pt', $this->arr($_tpl, $dtp->id), 'Funções');
$this->trs('pt', $this->arr($_tpl, $dtp->id), 'Funções');
}
}

Expand All @@ -96,20 +96,20 @@ private function pagesTranslations()
$page = Page::where('slug', 'hello-world')->firstOrFail();
if ($page->exists) {
$_arr = $this->arr(['pages', 'title'], $page->id);
$this->trans('pt', $_arr, 'Olá Mundo');
$this->trs('pt', $_arr, 'Olá Mundo');
/**
* For configuring additional languages use it e.g.
*
* ```
* $this->trans('es', $_arr, 'hola-mundo');
* $this->trans('de', $_arr, 'hallo-welt');
* $this->trs('es', $_arr, 'hola-mundo');
* $this->trs('de', $_arr, 'hallo-welt');
* ```
*/
$_arr = $this->arr(['pages', 'slug'], $page->id);
$this->trans('pt', $_arr, 'ola-mundo');
$this->trs('pt', $_arr, 'ola-mundo');

$_arr = $this->arr(['pages', 'body'], $page->id);
$this->trans('pt', $_arr, '<p>Olá Mundo. Scallywag grog swab Cat o\'nine tails scuttle rigging hardtack cable nipper Yellow Jack. Handsomely spirits knave lad killick landlubber or just lubber deadlights chantey pinnace crack Jennys tea cup. Provost long clothes black spot Yellow Jack bilged on her anchor league lateen sail case shot lee tackle.</p>'
$this->trs('pt', $_arr, '<p>Olá Mundo. Scallywag grog swab Cat o\'nine tails scuttle rigging hardtack cable nipper Yellow Jack. Handsomely spirits knave lad killick landlubber or just lubber deadlights chantey pinnace crack Jennys tea cup. Provost long clothes black spot Yellow Jack bilged on her anchor league lateen sail case shot lee tackle.</p>'
."\r\n".'<p>Ballast spirits fluke topmast me quarterdeck schooner landlubber or just lubber gabion belaying pin. Pinnace stern galleon starboard warp carouser to go on account dance the hempen jig jolly boat measured fer yer chains. Man-of-war fire in the hole nipperkin handsomely doubloon barkadeer Brethren of the Coast gibbet driver squiffy.</p>');
}
}
Expand All @@ -124,57 +124,57 @@ private function menusTranslations()
$_tpl = ['menu_items', 'title'];
$_item = $this->mItem('Dashboard');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Painel de Controle');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Painel de Controle');
}

$_item = $this->mItem('Media');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Media');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Media');
}

$_item = $this->mItem('Posts');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Publicações');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Publicações');
}

$_item = $this->mItem('Users');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Utilizadores');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Utilizadores');
}

$_item = $this->mItem('Categories');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Categorias');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Categorias');
}

$_item = $this->mItem('Pages');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Páginas');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Páginas');
}

$_item = $this->mItem('Roles');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Funções');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Funções');
}

$_item = $this->mItem('Tools');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Ferramentas');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Ferramentas');
}

$_item = $this->mItem('Menu Builder');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Menus');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Menus');
}

$_item = $this->mItem('Database');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Base de dados');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Base de dados');
}

$_item = $this->mItem('Settings');
if ($_item->exists) {
$this->trans('pt', $this->arr($_tpl, $_item->id), 'Configurações');
$this->trs('pt', $this->arr($_tpl, $_item->id), 'Configurações');
}
}

Expand All @@ -192,7 +192,7 @@ private function arr($par, $id)
];
}

private function trans($lang, $keys, $value)
private function trs($lang, $keys, $value)
{
$_t = Translation::firstOrNew(array_merge($keys, [
'locale' => $lang,
Expand Down
Loading