Closed kasperwandahl closed 3 years ago
My mistake. For anyone having the same issue this package takes the locale from the config/app.php
which in my case was en
. If I do setLocale(navigator.language)
in app.js
it sets the language based on the browser locale. If users browser is in an unsupported locale, it should fallback to fallback_locale
from config/app.php
.
Expected behavior
I've installed this in laravel project with jetstream.
composer require genl/matice
andnpm install matice
app.js
da
andda-DK
and would expect this work when my browser isda-DK
So basics issue is: Matice getLocale() should return same language as
window.navigator.language
ornavigator.language
Current behavior
For debugging I put these in app.js
console.log(`Vue locale ${getLocale()}, browser locale ${navigator.language}`)
console.log(locales())
with this result:Vue locale en, browser locale da-DK
["da", "da-DK", "en"]
The english translation works and it is being updated whenever I change something, but I can't get it to display the danish translation. It might very well be a mistake I made myself, but I can't pinpoint where it is.
Versions
Translations
resources/lang/da-DK/dashboard.php
and same content forresources/lang/da/dashboard.php
Contents of
Matice.translations