From 0dfb71cfe5ae335a0cdb5d3e3b47c7463a5400e1 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 28 Jan 2025 11:56:10 -0800 Subject: [PATCH 1/3] added some translations to branding and general setrting --- .../lang/en-US/admin/depreciations/general.php | 4 ++++ resources/lang/en-US/admin/settings/general.php | 12 ++++++++++++ resources/views/settings/branding.blade.php | 6 ++++-- resources/views/settings/general.blade.php | 16 ++++++++-------- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/resources/lang/en-US/admin/depreciations/general.php b/resources/lang/en-US/admin/depreciations/general.php index 1a5666f9dc57..4a9a9b8cd11f 100644 --- a/resources/lang/en-US/admin/depreciations/general.php +++ b/resources/lang/en-US/admin/depreciations/general.php @@ -13,4 +13,8 @@ 'no_depreciations_warning' => 'Warning: You do not currently have any depreciations set up. Please set up at least one depreciation to view the depreciation report.', + 'depreciation_method' => 'Depreciation Method', + 'linear_depreciation' => 'Linear (Default)', + 'half_1' => 'Half-year convention, always applied', + 'half_2' => 'Half-year convention, applied with condition', ]; diff --git a/resources/lang/en-US/admin/settings/general.php b/resources/lang/en-US/admin/settings/general.php index 97567df8dfd4..e419a4ad8797 100644 --- a/resources/lang/en-US/admin/settings/general.php +++ b/resources/lang/en-US/admin/settings/general.php @@ -132,6 +132,7 @@ 'login_user_agent' => 'User Agent', 'login_help' => 'List of attempted logins', 'login_note' => 'Login Note', + 'login_note_placeholder' => "If you do not have a login or have found a device belonging to this company, please call technical support at 888-555-1212. Thank you.", 'login_note_help' => 'Optionally include a few sentences on your login screen, for example to assist people who have found a lost or stolen device. This field accepts Github flavored markdown', 'login_remote_user_text' => 'Remote User login options', 'login_remote_user_enabled_text' => 'Enable Login with Remote User Header', @@ -341,6 +342,7 @@ 'setup_migration_create_user' => 'Next: Create User', 'ldap_settings_link' => 'LDAP Settings Page', 'slack_test' => 'Test Integration', + 'status_label_name' => 'Status Label Name', 'label2_enable' => 'New Label Engine', 'label2_enable_help' => 'Switch to the new label engine. Note: You will need to save this setting before setting others.', 'label2_template' => 'Template', @@ -374,6 +376,7 @@ 'database_driver' => 'Database Driver', 'bs_table_storage' => 'Table Storage', 'timezone' => 'Timezone', + 'test_mail' => 'Test Mail', 'profile_edit' => 'Edit Profile', 'profile_edit_help' => 'Allow users to edit their own profiles.', 'default_avatar' => 'Upload custom default avatar', @@ -383,6 +386,15 @@ 'due_checkin_days' => 'Due For Checkin Warning', 'due_checkin_days_help' => 'How many days before the expected checkin of an asset should it be listed in the "Due for checkin" page?', 'no_groups' => 'No groups have been created yet. Visit Admin Settings > Permission Groups to add one.', + 'text' => 'Text', + + + 'logo_option_types' => [ + '0' => trans('text'), + '1' => trans('logo'), + '2' => trans('logo'). ' + '. trans('text'), + ], + /* Keywords for settings overview help */ diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.php index c586917ef534..d090f1337684 100644 --- a/resources/views/settings/branding.blade.php +++ b/resources/views/settings/branding.blade.php @@ -59,7 +59,9 @@ - + @php + $optionTypes = trans('admin/settings/general.logo_option_types'); + @endphp
@@ -67,7 +69,7 @@ {{ Form::label('brand', trans('admin/settings/general.web_brand')) }}
- {!! Form::select('brand', array('1'=>'Text','2'=>'Logo','3'=>'Logo + Text'), old('brand', $setting->brand), array('class' => 'form-control select2', 'style'=>'width: 150px ;')) !!} + {!! Form::select('brand', array($optionTypes), old('brand', $setting->brand), ['class' => 'form-control select2', 'style' => 'width: 150px;']) !!} {!! $errors->first('brand', '') !!}
diff --git a/resources/views/settings/general.blade.php b/resources/views/settings/general.blade.php index 1de5d4035d85..46dfd1693530 100644 --- a/resources/views/settings/general.blade.php +++ b/resources/views/settings/general.blade.php @@ -241,11 +241,11 @@
@if (config('app.lock_passwords')) - + {!! $errors->first('login_note', '') !!}

