]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5851 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Apr 2023 15:18:34 +0000 (17:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Apr 2023 15:18:34 +0000 (17:18 +0200)
app/Console/Commands/ToolboxTranslations.php [new file with mode: 0644]
app/Models/FluidbookTranslate.php
app/Models/ToolboxTranslate.php
config/backpack/base.php
config/debugbar.php
public/packages/fluidbook/toolbox/css/style.less
resources/views/vendor/backpack/base/inc/sidebar_content.blade.php

diff --git a/app/Console/Commands/ToolboxTranslations.php b/app/Console/Commands/ToolboxTranslations.php
new file mode 100644 (file)
index 0000000..00dba77
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Models\ToolboxTranslate;
+use App\Models\Traits\FluidbookPlayerBranches;
+use Cubist\Backpack\Console\Commands\CubistCommand;
+use Cubist\Backpack\Facades\App;
+use Cubist\Locale\Translate;
+use Cubist\Util\PHP;
+
+class ToolboxTranslations extends CubistCommand
+{
+    protected $signature = 'translate:toolbox';
+
+
+    use FluidbookPlayerBranches;
+
+    public function handle()
+    {
+        App::setLocale('en');
+
+        dd(ToolboxTranslate::find(1));
+
+        $paths = [];
+        foreach (self::getActiveBranches() as $branch) {
+            $paths['Player - git:' . $branch] = 'resources/fluidbookpublication/player/branches/' . $branch . '/js';
+            $paths['Player - local:' . $branch] = 'resources/fluidbookpublication/player/local/' . $branch . '/js';
+        }
+
+        $t = new Translate();
+        $t->setExtensions(['js']);
+        foreach ($paths as $path) {
+            $t->addPath(base_path() . '/' . $path);
+        }
+        $t->parseFiles();
+        dd($t->getStringToTranslate());
+    }
+}
index 6c9c6730b45d4af34d72d92484b2a645a5957870..05fc6d1340df45655f1c8898e6612efb865bd76c 100644 (file)
@@ -11,6 +11,7 @@ use App\Models\Traits\FluidbookPlayerBranches;
 use Cubist\Backpack\Facades\App;
 use Cubist\Backpack\Magic\Models\Translate;
 use Cubist\Util\PHP;
+
 // __('!!Traduction des fluidbooks')
 class FluidbookTranslate extends Translate
 {
@@ -43,7 +44,7 @@ class FluidbookTranslate extends Translate
 
     public function setFields()
     {
-        $this->addField(['name' => 'nsis', 'type' => NSISLocale::class, 'label' => __('Langue de l\'installeur'), 'translatable' => true, 'default' => 'English']);
+        $this->addField(['name' => 'nsis', 'type' => NSISLocale::class, 'label' => __('Langue de l\'installeur') . ' (' . __('Version offline windows') . ')', 'translatable' => true, 'default' => 'English']);
         parent::setFields();
     }
 
@@ -146,7 +147,7 @@ class FluidbookTranslate extends Translate
     public static function getFluidbookTranslation($locale)
     {
         $all = self::getAllFluidbookTranslations();
-        $res= $all[$locale] ?? null;
+        $res = $all[$locale] ?? null;
         return $res;
     }
 
index 261eed1fca4dea9fbadba9f6759714d6140e0f4f..7ec0725bc6ff044c1e4c7853519c01927df4b4ec 100644 (file)
@@ -3,6 +3,7 @@
 
 namespace App\Models;
 
+use App\Models\Traits\FluidbookPlayerBranches;
 use Cubist\Backpack\Magic\Models\Translate;
 
 class ToolboxTranslate extends Translate
@@ -14,6 +15,7 @@ class ToolboxTranslate extends Translate
         'plural' => 'traductions',
         'oneinstance' => true];
 
+
     protected $_enableTrackEmptyValues = true;
 
     public function getPaths()
@@ -21,6 +23,13 @@ class ToolboxTranslate extends Translate
         return array_merge(parent::getPaths(), ['vendor/cubedesigners']);
     }
 
+    public function onUpdating(): bool
+    {
+        dd($this);
+
+        return parent::onUpdating();
+    }
+
     protected function _defaultTranslations()
     {
         return ['en' => [
index e0eaa348dde133def8308141be6b5612984ac851..889945f573c32383fcd4b465d7098ca0b7dd6fa4 100644 (file)
@@ -369,4 +369,6 @@ return [
     */
 
     'token_username' => env('BACKPACK_TOKEN_USERNAME', false),
+
+    'locales' => explode(',', env('BACKPACK_LOCALES', 'en')),
 ];
index b34dbe3c05796010e10e935bec1d4ea8c8ab5e48..6d9983192479144937b28667b1b8f83d1cc93218 100644 (file)
@@ -90,7 +90,7 @@ return [
      | Extension, without the server-side code. It uses Debugbar collectors instead.
      |
      */
-    'clockwork' => false,
+    'clockwork' => true,
 
     /*
      |--------------------------------------------------------------------------
index 8810e810b60f82afb615e0545e067ad61c97bba7..01c396455052eea35e11e7c00c7603bc304ebdfb 100644 (file)
@@ -473,6 +473,22 @@ body.embeded {
     box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
 }
 
+table.dataTable thead > tr > th.sorting_asc::before, table.dataTable thead > tr > th.sorting_desc::after, table.dataTable thead > tr > td.sorting_asc::before, table.dataTable thead > tr > td.sorting_desc::after {
+    opacity: 1.0 !important;
+}
+
+table.dataTable thead .sorting::before, table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::before, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::before, table.dataTable thead .sorting_desc::after, table.dataTable thead .sorting_asc_disabled::before, table.dataTable thead .sorting_asc_disabled::after, table.dataTable thead .sorting_desc_disabled::before, table.dataTable thead .sorting_desc_disabled::after {
+    opacity: 0.3 !important;
+}
+
+.table-striped tbody tr:nth-of-type(2n) {
+    background-color: rgba(0, 0, 0, .02);
+}
+
+table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1):hover {
+    background-color: rgba(124, 124, 124, .1);
+}
+
 @import "context-menu";
 @import "loader";
 
index f4e2d9edc9040a2eda079e611a88dec4c2b3f050..0b44195985f6afe771a08354df8640eead3223ff 100644 (file)
             @endcan
             @can('fluidbook-translate:write')
                 <li class="nav-item"><a class="nav-link"
-                                        href='{{ backpack_url('fluidbook-translate/1/edit/?locale=en') }}'><i
+                                        href='{{ backpack_url('fluidbook-translate/1/edit/?_locale=en') }}'><i
                             class='la la-language nav-icon'></i>
                         <span> {{__('Traductions')}}</span></a>
                 </li>
         <ul class='nav-dropdown-items'>
             @can('toolbox-translate:admin')
                 <li class="nav-item"><a class="nav-link"
-                                        href='{{ backpack_url('toolbox-translate/1/edit/?locale=en') }}'><i
+                                        href='{{ backpack_url('toolbox-translate/1/edit/?_locale=en') }}'><i
                             class='la la-language'></i>
                         <span>{{__('Traduction')}}</span></a>
                 </li>