From 3c104090baea498ca6376ce05e1a20050c0b064e Mon Sep 17 00:00:00 2001 From: Pedro Peixoto Date: Tue, 10 Dec 2013 12:03:11 +0000 Subject: [PATCH 1/6] Adding "PT" locale language files Added the portuguese translations files for the "pt" locale --- src/lang/pt/administrator.php | 56 +++++++++++++++++++++++++++++++++++ src/lang/pt/knockout.php | 23 ++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/lang/pt/administrator.php create mode 100644 src/lang/pt/knockout.php diff --git a/src/lang/pt/administrator.php b/src/lang/pt/administrator.php new file mode 100644 index 000000000..1a38732df --- /dev/null +++ b/src/lang/pt/administrator.php @@ -0,0 +1,56 @@ + 'Painel', + 'edit' => 'Editar', + 'filters' => 'Filtros', + 'loading' => 'A carregar...', + 'createnew' => 'Criar novo', + 'new' => 'Novo', + 'viewitem' => 'Visualizar :single', + 'id' => 'ID', + 'uploadimage' => 'Carregar imagem', + 'imageuploading' => 'A carregar imagem', + 'uploadfile' => 'Carregar arquivo', + 'fileuploading' => 'Carregar arquivo', + 'none' => 'Nenhum', + 'all' => 'Todos', + 'itemsperpage' => 'itens por página', + 'noresults' => 'Sem Resultados', + 'backtosite' => 'Voltar para o Site', + 'logout' => 'Sair', + + 'previous' => 'anterior', + 'next' => 'próximo', + + 'close' => 'Fechar', + 'delete' => 'Remover', + 'save' => 'Guardar', + 'create' => 'Criar', + 'cancel' => 'Cancelar', + + 'active' => 'Um momento...', + 'success' => 'Sucesso!', + 'error' => 'Ocorreu um erro a executar esta ação.', + + 'valid_columns' => "Precisa de fornecer um array válido em 'columns' em cada configuração dos models.", + 'valid_title' => "Precisa de fornecer um título e nome singular em cada configuração dos models", + 'valid_model' => "Precisa de fornecer uma opção válida em 'model' para cada configuração de models", + 'valid_edit' => "Precisa de fornecer uma opção válida em 'edit_fields' para cada configuração de models", + 'valid_menu' => "Precisa de fornecer uma opção válida em 'menu' no arquivo de configuração administrator.php", + 'valid_config_path' => "Opção inválida em 'model_config_path' no arquivo de configuração administrator.php. O diretório precisa existir e ter permissão de leitura.", + 'not_eloquent' => " não é um model Eloquent", + 'storage_path_permissions' => "O caminho para o storage precisa ter permissão de escrita.", + 'valid_home_page' => "Precisa de fornecer um item de menu válido na opção 'home_page'.", +); + diff --git a/src/lang/pt/knockout.php b/src/lang/pt/knockout.php new file mode 100644 index 000000000..2c6af745c --- /dev/null +++ b/src/lang/pt/knockout.php @@ -0,0 +1,23 @@ + 'Tem certeza que deseja apagar este item? Este processo não é reversível.', + 'saving' => 'A guardar...', + 'saved' => 'Item guardado.', + 'deleting' => 'A remover...', + 'deleted' => 'Item removido.', + 'character_left' => ' caracter a faltar', + 'characters_left' => ' caracteres a faltar', + 'no_results' => 'Nenhum resultado encontrado', + 'select_options' => 'Selecione uma opção', +); From a9982b0a2e19d2989da020cab0ae01d1cf4d75eb Mon Sep 17 00:00:00 2001 From: konomae Date: Fri, 20 Dec 2013 14:15:27 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Adding=20=E2=80=9Cja=E2=80=9D=20locale=20la?= =?UTF-8?q?nguage=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added the japanese translations files for the “ja” locale --- src/lang/ja/administrator.php | 55 +++++++++++++++++++++++++++++++++++ src/lang/ja/knockout.php | 24 +++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/lang/ja/administrator.php create mode 100644 src/lang/ja/knockout.php diff --git a/src/lang/ja/administrator.php b/src/lang/ja/administrator.php new file mode 100644 index 000000000..9a4e7e4a9 --- /dev/null +++ b/src/lang/ja/administrator.php @@ -0,0 +1,55 @@ + 'ダッシュボード', + 'edit' => '編集', + 'filters' => '絞り込み', + 'loading' => '読み込み中...', + 'createnew' => '新規作成', + 'new' => '新規', + 'viewitem' => ':single を表示', + 'id' => 'ID', + 'uploadimage' => '画像のアップロード', + 'imageuploading' => '画像をアップロード中', + 'uploadfile' => 'ファイルをアップロード', + 'fileuploading' => 'ファイルをアップロード中', + 'none' => 'なし', + 'all' => 'すべて', + 'itemsperpage' => 'アイテム/ページ', + 'noresults' => '該当なし', + 'backtosite' => 'サイトに戻る', + 'logout' => 'ログアウト', + + 'previous' => '前へ', + 'next' => '次へ', + + 'close' => '閉じる', + 'delete' => '削除', + 'save' => '保存', + 'create' => '作成', + 'cancel' => 'キャンセル', + + 'active' => 'お待ちください...', + 'success' => '成功!', + 'error' => '操作の実行中にエラーが発生しました', + + 'valid_columns' => "有効な 'columns' 配列を各モデルの設定で指定してください", + 'valid_title' => "有効な title と single 名を各モデルの設定で指定してください", + 'valid_model' => "有効な 'model' オプションを各モデルの設定で指定してください", + 'valid_edit' => "有効な 'edit_fields' 配列を各モデルの設定で指定してください", + 'valid_menu' => "有効な 'menu' オプションを administrator.php の設定で指定してください", + 'valid_config_path' => "有効な 'model_config_path' オプションを administrator.php の設定で指定してください。このディレクトリは存在していてかつ読取可能にしてください。", + 'not_eloquent' => " は Eloquent モデルではありません", + 'storage_path_permissions' => "設定ページを作成するにはストレージパスを書き込み可能にしてください", + 'valid_home_page' => "有効なメニューアイテムを設定ファイルの home_page オプションで指定してください。", +); \ No newline at end of file diff --git a/src/lang/ja/knockout.php b/src/lang/ja/knockout.php new file mode 100644 index 000000000..ac45dd04f --- /dev/null +++ b/src/lang/ja/knockout.php @@ -0,0 +1,24 @@ + '本当にこのアイテムを削除してもよろしいですか? この操作は元に戻せません。', + 'saving' => '保存中...', + 'saved' => 'アイテムを保存しました。', + 'deleting' => '削除中...', + 'deleted' => 'アイテムを削除しました', + 'character_left' => ' 文字残り', + 'characters_left' => ' 文字残り', + 'no_results' => '該当する項目がありません', + 'select_options' => 'オプションを選択', + +); From 57ca72c1a8aa977053095d7eda61fab1b8b3caf7 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sat, 21 Dec 2013 14:15:19 -0800 Subject: [PATCH 3/6] adding laravel 4.1 compatibility (See #414, #419) --- composer.json | 2 +- .../AdministratorServiceProvider.php | 44 +++++++++++-------- src/controllers/AdminController.php | 2 +- src/filters.php | 4 +- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 0c77c30e7..239ae2960 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "require": { "php": ">=5.3.0", - "laravel/framework": ">=4.0.0" + "laravel/framework": "4.*" }, "require-dev": { "mockery/mockery": "0.8.0" diff --git a/src/Frozennode/Administrator/AdministratorServiceProvider.php b/src/Frozennode/Administrator/AdministratorServiceProvider.php index f70c2869d..d3606d308 100644 --- a/src/Frozennode/Administrator/AdministratorServiceProvider.php +++ b/src/Frozennode/Administrator/AdministratorServiceProvider.php @@ -30,6 +30,30 @@ public function boot() //set the locale $this->setLocale(); + //define a constant that the rest of the package can use to conditionally use pieces of Laravel 4.1.x vs. 4.0.x + $this->app['administrator.4.1'] = version_compare(\Illuminate\Foundation\Application::VERSION, '4.1') > -1; + + //set up an alias for the base laravel controller to accommodate >=4.1 and <4.1 + if ($this->app['administrator.4.1']) + class_alias('Illuminate\Routing\Controller', 'AdministratorBaseController'); + else + class_alias('Illuminate\Routing\Controllers\Controller', 'AdministratorBaseController'); + + //include our filters, view composers, and routes + include __DIR__.'/../../filters.php'; + include __DIR__.'/../../viewComposers.php'; + include __DIR__.'/../../routes.php'; + + $this->app['events']->fire('administrator.ready'); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { //the admin validator $this->app['admin_validator'] = $this->app->share(function($app) { @@ -91,23 +115,6 @@ public function boot() { return new Menu($app->make('config'), $app->make('admin_config_factory')); }); - - //include our filters, view composers, and routes - include __DIR__.'/../../filters.php'; - include __DIR__.'/../../viewComposers.php'; - include __DIR__.'/../../routes.php'; - - $this->app['events']->fire('administrator.ready'); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - } /** @@ -117,7 +124,8 @@ public function register() */ public function provides() { - return array(); + return array('admin_validator', 'admin_config_factory', 'admin_field_factory', 'admin_datatable', 'admin_column_factory', + 'admin_action_factory', 'admin_menu'); } /** diff --git a/src/controllers/AdminController.php b/src/controllers/AdminController.php index 8466d8612..9f478f20a 100644 --- a/src/controllers/AdminController.php +++ b/src/controllers/AdminController.php @@ -2,7 +2,7 @@ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Config; -use Illuminate\Routing\Controllers\Controller; +use AdministratorBaseController as Controller; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Request; diff --git a/src/filters.php b/src/filters.php index 34fdd9a3c..f3d8ccca3 100644 --- a/src/filters.php +++ b/src/filters.php @@ -35,7 +35,7 @@ //validate_model filter Route::filter('validate_model', function($route, $request) { - $modelName = $route->getParameter('model'); + $modelName = App::make('administrator.4.1') ? $route->parameter('model') : $route->getParameter('model'); App::singleton('itemconfig', function($app) use ($modelName) { @@ -47,7 +47,7 @@ //validate_settings filter Route::filter('validate_settings', function($route, $request) { - $settingsName = $route->getParameter('settings'); + $settingsName = App::make('administrator.4.1') ? $route->parameter('settings') : $route->getParameter('settings'); App::singleton('itemconfig', function($app) use ($settingsName) { From e839a0110461eba0ec95ce5658ea21cfadfb09cb Mon Sep 17 00:00:00 2001 From: jhampton Date: Sat, 28 Dec 2013 18:51:31 -0500 Subject: [PATCH 4/6] Class name <-> File Name Agreement Re-submitting on the dev branch. --- src/Frozennode/Administrator/Fields/Relationships/HasOne.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Frozennode/Administrator/Fields/Relationships/HasOne.php b/src/Frozennode/Administrator/Fields/Relationships/HasOne.php index 35c02cf7c..4d256bd34 100644 --- a/src/Frozennode/Administrator/Fields/Relationships/HasOne.php +++ b/src/Frozennode/Administrator/Fields/Relationships/HasOne.php @@ -1,6 +1,6 @@ Date: Sat, 4 Jan 2014 15:53:29 -0800 Subject: [PATCH 5/6] updating language list in docs --- src/docs/localization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/localization.md b/src/docs/localization.md index bc5f1c8dc..b69f04c35 100644 --- a/src/docs/localization.md +++ b/src/docs/localization.md @@ -74,7 +74,7 @@ There are no special exceptions in the model config files...so you can localize Administrator currently supports the following languages: -> ca da de en es eu fr hu it nl pl pt-BR ru sr tr zh-CN +> ca da de en es eu fr hu it ja nl pl pt pt-BR ru sr tr zh-CN If you don't see the language you want, [contributing a new language is crazy easy](#contributing)! From 95359adc2c179bf5211fe28f63b3dd6826ac2804 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sat, 4 Jan 2014 15:54:27 -0800 Subject: [PATCH 6/6] version bumping to 4.9.0 --- changelog.md | 5 +++++ readme.md | 16 +++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 258a3b1af..874f7143e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ ## Changelog +### 4.9.0 +- Laravel 4.1 support +- New translations (ja, pt) +- Bugfix: There was a PSR-0 filename/classname disagreement in on of the relatively unused classes (Fields\Relationships\HasOne) + ### 4.8.0 - Anonymous functions can now be passed for custom action title, confirmation, and messages options - It is now possible to return a redirect from custom actions diff --git a/readme.md b/readme.md index 834154735..57f9381c0 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ Administrator is an administrative interface builder for [Laravel](http://larave - **Author:** Jan Hartigan - **Website:** [http://frozennode.com](http://frozennode.com) -- **Version:** 4.8.0 +- **Version:** 4.9.0 [![Build Status](https://travis-ci.org/FrozenNode/Laravel-Administrator.png?branch=master)](https://travis-ci.org/FrozenNode/Laravel-Administrator) @@ -53,13 +53,7 @@ Administrator is released under the MIT License. See the LICENSE file for detail ## Changelog -### 4.8.0 -- Anonymous functions can now be passed for custom action title, confirmation, and messages options -- It is now possible to return a redirect from custom actions -- Selecting an item now scrolls the browser to the top of the page -- It is now possible to return accessor values into the edit form -- Default values can now be set for edit fields -- Bugfix: Custom dashboards no longer include unnecessary js files -- Bugfix: Updated to latest jQuery timepicker addon to fix some legacy jQuery UI bugs -- Bugfix: The detach() method is now used to remove related items instead of delete() -- Bugfix: The bool filter field wasn't properly grabbing results \ No newline at end of file +### 4.9.0 +- Laravel 4.1 support +- New translations (ja, pt) +- Bugfix: There was a PSR-0 filename/classname disagreement in on of the relatively unused classes (Fields\Relationships\HasOne) \ No newline at end of file