codeigniter4 / translations

System message translations for CodeIgniter4
https://codeigniter4.github.io/translations/
MIT License
197 stars 206 forks source link

Fix misspelling Persian translations. #249

Closed alirezasalehizadeh closed 2 years ago

kenjis commented 2 years ago

Thank you for your PR!

It seems there are some missing translations. Could you add and translate them?

1) Translations\Tests\FarsiTranslationTest::testAllConfiguredLanguageFilesAreTranslated with data set "fa" ('fa') Failed asserting that language files "CLI.php", "Cast.php", "Cookie.php", "Encryption.php", "Fabricator.php", "Filters.php", "Publisher.php", "RESTful.php", "Security.php", "Test.php" in the main repository are translated in "fa" locale.

2) Translations\Tests\FarsiTranslationTest::testAllConfiguredLanguageKeysAreIncluded with data set "fa" ('fa') Failed asserting that the language keys "Core.enabledZlibOutputCompression", "Core.invalidPhpVersion", "Database.emptyPrimaryKey", "Database.fieldNotExists", "Database.forEmptyInputGiven", "Database.forFindColumnHaveMultipleColumns", "Database.noDateFormat", "Database.noPrimaryKey", "Database.parseStringFail", "Database.tableNotFound", "Email.exitStatus", "Files.expectedDirectory", "Files.expectedFile", "Format.invalidFormatter", "Format.invalidMime", "HTTP.controllerNotFound", "HTTP.emptyController", "HTTP.invalidSameSiteSetting", "HTTP.methodNotFound", "Images.fileNotSupported", "Images.webpNotSupported", "Log.invalidMessageType", "Migrations.added", "Migrations.batch", "Migrations.batchNotFound", "Migrations.filename", "Migrations.generalFault", "Migrations.group", "Migrations.latest", "Migrations.migCreate", "Migrations.migHelpCurrent", "Migrations.migHelpLatest", "Migrations.migHelpRefresh", "Migrations.migHelpRollback", "Migrations.migHelpSeed", "Migrations.migHelpVersion", "Migrations.migInvalidVersion", "Migrations.migMissingSeeder", "Migrations.migNumberError", "Migrations.migSeeder", "Migrations.nameMigration", "Migrations.nameSeeder", "Migrations.namespace", "Migrations.noneFound", "Migrations.on", "Migrations.refreshConfirm", "Migrations.removed", "Migrations.rollBackConfirm", "Migrations.rollingBack", "Migrations.toVersion", "Migrations.toVersionPH", "Migrations.version", "Session.invalidSameSiteSetting", "Time.invalidFormat", "Validation.alpha_numeric_punct", "Validation.equals", "Validation.hex", "Validation.is_not_unique", "Validation.not_equals", "Validation.not_in_list", "Validation.string", "View.invalidCellClass", "View.noCellClass", "View.tagSyntaxError" in the main repository are included for translation in "fa" locale.

alirezasalehizadeh commented 2 years ago

Thank you for your PR!

It seems there are some missing translations. Could you add and translate them?

1) Translations\Tests\FarsiTranslationTest::testAllConfiguredLanguageFilesAreTranslated with data set "fa" ('fa') Failed asserting that language files "CLI.php", "Cast.php", "Cookie.php", "Encryption.php", "Fabricator.php", "Filters.php", "Publisher.php", "RESTful.php", "Security.php", "Test.php" in the main repository are translated in "fa" locale.