{{ trans('general.feature_disabled') }}

@else - + {!! $errors->first('login_note', '') !!} @endif

{!! trans('admin/settings/general.login_note_help') !!}

@@ -255,7 +255,7 @@ @@ -369,13 +369,13 @@
- {{ Form::label('depreciation_method', trans('Depreciation method')) }} + {{ Form::label('depreciation_method', trans('admin/depreciations/general.depreciation_method')) }}
{{ Form::select('depreciation_method', array( - 'default' => 'Linear (default)', - 'half_1' => 'Half-year convention, always applied', - 'half_2' => 'Half-year convention, applied with condition', + 'default' => trans('admin/depreciations/general.linear_depreciation'), + 'half_1' => trans('admin/depreciations/general.half_1'), + 'half_2' => trans('admin/depreciations/general.half_2'), ), old('username_format', $setting->depreciation_method), ['class' =>'select2', 'style' => 'width: 80%']) }}
From 2163312997ac8a347723bf98aa618685ce6d0d58 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 29 Jan 2025 10:35:26 -0800 Subject: [PATCH 2/3] adds translations for branding and general settings --- .../lang/en-US/admin/settings/general.php | 9 ++++--- resources/views/settings/branding.blade.php | 27 +++++++++++-------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/resources/lang/en-US/admin/settings/general.php b/resources/lang/en-US/admin/settings/general.php index e419a4ad8797..cb028de3e060 100644 --- a/resources/lang/en-US/admin/settings/general.php +++ b/resources/lang/en-US/admin/settings/general.php @@ -42,6 +42,7 @@ 'confirm_purge' => 'Confirm Purge', 'confirm_purge_help' => 'Enter the text "DELETE" in the box below to purge your deleted records. This action cannot be undone and will PERMANENTLY delete all soft-deleted items and users. (You should make a backup first, just to be safe.)', 'custom_css' => 'Custom CSS', + 'custom_css_placeholder' => 'Add your custom CSS', 'custom_css_help' => 'Enter any custom CSS overrides you would like to use. Do not include the <style></style> tags.', 'custom_forgot_pass_url' => 'Custom Password Reset URL', 'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.', @@ -69,6 +70,7 @@ 'favicon_size' => 'Favicons should be square images, 16x16 pixels.', 'footer_text' => 'Additional Footer Text ', 'footer_text_help' => 'This text will appear in the right-side footer. Links are allowed using
Github flavored markdown. Line breaks, headers, images, etc may result in unpredictable results.', + 'footer_text_placeholder' => 'Optional footer text', 'general_settings' => 'General Settings', 'general_settings_help' => 'Default EULA and more', 'generate_backup' => 'Generate Backup', @@ -343,6 +345,7 @@ 'ldap_settings_link' => 'LDAP Settings Page', 'slack_test' => 'Test Integration', 'status_label_name' => 'Status Label Name', + 'super_admin_only' => 'Super Admin Only', 'label2_enable' => 'New Label Engine', 'label2_enable_help' => 'Switch to the new label engine. Note: You will need to save this setting before setting others.', 'label2_template' => 'Template', @@ -390,9 +393,9 @@ 'logo_option_types' => [ - '0' => trans('text'), - '1' => trans('logo'), - '2' => trans('logo'). ' + '. trans('text'), + 'text' => 'Text', + 'logo' => 'Logo', + 'logo_and_text' => 'Logo and Text', ], diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.php index d090f1337684..c848ae942be0 100644 --- a/resources/views/settings/branding.blade.php +++ b/resources/views/settings/branding.blade.php @@ -66,11 +66,16 @@
- {{ Form::label('brand', trans('admin/settings/general.web_brand')) }} +
- {!! Form::select('brand', array($optionTypes), old('brand', $setting->brand), ['class' => 'form-control select2', 'style' => 'width: 150px;']) !!} - {!! $errors->first('brand', '') !!} +
@@ -235,11 +240,11 @@
@if (config('app.lock_passwords')===true) - {{ Form::textarea('custom_css', old('custom_css', $setting->custom_css), array('class' => 'form-control','placeholder' => 'Add your custom CSS','disabled'=>'disabled', 'aria-label'=>'custom_css')) }} + {{ Form::textarea('custom_css', old('custom_css', $setting->custom_css), array('class' => 'form-control','placeholder' => trans('admin/settings/general.custom_css_placeholder'),'disabled'=>'disabled', 'aria-label'=>'custom_css')) }} {!! $errors->first('custom_css', '') !!}

{{ trans('general.feature_disabled') }}

