Skip to content

feat: Language translations finder and update - #7896

Merged
kenjis merged 46 commits into
codeigniter4:4.5from
neznaika0:feat-4.5-lang-finder
Sep 18, 2023
Merged

feat: Language translations finder and update#7896
kenjis merged 46 commits into
codeigniter4:4.5from
neznaika0:feat-4.5-lang-finder

Conversation

@neznaika0

@neznaika0neznaika0 commented Sep 4, 2023

Copy link
Copy Markdown
Contributor

Description
Supersedes #7889

See thread https://forum.codeigniter.com/showthread.php?tid=88299
Ready to discuss the solution.
Edit #7889: Start with branch 4.5

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjiskenjis added 4.5 new feature PRs for new features labels Sep 4, 2023
@kenjis

kenjis commented Sep 5, 2023

Copy link
Copy Markdown
Member

Tests failed.

https://github.com/codeigniter4/CodeIgniter4/actions/runs/6077247490/job/16498118276?pr=7896

There were 3 failures:
1) CodeIgniter\Commands\Translation\LocalizationFinderTest::testUpdateDefaultLocale
Failed asserting that two arrays are identical.
--- Expected+++ Actual@@ @@
'DESCRIPTION' => 'TranslationOne.DESCRIPTION'
'subTitle' => 'TranslationOne.subTitle'
'overflow_style' => 'TranslationOne.overflow_style'
- 'last_operation_success' => 'TranslationOne.last_operation_success'
'metaTags' => 'TranslationOne.metaTags'
'Copyright' => 'TranslationOne.Copyright'
+ 'last_operation_success' => 'TranslationOne.last_operation_success'
)
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Commands/Translation/LocalizationFinderTest.php:202
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Commands/Translation/LocalizationFinderTest.php:46
phpvfscomposer:///home/runner/work/CodeIgniter4/CodeIgniter4/vendor/phpunit/phpunit/phpunit:106
2) CodeIgniter\Commands\Translation\LocalizationFinderTest::testUpdateWithLocaleOption
Failed asserting that two arrays are identical.
--- Expected+++ Actual@@ @@
'DESCRIPTION' => 'TranslationOne.DESCRIPTION'
'subTitle' => 'TranslationOne.subTitle'
'overflow_style' => 'TranslationOne.overflow_style'
- 'last_operation_success' => 'TranslationOne.last_operation_success'
'metaTags' => 'TranslationOne.metaTags'
'Copyright' => 'TranslationOne.Copyright'
+ 'last_operation_success' => 'TranslationOne.last_operation_success'
)
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Commands/Translation/LocalizationFinderTest.php:202
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Commands/Translation/LocalizationFinderTest.php:58
phpvfscomposer:///home/runner/work/CodeIgniter4/CodeIgniter4/vendor/phpunit/phpunit/phpunit:106
3) CodeIgniter\Commands\Translation\LocalizationFinderTest::testUpdateWithEmptyDirOption
Failed asserting that two arrays are identical.
--- Expected+++ Actual@@ @@
'DESCRIPTION' => 'TranslationOne.DESCRIPTION'
'subTitle' => 'TranslationOne.subTitle'
'overflow_style' => 'TranslationOne.overflow_style'
- 'last_operation_success' => 'TranslationOne.last_operation_success'
'metaTags' => 'TranslationOne.metaTags'
'Copyright' => 'TranslationOne.Copyright'
+ 'last_operation_success' => 'TranslationOne.last_operation_success'
)
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Commands/Translation/LocalizationFinderTest.php:202
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Commands/Translation/LocalizationFinderTest.php:78
phpvfscomposer:///home/runner/work/CodeIgniter4/CodeIgniter4/vendor/phpunit/phpunit/phpunit:106

@neznaika0

Copy link
Copy Markdown
ContributorAuthor

I see. But my test is running.

aleksandr@aleksandr-debian:~/www/codeigniter$ vendor/bin/phpunit --color=always --no-coverage ./tests/system/Commands/Translation/LocalizationFinderTest.php
PHPUnit 9.6.10 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.7
Configuration: /home/aleksandr/www/codeigniter/phpunit.xml.dist
...... 6 / 6 (100%)
Nexus\PHPUnit\Extension\Tachycardia identified these 3 slow tests:
⚠ Took 1.17s from 0.50s limit to run CodeIgniter\\Commands\\Translation\\LocalizationFinderTest::testUpdateDefaultLocale
⚠ Took 1.16s from 0.50s limit to run CodeIgniter\\Commands\\Translation\\LocalizationFinderTest::testUpdateWithLocaleOption
⚠ Took 1.16s from 0.50s limit to run CodeIgniter\\Commands\\Translation\\LocalizationFinderTest::testUpdateWithEmptyDirOption
Time: 00:03.484, Memory: 12.00 MB
OK (6 tests, 18 assertions)

Why isn't there a key when there is one?

@kenjis

Copy link
Copy Markdown
Member

Probably you need to sort the order of the found files.

Comment threadsystem/Commands/Translation/LocalizationFinder.php
Comment threadtests/system/Commands/Translation/LocalizationFinderTest.php Outdated
Comment threadtests/system/Commands/Translation/LocalizationFinderTest.php
Comment threadtests/system/Commands/Translation/LocalizationFinderTest.php Outdated
Comment threaduser_guide_src/source/outgoing/localization.rst Outdated
Comment threaduser_guide_src/source/outgoing/localization.rst Outdated
Comment threaduser_guide_src/source/outgoing/localization.rst Outdated
Comment threaduser_guide_src/source/outgoing/localization.rst Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php
Comment threadsystem/Commands/Translation/LocalizationFinder.php
Comment threadsystem/Commands/Translation/LocalizationFinder.php

@neznaika0neznaika0 left a comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to correct the inaccuracies. And the tests after sorting work.

@kenjis

Copy link
Copy Markdown
Member

Please add an entry for this feature in the changelog Enhancements > Commands.
See https://github.com/codeigniter4/CodeIgniter4/blob/4.5/user_guide_src/source/changelogs/v4.5.0.rst#commands

Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php Outdated
Comment threadsystem/Commands/Translation/LocalizationFinder.php

@kenjiskenjis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kenjis
kenjis merged commit 8a8865b into codeigniter4:4.5Sep 18, 2023
@kenjis

Copy link
Copy Markdown
Member

@neznaika0 Thank you!

@kenjiskenjis mentioned this pull request Oct 31, 2023
5 tasks
@neznaika0neznaika0 mentioned this pull request Jul 5, 2024
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new featurePRs for new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@neznaika0@kenjis@paulbalandan@MGatner