2) Translations\Tests\FarsiTranslationTest::testAllConfiguredLanguageKeysAreIncluded with data set "fa" ('fa') Failed asserting that the language keys "Core.enabledZlibOutputCompression", "Core.invalidPhpVersion", "Database.emptyPrimaryKey", "Database.fieldNotExists", "Database.forEmptyInputGiven", "Database.forFindColumnHaveMultipleColumns", "Database.noDateFormat", "Database.noPrimaryKey", "Database.parseStringFail", "Database.tableNotFound", "Email.exitStatus", "Files.expectedDirectory", "Files.expectedFile", "Format.invalidFormatter", "Format.invalidMime", "HTTP.controllerNotFound", "HTTP.emptyController", "HTTP.invalidSameSiteSetting", "HTTP.methodNotFound", "Images.fileNotSupported", "Images.webpNotSupported", "Log.invalidMessageType", "Migrations.added", "Migrations.batch", "Migrations.batchNotFound", "Migrations.filename", "Migrations.generalFault", "Migrations.group", "Migrations.latest", "Migrations.migCreate", "Migrations.migHelpCurrent", "Migrations.migHelpLatest", "Migrations.migHelpRefresh", "Migrations.migHelpRollback", "Migrations.migHelpSeed", "Migrations.migHelpVersion", "Migrations.migInvalidVersion", "Migrations.migMissingSeeder", "Migrations.migNumberError", "Migrations.migSeeder", "Migrations.nameMigration", "Migrations.nameSeeder", "Migrations.namespace", "Migrations.noneFound", "Migrations.on", "Migrations.refreshConfirm", "Migrations.removed", "Migrations.rollBackConfirm", "Migrations.rollingBack", "Migrations.toVersion", "Migrations.toVersionPH", "Migrations.version", "Session.invalidSameSiteSetting", "Time.invalidFormat", "Validation.alpha_numeric_punct", "Validation.equals", "Validation.hex", "Validation.is_not_unique", "Validation.not_equals", "Validation.not_in_list", "Validation.string", "View.invalidCellClass", "View.noCellClass", "View.tagSyntaxError" in the main repository are included for translation in "fa" locale.

Yes, I'll try.

paulbalandan commented 2 years ago

Also, kindly GPG-sign your commits.

kenjis commented 2 years ago

See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/signing.md

paulbalandan commented 2 years ago

@alirezasalehizadeh Will you be able to finish the PR within the day? I need to do a release to catch up with the main repo. It would be nice if your contribution would make it to this release/

alirezasalehizadeh commented 2 years ago

@paulbalandan Not for today, These translations have not been updated for a long time, and there are many missing translations.😅

kenjis commented 2 years ago

@alirezasalehizadeh Coding style check was failed. Fix the style, please.

Probably you can fix by this command:

$ vendor/bin/php-cs-fixer fix --verbose --diff

https://github.com/codeigniter4/translations/runs/4196148051?check_suite_focus=true

Run vendor/bin/php-cs-fixer fix --ansi --verbose --dry-run --using-cache=no
  vendor/bin/php-cs-fixer fix --ansi --verbose --dry-run --using-cache=no
  shell: /usr/bin/bash -e {0}