@else - {{ Form::textarea('custom_css', old('custom_css', $setting->custom_css), array('class' => 'form-control','placeholder' => 'Add your custom CSS', 'aria-label'=>'custom_css')) }} + {{ Form::textarea('custom_css', old('custom_css', $setting->custom_css), array('class' => 'form-control','placeholder' => trans('admin/settings/general.custom_css_placeholder'), 'aria-label'=>'custom_css')) }} {!! $errors->first('custom_css', '') !!} @endif

{!! trans('admin/settings/general.custom_css_help') !!}

@@ -254,10 +259,10 @@
@if (config('app.lock_passwords')===true) - {!! Form::select('support_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), old('support_footer', $setting->support_footer), ['class' => 'form-control select2 disabled', 'style'=>'width: 150px ;', 'disabled' => 'disabled']) !!} + {!! Form::select('support_footer', array('on'=>trans('admin/settings/general.enabled'),'off'=>trans('admin/settings/general.two_factor_disabled'),'admin'=>trans('admin/settings/general.super_admin_only')), old('support_footer', $setting->support_footer), ['class' => 'form-control select2 disabled', 'style'=>'width: 150px ;', 'disabled' => 'disabled']) !!}

{{ trans('general.feature_disabled') }}

@else - {!! Form::select('support_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), old('support_footer', $setting->support_footer), array('class' => 'form-control select2', 'style'=>'width: 150px ;')) !!} + {!! Form::select('support_footer', array('on'=>trans('admin/settings/general.enabled'),'off'=>trans('admin/settings/general.two_factor_disabled'),'admin'=>trans('admin/settings/general.super_admin_only')), old('support_footer', $setting->support_footer), array('class' => 'form-control select2', 'style'=>'width: 150px ;')) !!} @endif @@ -273,10 +278,10 @@
@if (config('app.lock_passwords')===true) - {!! Form::select('version_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), old('version_footer', $setting->version_footer), ['class' => 'form-control select2 disabled', 'style'=>'width: 150px ;', 'disabled' => 'disabled']) !!} + {!! Form::select('version_footer', array('on'=>trans('admin/settings/general.enabled'),'off'=>trans('admin/settings/general.two_factor_disabled'),'admin'=>trans('admin/settings/general.super_admin_only')), old('version_footer', $setting->version_footer), ['class' => 'form-control select2 disabled', 'style'=>'width: 150px ;', 'disabled' => 'disabled']) !!}

{{ trans('general.feature_disabled') }}

@else - {!! Form::select('version_footer', array('on'=>'Enabled','off'=>'Disabled','admin'=>'Superadmin Only'), old('version_footer', $setting->version_footer), array('class' => 'form-control select2', 'style'=>'width: 150px ;')) !!} + {!! Form::select('version_footer', array('on'=>trans('admin/settings/general.enabled'),'off'=>trans('admin/settings/general.two_factor_disabled'),'admin'=>trans('admin/settings/general.super_admin_only')), old('version_footer', $setting->version_footer), array('class' => 'form-control select2', 'style'=>'width: 150px ;')) !!} @endif

{{ trans('admin/settings/general.version_footer_help') }}

@@ -291,10 +296,10 @@
@if (config('app.lock_passwords')===true) - {{ Form::textarea('footer_text', old('footer_text', $setting->footer_text), array('class' => 'form-control', 'rows' => '4', 'placeholder' => 'Optional footer text','disabled'=>'disabled')) }} + {{ Form::textarea('footer_text', old('footer_text', $setting->footer_text), array('class' => 'form-control', 'rows' => '4', 'placeholder' => trans('admin/settings/general.footer_text_placeholder'),'disabled'=>'disabled')) }}

{{ trans('general.feature_disabled') }}

@else - {{ Form::textarea('footer_text', old('footer_text', $setting->footer_text), array('class' => 'form-control','rows' => '4','placeholder' => 'Optional footer text')) }} + {{ Form::textarea('footer_text', old('footer_text', $setting->footer_text), array('class' => 'form-control','rows' => '4','placeholder' => trans('admin/settings/general.footer_text_placeholder'))) }} @endif

{!! trans('admin/settings/general.footer_text_help') !!}

{!! $errors->first('footer_text', '') !!} From 16d322d70e64fd77c5dfe5e5d5573191c04adc64 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 29 Jan 2025 10:38:30 -0800 Subject: [PATCH 3/3] fix translation --- resources/views/settings/branding.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.php index c848ae942be0..200afb4c5452 100644 --- a/resources/views/settings/branding.blade.php +++ b/resources/views/settings/branding.blade.php @@ -66,7 +66,7 @@
- +