filament icon indicating copy to clipboard operation
filament copied to clipboard

Wrong Norwegian language code (no)

Open Tor2r opened this issue 1 year ago • 6 comments

Package

filament/filament

Package Version

v3.2.111

Laravel Version

v11.22.0

Livewire Version

v3.5.6

PHP Version

PHP 8.3

Problem description

Norway have two written languages, Norsk Bokmål (nb) and Nynorsk (nn). Laravel lang have both of these which translates your Laravel application.

Since Filament uses "no" you wount benefint from these translation, like the validation messages.

When you set your language to "no" Filament is translated as expected, but the rest of your Laravel application is not, and vice versa.

Expected behavior

Setting language to "nb" would translate both Laravel application and Filament.

Steps to reproduce

Install Laravel, Livewire, Filament and Laravel lang. Sett locale to "no" or "nb" Add a user. Log in. Go to "Edit user" Fill in a short password. Validation message would be in another language than the Filament app.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/Tor2r/novsnb

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar

Tor2r avatar Sep 11 '24 21:09 Tor2r

I will gladly pull request a "nb" language to Filament, but I just don't know if that is the correct way to go, since there already is a "no" version.

Tor2r avatar Sep 11 '24 21:09 Tor2r

Hopefully this will be fixed soon.

ekandreas avatar Sep 13 '24 08:09 ekandreas

When using the no language code, which language would you expect, @Tor2r @ekandreas? Would that be Norsk Bokmål or Nynorsk, or doesn't it make sense to use no at all?

Let me know and I can point you in the right direction. I think you should be able to add the right codes in a pull request.

zepfietje avatar Sep 26 '24 10:09 zepfietje

It doesn't make sense at all, since Laravel it self doesn't use "no" it uses "nb" and "nn". Many other packages uses "nb" as well.

Tor2r avatar Sep 30 '24 17:09 Tor2r

Alright, let's add the correct "nb" and "nn" locales then. Should not be breaking if we keep the wrong "no" files around until v4.

Could you work on this, @Tor2r? :)

zepfietje avatar Oct 01 '24 08:10 zepfietje

I'll fix it 👍

Tor2r avatar Oct 01 '24 08:10 Tor2r

This has been renamed in #15121

danharrin avatar Dec 18 '24 12:12 danharrin