PHP CS Fixer 3.2.1 Mountains by Fabien Potencier and Dariusz Ruminski
Runtime: PHP 7.3.31-2+ubuntu20.04.1+deb.sury.org+1
Loaded config CodeIgniter4 Coding Standards from "/home/runner/work/translations/translations/.php-cs-fixer.dist.php".
...............................................................  63 / 697 (  9%)
............................................................... 126 / 697 ( 18%)
............................................................... 189 / 697 ( 27%)
............................................................... 252 / 697 ( 36%)
............................................................... 315 / 697 ( 45%)
............................................................... 378 / 697 ( 54%)
............................................................... 441 / 697 ( 63%)
........................................................FFFFFF. 504 / 697 ( 72%)
F.FFFFFFFFFFFF...FFF........................................... 567 / 697 ( 81%)
............................................................... 630 / 697 ( 90%)
............................................................... 693 / 697 ( 99%)
....                                                            697 / 697 (100%)
Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed, E-error
   1) translations/Language/fa/View.php (no_whitespace_in_blank_line, binary_operator_spaces)
   2) translations/Language/fa/Filters.php (no_trailing_whitespace, binary_operator_spaces, single_blank_line_at_eof)
   3) translations/Language/fa/Log.php (no_trailing_whitespace)
   4) translations/Language/fa/CLI.php (single_blank_line_at_eof)
   5) translations/Language/fa/Test.php (no_trailing_whitespace, single_blank_line_at_eof)
   6) translations/Language/fa/Database.php (no_trailing_whitespace, binary_operator_spaces)
   7) translations/Language/fa/Format.php (no_trailing_whitespace, no_whitespace_in_blank_line, binary_operator_spaces)
   8) translations/Language/fa/Security.php (single_blank_line_at_eof)
   9) translations/Language/fa/Fabricator.php (single_blank_line_at_eof)
  10) translations/Language/fa/Cast.php (single_blank_line_at_eof)
  11) translations/Language/fa/Core.php (Nexus/space_after_comment_start, binary_operator_spaces)
  12) translations/Language/fa/Files.php (no_trailing_whitespace, binary_operator_spaces)
  13) translations/Language/fa/Migrations.php (no_trailing_whitespace, binary_operator_spaces)
  14) translations/Language/fa/Time.php (Nexus/space_after_comment_start, no_trailing_whitespace, binary_operator_spaces)
  15) translations/Language/fa/Number.php (no_trailing_whitespace)
  16) translations/Language/fa/Pager.php (no_trailing_whitespace, binary_operator_spaces)
  17) translations/Language/fa/RESTful.php (no_trailing_whitespace, single_blank_line_at_eof)
  18) translations/Language/fa/Cookie.php (no_trailing_whitespace, binary_operator_spaces, single_blank_line_at_eof)
  19) translations/Language/fa/Encryption.php (no_trailing_whitespace, binary_operator_spaces, single_blank_line_at_eof)
  20) translations/Language/fa/HTTP.php (array_indentation, no_extra_blank_lines, binary_operator_spaces)
  21) translations/Language/fa/Validation.php (no_whitespace_in_blank_line, no_extra_blank_lines, binary_operator_spaces)
  22) translations/Language/fa/Publisher.php (no_trailing_whitespace, no_whitespace_before_comma_in_array, no_whitespace_in_blank_line, no_extra_blank_lines, binary_operator_spaces, single_blank_line_at_eof)

Checked all files in 3.416 seconds, 22.000 MB memory used
Error: Process completed with exit code 8.
kenjis commented 2 years ago

@paulbalandan Do we need run code style check on PHP 7.3 and 7.4 and 8.0? It seems only once is enough.

paulbalandan commented 2 years ago

@paulbalandan Do we need run code style check on PHP 7.3 and 7.4 and 8.0? It seems only once is enough.

Hmm. For this repo, I think we can run only on one version. My original intention was that there may be cpde that changes style within versions but given that this is simple code only then I think we can use the highest version available.

kenjis commented 2 years ago

@alirezasalehizadeh Still failing, but reduced.

   1) translations/Language/fa/View.php (binary_operator_spaces)
   2) translations/Language/fa/Filters.php (binary_operator_spaces)
   3) translations/Language/fa/Database.php (binary_operator_spaces)
   4) translations/Language/fa/Format.php (binary_operator_spaces)
   5) translations/Language/fa/Core.php (Nexus/space_after_comment_start, binary_operator_spaces)
   6) translations/Language/fa/Files.php (binary_operator_spaces)
   7) translations/Language/fa/Migrations.php (binary_operator_spaces)
   8) translations/Language/fa/Time.php (Nexus/space_after_comment_start, binary_operator_spaces)
   9) translations/Language/fa/Pager.php (binary_operator_spaces)
  10) translations/Language/fa/Cookie.php (binary_operator_spaces)
  11) translations/Language/fa/Encryption.php (binary_operator_spaces)
  12) translations/Language/fa/HTTP.php (no_extra_blank_lines, binary_operator_spaces)
  13) translations/Language/fa/Validation.php (no_extra_blank_lines, binary_operator_spaces)
  14) translations/Language/fa/Publisher.php (no_extra_blank_lines, binary_operator_spaces)
alirezasalehizadeh commented 2 years ago

