]> BookStack Code Mirror - bookstack/commitdiff
Extracted shortcut text to language files 3830/head
authorDan Brown <redacted>
Thu, 10 Nov 2022 10:25:28 +0000 (10:25 +0000)
committerDan Brown <redacted>
Thu, 10 Nov 2022 10:25:28 +0000 (10:25 +0000)
app/Http/Controllers/UserPreferencesController.php
resources/lang/en/common.php
resources/lang/en/preferences.php [new file with mode: 0644]
resources/views/common/header.blade.php
resources/views/users/preferences/shortcuts.blade.php

index e5ac69818f98ec976b5d8e18a4adc9a3eb22385a..aef95971288986ceb6344d67b8508c66fce84d3f 100644 (file)
@@ -41,7 +41,7 @@ class UserPreferencesController extends Controller
         setting()->putForCurrentUser('ui-shortcuts', $shortcuts->toJson());
         setting()->putForCurrentUser('ui-shortcuts-enabled', $enabled);
 
-        $this->showSuccessNotification('Shortcut preferences have been updated!');
+        $this->showSuccessNotification(trans('preferences.shortcuts_update_success'));
 
         return redirect('/preferences/shortcuts');
     }
index 703a70c7e6aa5bea2b59f7319d4739c5f7162c13..c74dcc90775219416dfe1e56cd0c2d9c577c6f4d 100644 (file)
@@ -25,6 +25,7 @@ return [
     'actions' => 'Actions',
     'view' => 'View',
     'view_all' => 'View All',
+    'new' => 'New',
     'create' => 'Create',
     'update' => 'Update',
     'edit' => 'Edit',
@@ -80,12 +81,14 @@ return [
     'none' => 'None',
 
     // Header
+    'homepage' => 'Homepage',
     'header_menu_expand' => 'Expand Header Menu',
     'profile_menu' => 'Profile Menu',
     'view_profile' => 'View Profile',
     'edit_profile' => 'Edit Profile',
     'dark_mode' => 'Dark Mode',
     'light_mode' => 'Light Mode',
+    'global_search' => 'Global Search',
 
     // Layout tabs
     'tab_info' => 'Info',
diff --git a/resources/lang/en/preferences.php b/resources/lang/en/preferences.php
new file mode 100644 (file)
index 0000000..e9a4746
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * Text used for user-preference specific views within bookstack.
+ */
+
+return [
+    'shortcuts' => 'Shortcuts',
+    'shortcuts_interface' => 'Interface Keyboard Shortcuts',
+    'shortcuts_toggle_desc' => 'Here you can enable or disable keyboard system interface shortcuts, used for navigation and actions.',
+    'shortcuts_customize_desc' => 'You can customize each of the shortcuts below. Just press your desired key combination after selecting the input for a shortcut.',
+    'shortcuts_toggle_label' => 'Keyboard shortcuts enabled',
+    'shortcuts_section_navigation' => 'Navigation',
+    'shortcuts_section_actions' => 'Common Actions',
+    'shortcuts_save' => 'Save Shortcuts',
+    'shortcuts_overlay_desc' => 'Note: When shortcuts are enabled a helper overlay is available via pressing "?" which will highlight the available shortcuts for actions currently visible on the screen.',
+    'shortcuts_update_success' => 'Shortcut preferences have been updated!',
+];
\ No newline at end of file
index dd463b76e6ca97e3b26852691c77f78ef5572287..9fe97b853ae53b7ca491287a0e1b28b9c34c0323 100644 (file)
@@ -93,7 +93,7 @@
                         <li>
                             <a href="{{ url('/preferences/shortcuts') }}" class="icon-item">
                                 @icon('shortcuts')
-                                <div>{{ 'Shortcuts' }}</div>
+                                <div>{{ trans('preferences.shortcuts') }}</div>
                             </a>
                         </li>
                         <li>
index 61c61dcf99e1c5b404f5f415331f12674f52eee3..677892bc61ce6eb33ec0eda76a430418395ecf43 100644 (file)
@@ -8,31 +8,28 @@
                 {{ method_field('put') }}
                 {{ csrf_field() }}
 
-                <h1 class="list-heading">Interface Keyboard Shortcuts</h1>
+                <h1 class="list-heading">{{ trans('preferences.shortcuts_interface') }}</h1>
 
                 <div class="flex-container-row items-center gap-m wrap mb-m">
                     <p class="flex mb-none min-width-m text-small text-muted">
-                        Here you can enable or disable keyboard system interface shortcuts, used for navigation
-                        and actions.
-
-                        You can customize each of the shortcuts below. Just press your desired key combination
-                        after selecting the input for a shortcut.
+                        {{ trans('preferences.shortcuts_toggle_desc') }}
+                        {{ trans('preferences.shortcuts_customize_desc') }}
                     </p>
                     <div class="flex min-width-m text-m-center">
                         @include('form.toggle-switch', [
                             'name' => 'enabled',
                             'value' => $enabled,
-                            'label' => 'Keyboard shortcuts enabled',
+                            'label' => trans('preferences.shortcuts_toggle_label'),
                         ])
                     </div>
                 </div>
 
                 <hr>
 
-                <h2 class="list-heading mb-m">Navigation</h2>
+                <h2 class="list-heading mb-m">{{ trans('preferences.shortcuts_section_navigation') }}</h2>
                 <div class="flex-container-row wrap gap-m mb-xl">
                     <div class="flex min-width-l item-list">
-                        @include('users.preferences.parts.shortcut-control', ['label' => 'Homepage', 'id' => 'home_view'])
+                        @include('users.preferences.parts.shortcut-control', ['label' => trans('common.homepage'), 'id' => 'home_view'])
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('entities.shelves'), 'id' => 'shelves_view'])
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('entities.books'), 'id' => 'books_view'])
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('settings.settings'), 'id' => 'settings_view'])
                     <div class="flex min-width-l item-list">
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('common.view_profile'), 'id' => 'profile_view'])
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('auth.logout'), 'id' => 'logout'])
-                        @include('users.preferences.parts.shortcut-control', ['label' => 'Global Search', 'id' => 'global_search'])
+                        @include('users.preferences.parts.shortcut-control', ['label' => trans('common.global_search'), 'id' => 'global_search'])
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('common.next'), 'id' => 'next'])
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('common.previous'), 'id' => 'previous'])
                     </div>
                 </div>
 
-                <h2 class="list-heading mb-m">Common Actions</h2>
+                <h2 class="list-heading mb-m">{{ trans('preferences.shortcuts_section_actions') }}</h2>
                 <div class="flex-container-row wrap gap-m mb-xl">
                     <div class="flex min-width-l item-list">
                         @include('users.preferences.parts.shortcut-control', ['label' => trans('common.new'), 'id' => 'new'])
                     </div>
                 </div>
 
-                <p class="text-small text-muted">
-                    Note: When shortcuts are enabled a helper overlay is available via pressing "?" which will
-                    highlight the available shortcuts for actions currently visible on the screen.
-                </p>
+                <p class="text-small text-muted">{{ trans('preferences.shortcuts_overlay_desc') }}</p>
 
                 <div class="form-group text-right">
-                    <button class="button">{{ 'Save Shortcuts' }}</button>
+                    <button class="button">{{ trans('preferences.shortcuts_save') }}</button>
                 </div>
 
             </form>