Laravel-Lang / lang

List of 126 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova, Laravel Spark and Laravel UI.

Home Page:https://laravel-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Todo Script : problem of comparaison

caouecs opened this issue · comments

  • Laravel-Lang Version: 8.1.0
  • PHP Version: n/a => Github Actions

Description:

For the Todo script, in French ( but I think it's same for other languages ), it has problem with accent and spaces.

For it, "Réunion" and "Reunion" are same, like "Aland Islands" and "Åland Islands"

We have the same problem with : "Lao People's Democratic Republic" and "Laos"

https://github.com/Laravel-Lang/lang/blob/master/todo/fr.md

Steps To Reproduce:

  • reload todo for French translations

Got it. I will solve this problem.

I submitted a PR. Added check strict.

@caouecs, if I understood correctly, the problem was typing - it was not strict:

protected function hasExclude(string $key, string $locale): bool
{
    return in_array($key, $this->getExcludes($locale)) || in_array($key, $this->getExcludes());
}

I replaced the check with strict:

protected function hasExclude(string $key, string $locale): bool
{
    return in_array($key, $this->getExcludes($locale), true) || in_array($key, $this->getExcludes(), true);
}

Currently, the key translation for Iran is included in the docs/statuses/fr.md file because it is not excluded from processing: excludes/_all.php and excludes/fr.php.