From: Vincent Vanwaelscappel Date: Fri, 29 Sep 2023 10:27:09 +0000 (+0200) Subject: wip #6248 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dfc0fd35cc8de57bf0aba5460b16d8df4dce46e6;p=fluidbook-toolbox.git wip #6248 @1 --- diff --git a/app/Fields/ElearningTranslatedString.php b/app/Fields/ElearningTranslatedString.php new file mode 100644 index 000000000..7a1a1fd3f --- /dev/null +++ b/app/Fields/ElearningTranslatedString.php @@ -0,0 +1,41 @@ +_getOptions(); + } + return self::$__options; + } + + protected function _getOptions() + { + $locale = 'en'; + + $translations = ElearningTranslate::getLocaleTranslations($locale); + $res = []; + foreach ($translations as $k => $translation) { + if ($k === 'k' || $k === 'nsis') { + continue; + } + $res[$translation['str']] = $translation['str']; + } + return $res; + } +} diff --git a/app/Fields/ElearningTranslationOverwrite.php b/app/Fields/ElearningTranslationOverwrite.php new file mode 100644 index 000000000..6b94d94f6 --- /dev/null +++ b/app/Fields/ElearningTranslationOverwrite.php @@ -0,0 +1,16 @@ + \App\SubForms\ElearningTranslationOverwrite::class, "add_label" => __('Nouvelle traduction')]); + } +} diff --git a/app/Models/ElearningTranslate.php b/app/Models/ElearningTranslate.php index b4285a782..5d84a2803 100644 --- a/app/Models/ElearningTranslate.php +++ b/app/Models/ElearningTranslate.php @@ -27,5 +27,7 @@ class ElearningTranslate extends ToolboxContentTranslate 'plural' => 'traductions', 'oneinstance' => true]; + protected static $_permissionBase = 'elearning-translate'; + protected $_operations = [ExcelExportOperation::class, ExcelImportOperation::class]; } diff --git a/app/SubForms/ElearningTranslationOverwrite.php b/app/SubForms/ElearningTranslationOverwrite.php new file mode 100644 index 000000000..1327c641a --- /dev/null +++ b/app/SubForms/ElearningTranslationOverwrite.php @@ -0,0 +1,17 @@ +addField('key', ElearningTranslatedString::class, __('Texte original')); + $this->addField('value', Text::class, __('Nouvelle traduction')); + } +} diff --git a/resources/views/fields/elearning_translation_overwrite.blade.php b/resources/views/fields/elearning_translation_overwrite.blade.php new file mode 100644 index 000000000..15b546271 --- /dev/null +++ b/resources/views/fields/elearning_translation_overwrite.blade.php @@ -0,0 +1,79 @@ +{{-- __('!! Paramètres des fluidbooks') --}} +@if (!isset($seenTranslationOverwrite)) + @php $seenTranslationOverwrite=true;@endphp + @push('crud_fields_scripts') + + @endpush + + @push('crud_fields_styles') + + @endpush +@endif +@include('cubist_back::fields.bunch_keyvalue_multiple') +