@kenjis I fixed all the errors with PHP cs fixer, but I do not know why it gives an error ?!

kenjis commented 2 years ago

@alirezasalehizadeh Did you commit and push everything?

It seems your branch code has coding style errors.

$ vendor/bin/php-cs-fixer -v fix
PHP CS Fixer 3.2.1 Mountains by Fabien Potencier and Dariusz Ruminski
Runtime: PHP 8.0.12
Loaded config CodeIgniter4 Coding Standards from "/Users/kenji/work/codeigniter/codeigniter4-translations/.php-cs-fixer.dist.php".
Using cache file ".php-cs-fixer.cache".
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 104 / 679 ( 15%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 208 / 679 ( 31%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 312 / 679 ( 46%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 416 / 679 ( 61%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 520 / 679 ( 77%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSFFFSFFSSFFFSSSFFSSFSFFSFSSSSSSSSSSSSS 624 / 679 ( 92%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS                                                  679 / 679 (100%)
Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed, E-error
   1) Language/fa/Filters.php (binary_operator_spaces)
   2) Language/fa/Encryption.php (binary_operator_spaces)
   3) Language/fa/Time.php (Nexus/space_after_comment_start, binary_operator_spaces)
   4) Language/fa/Migrations.php (binary_operator_spaces)
   5) Language/fa/Database.php (binary_operator_spaces)
   6) Language/fa/Files.php (binary_operator_spaces)
   7) Language/fa/Cookie.php (binary_operator_spaces)
   8) Language/fa/HTTP.php (no_extra_blank_lines, binary_operator_spaces)
   9) Language/fa/Publisher.php (no_extra_blank_lines, binary_operator_spaces)
  10) Language/fa/View.php (binary_operator_spaces)
  11) Language/fa/Validation.php (no_extra_blank_lines, binary_operator_spaces)
  12) Language/fa/Core.php (Nexus/space_after_comment_start, binary_operator_spaces)
  13) Language/fa/Format.php (binary_operator_spaces)
  14) Language/fa/Pager.php (binary_operator_spaces)

Fixed all files in 0.595 seconds, 16.000 MB memory used
alirezasalehizadeh commented 2 years ago

I also fixed code styles with PHP Intelephense and PHP insights, and as you can see, the PHP cs fixer does not give any errors.

php-cs-fixer -v fix fa

PHP CS Fixer 3.2.1 Mountains by Fabien Potencier and Dariusz Ruminski
Runtime: PHP 8.0.3
Loaded config default.
Using cache file ".php-cs-fixer.cache".
SSSSSSSSSSSSSSSSSSSSSSSSSSS                                                                         27 / 27 (100%)
Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed,
E-error

Fixed all files in 0.008 seconds, 12.000 MB memory used
kenjis commented 2 years ago

It seems you did something wrong.

Try:

$ composer update
$ vendor/bin/php-cs-fixer -v fix
kenjis commented 2 years ago

What are PHP Intelephense and PHP insights?

kenjis commented 2 years ago

And you have untranslated items.

1) Translations\Tests\FarsiTranslationTest::testAllConfiguredLanguageKeysAreIncluded with data set "fa" ('fa')
Failed asserting that the language keys "View.invalidCellClass", "View.noCellClass", "View.tagSyntaxError" in the main repository are included for translation in "fa" locale.
paulbalandan commented 2 years ago

I also fixed code styles with PHP Intelephense and PHP insights, and as you can see, the PHP cs fixer does not give any errors.

php-cs-fixer -v fix fa

PHP CS Fixer 3.2.1 Mountains by Fabien Potencier and Dariusz Ruminski
Runtime: PHP 8.0.3
Loaded config default.
Using cache file ".php-cs-fixer.cache".
SSSSSSSSSSSSSSSSSSSSSSSSSSS                                                                         27 / 27 (100%)
Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed,
E-error

Fixed all files in 0.008 seconds, 12.000 MB memory used

You are using your global installation of php-cs-fixer that why there's no error.