From 1ca403cc6e3d8955fd3bf75c45f5b733db2668d7 Mon Sep 17 00:00:00 2001 From: Everaldo da costa filho Date: Sat, 2 Apr 2022 21:20:17 -0300 Subject: [PATCH 1/2] change: added language pt in configuration, translated validation for pt-br --- database/seeds/SettingsSeeder.php | 1 + readme.md | 1 + resources/lang/pt/validation.php | 132 +++++++++++++++--------------- 3 files changed, 68 insertions(+), 66 deletions(-) diff --git a/database/seeds/SettingsSeeder.php b/database/seeds/SettingsSeeder.php index 55216853..6cd49360 100644 --- a/database/seeds/SettingsSeeder.php +++ b/database/seeds/SettingsSeeder.php @@ -133,6 +133,7 @@ class SettingsSeeder extends Seeder 'sv' => 'Svenska (Swedish)', 'es' => 'Español (Spanish)', 'tr' => 'Türkçe (Turkish)', + 'pt' => 'Português (Brasil)' ]); if ($languages = Setting::find(5)) { $languages->options = $language_options; diff --git a/readme.md b/readme.md index 64aa6549..a578511a 100644 --- a/readme.md +++ b/readme.md @@ -92,6 +92,7 @@ Currently added languages are - Turkish - Russian - Chinese +- Português ## Web Server Configuration diff --git a/resources/lang/pt/validation.php b/resources/lang/pt/validation.php index edc036dd..34a89744 100644 --- a/resources/lang/pt/validation.php +++ b/resources/lang/pt/validation.php @@ -13,80 +13,80 @@ return [ | */ - 'accepted' => 'The :attribute must be accepted.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute may only contain letters.', - 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', - 'alpha_num' => 'The :attribute may only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', - 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', + 'accepted' => 'O :attribute deve ser aceito.', + 'active_url' => 'O :attribute não é uma URL válida.', + 'after' => 'O :attribute deve ser uma data posterior a :date.', + 'after_or_equal' => 'O :attribute deve ser uma data posterior ou igual a :date.', + 'alpha' => 'O :attribute pode conter apenas letras.', + 'alpha_dash' => 'O :attribute pode conter apenas letras, números e traços.', + 'alpha_num' => 'O :attribute pode conter apenas letras e números.', + 'array' => 'O :attribute deve ser um array.', + 'before' => 'O :attribute deve ser uma data anterior a :date.', + 'before_or_equal' => 'O :attribute deve ser uma data anterior ou igual a :date.', 'between' => [ - 'numeric' => 'The :attribute must be between :min and :max.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'string' => 'The :attribute must be between :min and :max characters.', - 'array' => 'The :attribute must have between :min and :max items.', + 'numeric' => 'O :attribute deve estar entre :min e :max.', + 'file' => 'O :attribute deve estar entre :min e :max kilobytes.', + 'string' => 'O :attribute deve estar entre os caracteres :min e :max.', + 'array' => 'O :attribute deve ter entre :min e :max itens.', ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'date' => 'The :attribute is not a valid date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'email' => 'The :attribute must be a valid email address.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', + 'boolean' => 'O campo :attribute deve ser true ou false.', + 'confirmed' => 'A confirmação de :attribute não corresponde.', + 'date' => 'O :attribute não é uma data válida.', + 'date_format' => 'O :attribute não corresponde ao formato :format.', + 'different' => 'O :attribute e :other devem ser diferentes.', + 'digits' => 'O :attribute deve ser :digits dígitos.', + 'digits_between' => 'O :attribute deve estar entre :min e :max dígitos.', + 'dimensions' => 'O :attribute tem dimensões de imagem inválidas.', + 'distinct' => 'O campo :attribute tem um valor duplicado.', + 'email' => 'O :attribute deve ser um endereço de e-mail válido.', + 'exists' => 'O :attribute selecionado é inválido.', + 'file' => 'O :attribute deve ser um arquivo.', + 'filled' => 'O campo :attribute deve ter um valor.', + 'image' => 'O :attribute deve ser uma imagem.', + 'in' => 'O :attribute selecionado é inválido.', + 'in_array' => 'O campo :attribute não existe em :other.', + 'integer' => 'O :attribute deve ser um número inteiro.', + 'ip' => 'O :attribute deve ser um endereço IP válido.', + 'ipv4' => 'O :attribute deve ser um endereço IPv4 válido.', + 'ipv6' => 'O :attribute deve ser um endereço IPv6 válido.', + 'json' => 'O :attribute deve ser uma string JSON válida', 'max' => [ - 'numeric' => 'The :attribute may not be greater than :max.', - 'file' => 'The :attribute may not be greater than :max kilobytes.', - 'string' => 'The :attribute may not be greater than :max characters.', - 'array' => 'The :attribute may not have more than :max items.', + 'numeric' => 'O :attribute não pode ser maior que :max.', + 'file' => 'O :attribute não pode ser maior que :max kilobytes.', + 'string' => 'O :attribute não pode ser maior que :max caracteres.', + 'array' => 'O :attribute não pode ter mais que :max itens.', ], - 'mimes' => 'The :attribute must be a file of type: :values.', - 'mimetypes' => 'The :attribute must be a file of type: :values.', + 'mimes' => 'O :attribute deve ser um arquivo do tipo: :values.', + 'mimetypes' => 'O :attribute deve ser um arquivo do tipo: :values.', 'min' => [ - 'numeric' => 'The :attribute must be at least :min.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'string' => 'The :attribute must be at least :min characters.', - 'array' => 'The :attribute must have at least :min items.', + 'numeric' => 'O :attribute deve ser pelo menos :min.', + 'file' => 'O :attribute deve ter pelo menos :min kilobytes.', + 'string' => 'O :attribute deve ter pelo menos :min caracteres.', + 'array' => 'O :attribute deve ter pelo menos :min itens.', ], - 'not_in' => 'The selected :attribute is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'present' => 'The :attribute field must be present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values is present.', - 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', + 'not_in' => 'O :attribute selecionado é inválido.', + 'numeric' => 'O :attribute deve ser um número.', + 'present' => 'O campo :attribute deve estar presente.', + 'regex' => 'O formato :attribute é inválido.', + 'required' => 'O campo :attribute é obrigatório.', + 'required_if' => 'O campo :attribute é obrigatório quando :other é :value.', + 'required_unless' => 'O campo :attribute é obrigatório, a menos que :other esteja em :values.', + 'required_with' => 'O campo :attribute é obrigatório quando :values está presente.', + 'required_with_all' => 'O campo :attribute é obrigatório quando :values está presente.', + 'required_without' => 'O campo :attribute é obrigatório quando :values não está presente.', + 'required_without_all' => 'O campo :attribute é obrigatório quando nenhum dos :values está presente.', + 'same' => 'O :attribute e :other devem corresponder.', 'size' => [ - 'numeric' => 'The :attribute must be :size.', - 'file' => 'The :attribute must be :size kilobytes.', - 'string' => 'The :attribute must be :size characters.', - 'array' => 'The :attribute must contain :size items.', + 'numeric' => 'O :attribute deve ser :size.', + 'file' => 'O :attribute deve ser :size kilobytes.', + 'string' => 'O :attribute deve ser :size caracteres.', + 'array' => 'O :attribute deve conter :size itens.', ], - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid zone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute format is invalid.', + 'string' => 'O :attribute deve ser uma string.', + 'timezone' => 'O :attribute deve ser uma zona válida.', + 'unique' => 'O :attribute já foi usado.', + 'uploaded' => 'O :attribute falhou ao carregar.', + 'url' => 'O formato :attribute é inválido.', /* |-------------------------------------------------------------------------- From 49b5d57e14e776b3cb6406cb0aba268e20a62550 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Mon, 14 Nov 2022 15:07:22 +0000 Subject: [PATCH 2/2] Delete SettingsSeeder.php --- database/seeds/SettingsSeeder.php | 258 ------------------------------ 1 file changed, 258 deletions(-) delete mode 100644 database/seeds/SettingsSeeder.php diff --git a/database/seeds/SettingsSeeder.php b/database/seeds/SettingsSeeder.php deleted file mode 100644 index 6cd49360..00000000 --- a/database/seeds/SettingsSeeder.php +++ /dev/null @@ -1,258 +0,0 @@ -id = 1; - $setting_group->title = 'app.settings.system'; - $setting_group->order = 0; - $setting_group->save(); - } else { - $setting_group->title = 'app.settings.system'; - $setting_group->save(); - } - if (! $setting_group = SettingGroup::find(2)) { - $setting_group = new SettingGroup; - $setting_group->id = 2; - $setting_group->title = 'app.settings.appearance'; - $setting_group->order = 1; - $setting_group->save(); - } else { - $setting_group->title = 'app.settings.appearance'; - $setting_group->save(); - } - if (! $setting_group = SettingGroup::find(3)) { - $setting_group = new SettingGroup; - $setting_group->id = 3; - $setting_group->title = 'app.settings.miscellaneous'; - $setting_group->order = 2; - $setting_group->save(); - } else { - $setting_group->title = 'app.settings.miscellaneous'; - $setting_group->save(); - } - if (! $setting_group = SettingGroup::find(4)) { - $setting_group = new SettingGroup; - $setting_group->id = 4; - $setting_group->title = 'app.settings.advanced'; - $setting_group->order = 3; - $setting_group->save(); - } else { - $setting_group->title = 'app.settings.advanced'; - $setting_group->save(); - } - - if ($version = Setting::find(1)) { - $version->label = 'app.settings.version'; - $version->value = config('app.version'); - $version->save(); - } else { - $setting = new Setting; - $setting->id = 1; - $setting->group_id = 1; - $setting->key = 'version'; - $setting->type = 'text'; - $setting->label = 'app.settings.version'; - $setting->value = config('app.version'); - $setting->system = true; - $setting->save(); - } - - if (! $setting = Setting::find(2)) { - $setting = new Setting; - $setting->id = 2; - $setting->group_id = 2; - $setting->key = 'background_image'; - $setting->type = 'image'; - $setting->label = 'app.settings.background_image'; - $setting->save(); - } else { - $setting->label = 'app.settings.background_image'; - $setting->save(); - } - if (! $setting = Setting::find(3)) { - $setting = new Setting; - $setting->id = 3; - $setting->group_id = 3; - $setting->key = 'homepage_search'; - $setting->type = 'boolean'; - $setting->label = 'app.settings.homepage_search'; - $setting->save(); - } else { - $setting->label = 'app.settings.homepage_search'; - $setting->save(); - } - - $options = json_encode([ - 'none' => 'app.options.none', - 'google' => 'app.options.google', - 'ddg' => 'app.options.ddg', - 'qwant' => 'app.options.qwant', - 'bing' => 'app.options.bing', - 'startpage' => 'app.options.startpage', - ]); - - if (! $setting = Setting::find(4)) { - $setting = new Setting; - $setting->id = 4; - $setting->group_id = 3; - $setting->key = 'search_provider'; - $setting->type = 'select'; - $setting->options = $options; - $setting->label = 'app.settings.search_provider'; - $setting->save(); - } else { - $setting->options = $options; - $setting->label = 'app.settings.search_provider'; - $setting->save(); - } - - $language_options = json_encode([ - 'de' => 'Deutsch (German)', - 'en' => 'English', - 'cn' => '简体中文 (Simplified Chinese)', - 'fi' => 'Suomi (Finnish)', - 'fr' => 'Français (French)', - 'el' => 'Ελληνικά (Greek)', - 'it' => 'Italiano (Italian)', - 'no' => 'Norsk (Norwegian)', - 'pl' => 'Polski (Polish)', - 'sv' => 'Svenska (Swedish)', - 'es' => 'Español (Spanish)', - 'tr' => 'Türkçe (Turkish)', - 'pt' => 'Português (Brasil)' - ]); - if ($languages = Setting::find(5)) { - $languages->options = $language_options; - $languages->save(); - } else { - $setting = new Setting; - $setting->id = 5; - $setting->group_id = 1; - $setting->key = 'language'; - $setting->type = 'select'; - $setting->label = 'app.settings.language'; - $setting->options = $language_options; - $setting->value = 'en'; - $setting->save(); - } - - $window_target_options = json_encode([ - 'current' => 'app.settings.window_target.current', - 'heimdall' => 'app.settings.window_target.one', - '_blank' => 'app.settings.window_target.new', - ]); - - if (! $setting = Setting::find(7)) { - $setting = new Setting; - $setting->id = 7; - $setting->group_id = 3; - $setting->key = 'window_target'; - $setting->type = 'select'; - $setting->options = $window_target_options; - $setting->label = 'app.settings.window_target'; - $setting->value = 'heimdall'; - $setting->save(); - } else { - $setting->options = $window_target_options; - $setting->label = 'app.settings.window_target'; - $setting->save(); - } - - if ($support = Setting::find(8)) { - $support->label = 'app.settings.support'; - $support->value = 'Discord | Github | Blog'; - $support->save(); - } else { - $setting = new Setting; - $setting->id = 8; - $setting->group_id = 1; - $setting->key = 'support'; - $setting->type = 'text'; - $setting->label = 'app.settings.support'; - $setting->value = 'Discord | Github | Blog'; - $setting->system = true; - $setting->save(); - } - - if ($donate = Setting::find(9)) { - $donate->label = 'app.settings.donate'; - $donate->value = 'Paypal'; - $donate->save(); - } else { - $setting = new Setting; - $setting->id = 9; - $setting->group_id = 1; - $setting->key = 'donate'; - $setting->type = 'text'; - $setting->label = 'app.settings.donate'; - $setting->value = 'Paypal'; - $setting->system = true; - $setting->save(); - } - - if (! $setting = Setting::find(10)) { - $setting = new Setting; - $setting->id = 10; - $setting->group_id = 4; - $setting->key = 'custom_css'; - $setting->type = 'textarea'; - $setting->label = 'app.settings.custom_css'; - $setting->value = ''; - $setting->save(); - } else { - $setting->type = 'textarea'; - $setting->group_id = 4; - $setting->label = 'app.settings.custom_css'; - $setting->save(); - } - - if (! $setting = Setting::find(11)) { - $setting = new Setting; - $setting->id = 11; - $setting->group_id = 4; - $setting->key = 'custom_js'; - $setting->type = 'textarea'; - $setting->label = 'app.settings.custom_js'; - $setting->value = ''; - $setting->save(); - } else { - $setting->type = 'textarea'; - $setting->group_id = 4; - $setting->label = 'app.settings.custom_js'; - $setting->save(); - } - - if (! $home_tag = \App\Item::find(0)) { - $home_tag = new \App\Item; - $home_tag->id = 0; - $home_tag->title = 'app.dashboard'; - $home_tag->pinned = 0; - $home_tag->url = ''; - $home_tag->type = 1; - $home_tag->user_id = 0; - $home_tag->save(); - - $homeapps = \App\Item::withoutGlobalScope('user_id')->doesntHave('parents')->get(); - foreach ($homeapps as $app) { - if ($app->id === 0) { - continue; - } - $app->parents()->attach(0); - } - } - } -}