Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthed dir + language refactor #1297

Merged
merged 10 commits into from Mar 30, 2024
Merged

Conversation

toastal
Copy link
Contributor

@toastal toastal commented Mar 23, 2024

I didn’t realize that dir was missing & lang wasn’t as robust as it should be--& neither worked for unauthenticated users. And speaking of not being robust, the Regex for language parsing has a bug in where if a user sends a script (such as Serbian that uses both Cyrillic & Latin, with code such as sr-Latn-RS), we can get a bug. That code wasn’t the easiest to read so I did a refactor on the block to use named captures as I think it’s easier to read/follow.

This will likely be easiest to read by commit.

1

Footnotes

  1. Please consider giving up MS GitHub or offering a non-proprietary, non-US-corporate-controlled mirror for this free software project.
    I wish to delete this Microsoft account in the future, but I need more projects like this to support alternative methods to send patches & contribute.

@toastal toastal force-pushed the dir-lang-refactor branch 9 times, most recently from 2516bdc to 62a9c44 Compare March 24, 2024 07:01
@toastal toastal marked this pull request as draft March 24, 2024 12:10
@toastal toastal force-pushed the dir-lang-refactor branch 2 times, most recently from 347a6bd to 0042ab3 Compare March 24, 2024 13:37
@toastal toastal marked this pull request as ready for review March 24, 2024 15:04
src/Movim/i18n/Locale.php Outdated Show resolved Hide resolved
src/Movim/i18n/Locale.php Outdated Show resolved Hide resolved
src/Movim/i18n/Locale.php Outdated Show resolved Hide resolved
@toastal toastal force-pushed the dir-lang-refactor branch 5 times, most recently from 09298bc to 530ae03 Compare March 25, 2024 06:45
@toastal toastal requested a review from edhelas March 25, 2024 06:45
@toastal toastal force-pushed the dir-lang-refactor branch 2 times, most recently from 93c4f62 to 421f926 Compare March 25, 2024 11:33
@toastal toastal force-pushed the dir-lang-refactor branch 6 times, most recently from 05792a0 to 3a82213 Compare March 28, 2024 11:34
@edhelas
Copy link
Member

edhelas commented Mar 28, 2024

[2024-03-28T11:42:34.966935+00:00] movim.ERROR: TypeError: array_values(): Argument #1 ($array) must be of type array, null given in /var/www/html/movim/src/Movim/i18n/Locale.php (line 383)
Trace
#0 /var/www/html/movim/src/Movim/i18n/Locale.php(383): array_values()
#1 /var/www/html/movim/src/Movim/i18n/Locale.php(391): Movim\i18n\Locale::printPOSIX()
#2 /var/www/html/movim/src/Movim/i18n/Locale.php(281): Movim\i18n\Locale::printPo()
#3 /var/www/html/movim/src/Movim/i18n/Locale.php(73): Movim\i18n\Locale->load()
#4 /var/www/html/movim/src/Movim/Console/CompileLanguages.php(30): Movim\i18n\Locale->compilePos()
#5 /var/www/html/movim/vendor/symfony/console/Command/Command.php(326): Movim\Console\CompileLanguages->execute()
#6 /var/www/html/movim/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run()
#7 /var/www/html/movim/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#8 /var/www/html/movim/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#9 /var/www/html/movim/daemon.php(21): Symfony\Component\Console\Application->run()

@edhelas edhelas changed the title Unauth dir + language refactor WIP: Unauth dir + language refactor Mar 28, 2024
@edhelas
Copy link
Member

edhelas commented Mar 28, 2024

I put the branch as WIP as it seems that several things were not tested properly, once you're done please remove the 'WIP' in the title

@toastal toastal changed the title WIP: Unauth dir + language refactor Unauthed dir + language refactor Mar 28, 2024
@toastal
Copy link
Contributor Author

toastal commented Mar 28, 2024

@edhelas Yes, I had accidentally ran a cached version late last night when I ‘tested’ it & saw it running correctly. I was in the middle of fixing it when you caught it. Currently I ran uncached with Brazilian Portuguese & Hebrew being the import test languages (+ region, RTL).

@toastal
Copy link
Contributor Author

toastal commented Mar 28, 2024

One sec. I see I have some things indented not the same as other (EditorConfig couldn’t cover PHP)

@toastal toastal force-pushed the dir-lang-refactor branch 2 times, most recently from d56531f to 1dc53b0 Compare March 28, 2024 15:28
@toastal toastal force-pushed the dir-lang-refactor branch 2 times, most recently from 84fe782 to b97c8d3 Compare March 29, 2024 04:43
@edhelas
Copy link
Member

edhelas commented Mar 30, 2024

@edhelas edhelas merged commit 4f3e6f6 into movim:master Mar 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants