matice
matice copied to clipboard
Labels don't update until matice_translations.js deletion
Expected behavior
[PRODUCTION ENV] I've created a fully working locale selector that does another action in addition to calling setLocale(locale). The expected behavior is that when i refresh the page (after changing the locale), i want to see the updated labels, localized in the selected language.
Current behavior
[PRODUCTION ENV] When i change the locale, my locale selector works fine, it does call setLocale(locale) and does what i want it to do, but the labels don't change. To make them change, i need to delete matice_translations.js
Versions
- Laravel: v8.60.0
- Matice: 1.1.6
Translations
['greet' => 'It greets the wrong way.']
trans('greet') // Something strange.
Contents of Matice.translations
const Matice = {
locale: 'it',
fallbackLocale: 'en',
translations: {"en":{"addFriends":{"title":"Add friends","search-ph":"Enter at least 3 characters of a user's username","users-found":"Users found","no-users":"No users found","received-requests":"Received requests","friends":"Friends","sent-requests":"Sent requests","messages":{"user-not-found":"User not found","added-friend":"Friend added successfully!","request-sent":"Request sent","already-in-touch":"You're already in touch!","reply-sent":"Reply sent successfully!","removed-friend":"Friend removed"},"user-card":{"reject":"Reject","accept":"Accept","friends":"Friends","request-sent":"Request sent","request-received":"Request received","request-rejected":"Request rejected","add":"Add"}},"app":{"name":"Let's","motto":"Together's better","error-title":"Oops, something went wrong","nav":{"home":"Home","add-friends":"Add friends"},"locales":{"en":"English","it":"Italiano"},"account-menu":{"manage":"Manage account","profile":"Profile","thoughts":"Thoughts","friends":"Friends","notifications":"Notifications","profile-settings":"Settings","api":"API credentials","logout":"Logout"}},"auth":{"failed":"These credentials do not match our records.","password":"The provided password is incorrect.","throttle":"Too many login attempts. Please try again in :seconds seconds.","login":{"title":"Login","email-or-username":"Email or Username","password":"Password","remember-me":"Remember me","forgot-password":"Forgot your password?","login":"Login","register":"Not registered yet? <strong><a href=\":url\">Register now!<\/a><\/strong>","2fa-title":"Two-Factor Authentication","2fa-code":"Auth code","2fa-code-text":"Please confirm access to your account by entering the authentication code provided by your authenticator application.","2fa-use-recovery-code":"Use recovery code","2fa-recovery-code":"Recovery code","2fa-recovery-code-text":"Please confirm access to your account by entering one of your emergency recovery codes.","2fa-use-code":"Use auth code"},"forgot-password":{"title":"Forgot password","text":"Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.","email":"Email","send":"Send link"},"verify-email":{"title":"Email Verification","text":"Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.","new-sending":"A new verification link has been sent to the email address you provided during registration.","resend":"Resend Verification Email","logout":"Logout"},"register":{"title":"Register","username":"Username","email":"Email","password":"Password","confirm-password":"Confirm password","read-policies":"I agree to the <a target=\"_blank\" href=\":termsUrl\" class=\"underline text-sm text-gray-600 hover:text-gray-900\">Terms of Service<\/a> and <a target=\"_blank\" href=\":privacyUrl\" class=\"underline text-sm text-gray-600 hover:text-gray-900\">Privacy Policy<\/a>","register":"Register","login":"Already registered?"},"reset-password":{"email":"Email","password":"Password","confirm-password":"Confirm password","reset-password":"Reset password"}},"friends":{"title":"Friends","friends":"Friends","no-friends":"No friends yet","friends-for":"Friends for","less-than-day":"less than a day","days":"[0,1]day|[2,*]days","months":"[0,1]month|[2,*]months","years":"[0,1]year|[2,*]years"},"notifications":{"title":"Notifications","no-notifications":"No notifications","load-more":"Load more","friendships":{"new-friend":"<strong>@:username<\/strong> added you as a friend!","new-friend-telegram":"**:username** added you as a friend!","new-friend-request":"<strong>@:username<\/strong> sent you a friend request","new-friend-request-telegram":"**:username** sent you a friend request","request-accepted":"<strong>@:username<\/strong> accepted your friend request!","request-accepted-telegram":"**:username** accepted your friend request!","go-to-profile":"Go to profile"}},"pagination":{"previous":"« Previous","next":"Next »"},"passwords":{"reset":"Your password has been reset!","sent":"We have emailed your password reset link!","throttled":"Please wait before retrying.","token":"This password reset token is invalid.","user":"We can't find a user with that email address."},"profile":{"title":"Profile","informations":{"title":"Informations","text":"Update your account's profile information and email address.","photo":"Profile photo","select-new-photo":"Change profile photo","remove-photo":"Remove profile photo","name":"Name","username":"Username","email":"Email"},"bio":{"title":"Bio","text":"Update your bio"},"phone":{"title":"Phone","text":"Update your account's phone number."},"password":{"title":"Update password","text":"Ensure your account is using a long, random password to stay secure.","current":"Current password","new":"New password","confirm":"Confirm new password"},"2fa":{"title":"Two Factor Authentication","text":"Add additional security to your account using two factor authentication.","not-enabled-title":"You have not enabled two factor authentication.","not-enabled-text":"When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application.","enable":"Enable","enabled-title":"You have enabled two factor authentication.","enabled-text":"When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application.","qr-text":"Two factor authentication is now enabled. Scan the following QR code using your phone's authenticator application.","recovery-codes-text":"Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.","recovery-codes-show":"Show recovery codes","recovery-codes-regenerate":"Regenerate recovery codes","disable":"Disable"},"sessions":{"title":"Sessions","text":"Manage and log out your active sessions on other browsers and devices.","logout-text":"If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.","logout-button":"Logout other browser sessions","this-device":"This device","last-active":"Last active","confirm-text":"Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.","password":"Password","cancel":"Cancel","done":"Done"},"delete":{"title":"Delete account","text":"Permanently delete your account.","delete-text":"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.","button":"Delete account","password":"Password","cancel":"Cancel","confirm-text":"Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account. "},"settings":{"title":"Settings - Profile","locale-title":"Localization","locale-text":"Choose your language","visibility-title":"Visibility","visibility-text":"You have full control over the visibility of your profile and all of its parts","profile-visibility-title":"Profile","profile-visibility-text":"Choose to make your profile private or public","email-visibility-title":"Email","email-visibility-text":"Choose to make your email visible on your profile","bio-visibility-title":"Bio","bio-visibility-text":"Choose to make your bio visible on your profile","phone-visibility-title":"Phone","phone-visibility-text":"Choose to make your phone visible on your profile","public":"Public","private":"Private","visible":"Visible","hidden":"Hidden","telegram-title":"Telegram","telegram-text":"Enter your Telegram ID to receive your notifications on Telegram","telegram-id-title":"Telegram ID","telegram-id-text":"Click on the following link to start the conversation with our official bot. Once the conversation starts, the bot will tell you what your ID is. After that, you can copy and paste it into the field below","privacy-title":"Privacy","privacy-text":"You also have full control over your privacy settings"},"confirms-password":{"cancel":"Cancel","title":"Confirm Password","content":"For your security, please confirm your password to continue.","button":"Confirm"},"messages":{"update-profile":{"success":"Profile updated correctly","error":"There was an error, try again later"},"bio-updated":"Bio updated","phone-updated":"Phone updated","visibility-updated":"Visibility updated","privacy-updated":"Privacy updated","telegram-updated":"Telegram ID updated"},"save":"Save","saved":"Saved"},"thoughts":{"title":"Thoughts","thoughts":"Thoughts","add-tought-ph":"Write down your thought to share it with others...","no-thoughts":"No thoughts yet","load-more":"Load more","publish":"Publish","messages":{"thought-added":"Thought added successfully!"}},"user":{"friends-for":"Friends for","request-already-sent":"You've sent a request to <strong class=\"text-primary\">@:username<\/strong>","answer-request":"Answer <strong class=\"text-primary\">@:username<\/strong>'s request","revert-request-text":"You've rejected <strong class=\"text-primary\">@:username<\/strong>'s request, but you can think again whenever you want by clicking on the button below","revert-request-button":"Add @:username to your friends","remove-friend":"Remove friend","remove-confirm-text":"Are you sure you want to remove <span class=\"font-bold mt-3 text-primary\">@:username<\/span> from your friends?","remove-friend-cancel-button":"No, I have second thoughts","remove-friend-confirm-button":"Yes, remove from friends","remove":"Remove from friends","reject":"Reject","accept":"Accept"},"validation":{"accepted":"The :attribute must be accepted.","accepted_if":"The :attribute must be accepted when :other is :value.","active_url":"The :attribute is not a valid URL.","after":"The :attribute must be a date after :date.","after_or_equal":"The :attribute must be a date after or equal to :date.","alpha":"The :attribute must only contain letters.","alpha_dash":"The :attribute must only contain letters, numbers, dashes and underscores.","alpha_num":"The :attribute must only contain letters and numbers.","array":"The :attribute must be an array.","before":"The :attribute must be a date before :date.","before_or_equal":"The :attribute must be a date before or equal to :date.","between":{"numeric":"The :attribute must be between :min and :max.","file":"The :attribute must be between :min and :max kilobytes.","string":"The :attribute must be between :min and :max characters.","array":"The :attribute must have between :min and :max items."},"boolean":"The :attribute field must be true or false.","confirmed":"The :attribute confirmation does not match.","current_password":"The password is incorrect.","date":"The :attribute is not a valid date.","date_equals":"The :attribute must be a date equal to :date.","date_format":"The :attribute does not match the format :format.","different":"The :attribute and :other must be different.","digits":"The :attribute must be :digits digits.","digits_between":"The :attribute must be between :min and :max digits.","dimensions":"The :attribute has invalid image dimensions.","distinct":"The :attribute field has a duplicate value.","email":"The :attribute must be a valid email address.","ends_with":"The :attribute must end with one of the following: :values.","exists":"The selected :attribute is invalid.","file":"The :attribute must be a file.","filled":"The :attribute field must have a value.","gt":{"numeric":"The :attribute must be greater than :value.","file":"The :attribute must be greater than :value kilobytes.","string":"The :attribute must be greater than :value characters.","array":"The :attribute must have more than :value items."},"gte":{"numeric":"The :attribute must be greater than or equal :value.","file":"The :attribute must be greater than or equal :value kilobytes.","string":"The :attribute must be greater than or equal :value characters.","array":"The :attribute must have :value items or more."},"image":"The :attribute must be an image.","in":"The selected :attribute is invalid.","in_array":"The :attribute field does not exist in :other.","integer":"The :attribute must be an integer.","ip":"The :attribute must be a valid IP address.","ipv4":"The :attribute must be a valid IPv4 address.","ipv6":"The :attribute must be a valid IPv6 address.","json":"The :attribute must be a valid JSON string.","lt":{"numeric":"The :attribute must be less than :value.","file":"The :attribute must be less than :value kilobytes.","string":"The :attribute must be less than :value characters.","array":"The :attribute must have less than :value items."},"lte":{"numeric":"The :attribute must be less than or equal :value.","file":"The :attribute must be less than or equal :value kilobytes.","string":"The :attribute must be less than or equal :value characters.","array":"The :attribute must not have more than :value items."},"max":{"numeric":"The :attribute must not be greater than :max.","file":"The :attribute must not be greater than :max kilobytes.","string":"The :attribute must not be greater than :max characters.","array":"The :attribute must not have more than :max items."},"mimes":"The :attribute must be a file of type: :values.","mimetypes":"The :attribute must be a file of type: :values.","min":{"numeric":"The :attribute must be at least :min.","file":"The :attribute must be at least :min kilobytes.","string":"The :attribute must be at least :min characters.","array":"The :attribute must have at least :min items."},"multiple_of":"The :attribute must be a multiple of :value.","not_in":"The selected :attribute is invalid.","not_regex":"The :attribute format is invalid.","numeric":"The :attribute must be a number.","password":"The password is incorrect.","present":"The :attribute field must be present.","regex":"The :attribute format is invalid.","required":"The :attribute field is required.","required_if":"The :attribute field is required when :other is :value.","required_unless":"The :attribute field is required unless :other is in :values.","required_with":"The :attribute field is required when :values is present.","required_with_all":"The :attribute field is required when :values are present.","required_without":"The :attribute field is required when :values is not present.","required_without_all":"The :attribute field is required when none of :values are present.","prohibited":"The :attribute field is prohibited.","prohibited_if":"The :attribute field is prohibited when :other is :value.","prohibited_unless":"The :attribute field is prohibited unless :other is in :values.","prohibits":"The :attribute field prohibits :other from being present.","same":"The :attribute and :other must match.","size":{"numeric":"The :attribute must be :size.","file":"The :attribute must be :size kilobytes.","string":"The :attribute must be :size characters.","array":"The :attribute must contain :size items."},"starts_with":"The :attribute must start with one of the following: :values.","string":"The :attribute must be a string.","timezone":"The :attribute must be a valid timezone.","unique":"The :attribute has already been taken.","uploaded":"The :attribute failed to upload.","url":"The :attribute must be a valid URL.","uuid":"The :attribute must be a valid UUID.","custom":{"attribute-name":{"rule-name":"custom-message"}},"attributes":[]}},"it":{"addFriends":{"title":"Aggiungi amici","search-ph":"Inserisci almeno 3 caratteri dello username di un utente","users-found":"Utenti trovati","no-users":"Nessun utente trovato","received-requests":"Richieste ricevute","friends":"Amici","sent-requests":"Richieste inviate","messages":{"user-not-found":"Utente non trovato","added-friend":"Amico aggiunto con successo!","request-sent":"Richiesta inviata","already-in-touch":"Siete gi\u00e0 in contatto!","reply-sent":"Risposta inviata con successo!","removed-friend":"Amico rimosso"},"user-card":{"reject":"Rifiuta","accept":"Accetta","friends":"Amici","request-sent":"Richiesta inviata","request-received":"Richiesta ricevuta","request-rejected":"Richiesta rifiutata","add":"Aggiungi"}},"app":{"name":"Let's","motto":"Insieme \u00e8 meglio","error-title":"Ops, qualcosa \u00e8 andato storto","nav":{"home":"Home","add-friends":"Aggiungi amici"},"locales":{"en":"English","it":"Italiano"},"account-menu":{"manage":"Gestisci account","profile":"Profilo","thoughts":"Pensieri","friends":"Amici","notifications":"Notifiche","profile-settings":"Impostazioni","api":"Credenziali API","logout":"Esci"}},"auth":{"failed":"Credenziali errate","password":"Password errata","throttle":"Troppi tentativi di accesso. Per favore riprova in :seconds secondi","login":{"title":"Accedi","email-or-username":"Email o Username","password":"Password","remember-me":"Ricordami","forgot-password":"Password dimenticata?","login":"Accedi","register":"Non hai ancora un account? <strong><a href=\":url\">Registrati ora!<\/a><\/strong>","2fa-title":"Autenticazione a 2 fattori","2fa-code":"Codice di autenticazione","2fa-code-text":"Conferma l'accesso al tuo account inserendo il codice di autenticazione fornito dalla tua app authenticator","2fa-use-recovery-code":"Usa recovery code","2fa-recovery-code":"Recovery code","2fa-recovery-code-text":"Conferma l'accesso al tuo account inserendo uno dei tuoi recovery code di emergenza","2fa-use-code":"Usa codice di autenticazione"},"forgot-password":{"title":"Password dimenticata","text":"Password dimenticata? Nessun problema! Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.","email":"Email","send":"Invia link"},"verify-email":{"title":"Verifica email","text":"Grazie per esserti registrato! Prima di iniziare, potresti verificare la tua email cliccando sul link che ti abbiamo inviato? Se non l'hai ricevuto, te ne mandiamo un altro volentieri!","new-sending":"Un nuovo link di verifica \u00e8 stato inviato all'indirizzo email che ci hai fornito in fase di registrazione","resend":"Invia nuova email di verifica","logout":"Esci"},"register":{"title":"Registrati","username":"Username","email":"Email","password":"Password","confirm-password":"Conferma password","read-policies":"Acconsento ai <a target=\"_blank\" href=\":termsUrl\" class=\"underline text-sm text-gray-600 hover:text-gray-900\">Termini di utilizzo<\/a> e alla <a target=\"_blank\" href=\":privacyUrl\" class=\"underline text-sm text-gray-600 hover:text-gray-900\">Privacy Policy<\/a>","register":"Registrati","login":"Sei gi\u00e0 registrato?"},"reset-password":{"email":"Email","password":"Password","confirm-password":"Conferma password","reset-password":"Reimposta password"},"confirm-password":{"title":"Area sicura","text":"Questa \u00e8 un'area sicura dell'applicazione. Per favore, conferma la tua password per continuare","password":"Password","confirm":"Conferma"}},"friends":{"title":"Amici","friends":"Amici","no-friends":"Ancora nessun amico","friends-for":"Amici da","less-than-day":"meno di un giorno","days":"[0,1]giorno|[2,*]giorni","months":"[0,1]mese|[2,*]mesi","years":"[0,1]anno|[2,*]anni"},"notifications":{"title":"Notifiche","no-notifications":"Nessuna notifica","load-more":"Carica altre","friendships":{"new-friend":"<strong>@:username<\/strong> ti ha aggiunto come amico!","new-friend-telegram":"**:username** ti ha aggiunto come amico!","new-friend-request":"<strong>@:username<\/strong> ti ha inviato una richiesta di amicizia","new-friend-request-telegram":"**:username** ti ha inviato una richiesta di amicizia","request-accepted":"<strong>@:username<\/strong> ha accettato la tua richiesta di amicizia!","request-accepted-telegram":"**:username** ha accettato la tua richiesta di amicizia!","go-to-profile":"Vai al profilo"}},"passwords":{"reset":"Hai reimpostato la tua password!","sent":"Ti abbiamo inviato un link per reimpostare la password, controlla la tua email","throttled":"Ti preghiamo di attendere, prima di riprovare","token":"Token non valido","user":"Utente inesistente"},"profile":{"title":"Profilo","informations":{"title":"Informazioni","text":"Aggiorna le informazioni del tuo profilo","photo":"Foto profilo","select-new-photo":"Cambia foto profilo","remove-photo":"Rimuovi foto profilo","name":"Nome","username":"Username","email":"Email"},"bio":{"title":"Bio","text":"Aggiorna la tua bio"},"phone":{"title":"Telefono","text":"Aggiorna il tuo numero di telefono"},"password":{"title":"Aggiorna password","text":"Assicurati di utilizzare password lunghe e sicure","current":"Password attuale","new":"Nuova password","confirm":"Conferma nuova password"},"2fa":{"title":"Autenticazione a 2 fattori","text":"Aggiungi un livello di sicurezza abilitando l'autenticazione a 2 fattori","not-enabled-title":"Non hai abilitato l'autenticazione a 2 fattori","not-enabled-text":"Quando l'autenticazione a 2 fattori \u00e8 abilitata, in fase di accesso ti verr\u00e0 richiesto di inserire un token sicuro. Puoi recuperare tale token nella tua app authenticator (Google o altre)","enable":"Abilita","enabled-title":"Hai abilitato l'autenticazione a 2 fattori","enabled-text":"Quando l'autenticazione a 2 fattori \u00e8 abilitata, in fase di accesso ti verr\u00e0 richiesto di inserire un token sicuro. Puoi recuperare tale token nella tua app authenticator (Google o altre)","qr-text":"L'autenticazione a 2 fattori \u00e8 abilitata. Scansiona il seguente codice QR nella tua app authenticator","recovery-codes-text":"Conserva questi recovery code in un posto sicuro. Questi potranno essere usati per recuperare l'accesso al tuo account nel caso in cui perdessi i dati della tua app authenticator","recovery-codes-show":"Mostra recovery codes","recovery-codes-regenerate":"Rigenera recovery codes","disable":"Disabilita"},"sessions":{"title":"Sessioni","text":"Gestisci e scollega le tue sessioni attive su altri browser e dispositivi","logout-text":"Se necessario, puoi effettuare il logout da tutte le altre sessioni tra tutti i tuoi dispositivi. Alcune delle tue sessioni recenti sono elencate qui sotto; comunque la lista potrebbe non essere esaustiva. Se ritieni che il tuo account sia stato compromesso, ti consigliamo di aggiornare anche la password","logout-button":"Effettua il logout da tutte le altre sessioni","this-device":"Questo dispositivo","last-active":"Ultima attivit\u00e0","confirm-text":"Inserisci la tua password per confermare che vuoi effettuare il logout da tutte le altre sessioni su tutti i tuoi dispositivi","password":"Password","cancel":"Annulla","done":"Fatto"},"delete":{"title":"Elimina account","text":"Elimina permanentemente il tuo account","delete-text":"Una volta che il tuo account sar\u00e0 eliminato, tutte le risorse ed i dati ad esso associati saranno eliminati permanentemente. Prima di eliminare il tuo account, ti preghiamo di salvare i dati che hai intenzione di conservare","button":"Elimina account","password":"Password","cancel":"Annulla","confirm-text":"Sei sicuro di voler eliminare il tuo account? Una volta che il tuo account sar\u00e0 eliminato, tutte le risorse ed i dati ad esso associati saranno eliminati permanentemente. Inserisci la tua password per confermare che vuoi eliminare il tuo account permanentemente"},"settings":{"title":"Impostazioni - Profilo","locale-title":"Lingua","locale-text":"Scegli la tua lingua","visibility-title":"Visibilit\u00e0","visibility-text":"Hai pieno controllo sulla visibilit\u00e0 del tuo profilo e di tutte le sue parti","profile-visibility-title":"Profilo","profile-visibility-text":"Scegli se rendere il tuo profilo privato o pubblico","email-visibility-title":"Email","email-visibility-text":"Scegli se rendere la tua email visibile sul tuo profilo","bio-visibility-title":"Bio","bio-visibility-text":"Scegli se rendere la tua bio visibile sul tuo profilo","phone-visibility-title":"Telefono","phone-visibility-text":"Scegli se rendere il tuo telefono visibile sul tuo profilo","public":"Pubblico","private":"Privato","visible":"Visibile","hidden":"Nascosto","telegram-title":"Telegram","telegram-text":"Inserisci il tuo ID Telegram per ricevere le tue notifiche su Telegram","telegram-id-title":"ID Telegram","telegram-id-text":"Clicca sul seguente link per iniziare la conversazione con il nostro bot ufficiale. Una volta avviata la conversazione, il bot ti dir\u00e0 qual \u00e8 il tuo ID. Dopodich\u00e9, potrai copiarlo e incollarlo nel campo qui sotto","privacy-title":"Privacy","privacy-text":"Hai anche il pieno controllo sulle impostazioni della privacy"},"confirms-password":{"cancel":"Annulla","title":"Conferma password","content":"Per la tua sicurezza, per favore, conferma la tua password per continuare","button":"Conferma"},"messages":{"update-profile":{"success":"Profilo aggiornato correttamente","error":"Si \u00e8 verificato un errore, riprova pi\u00f9 tardi"},"bio-updated":"Bio aggiornata","phone-updated":"Telefono aggiornato","visibility-updated":"Visibilit\u00e0 aggiornate","privacy-updated":"Privacy aggiornate","telegram-updated":"ID Telegram aggiornato"},"save":"Salva","saved":"Salvato"},"thoughts":{"title":"Pensieri","thoughts":"Pensieri","add-tought-ph":"Scrivi un tuo pensiero per condividerlo con altri...","no-thoughts":"Ancora nessun pensiero","load-more":"Carica altri","publish":"Pubblica","messages":{"thought-added":"Pensiero aggiunto con successo!"}},"user":{"friends-for":"Amici da","request-already-sent":"Hai inviato una richiesta di amicizia a <strong class=\"text-primary\">@:username<\/strong>","answer-request":"Rispondi alla richiesta di <strong class=\"text-primary\">@:username<\/strong>","revert-request-text":"Hai rifiutato la richiesta di amicizia di <strong class=\"text-primary\">@:username<\/strong>, ma puoi ripensarci quando vuoi cliccando sul bottone qui sotto","revert-request-button":"Aggiungi @:username agli amici","remove-friend":"Rimuovi amico","remove-confirm-text":"Sei sicuro di voler rimuovere <span class=\"font-bold mt-3 text-primary\">@:username<\/span> dagli amici?","remove-friend-cancel-button":"No, ci ho ripensato","remove-friend-confirm-button":"Si, rimuovi dagli amici","remove":"Rimuovi dagli amici","reject":"Rifiuta","accept":"Accetta"},"validation":{"accepted":":attribute deve essere accettato.","accepted_if":":attribute deve essere accettato quando :other \u00e8 :value.","active_url":":attribute non \u00e8 un URL valido.","after":":attribute deve essere una data successiva al :date.","after_or_equal":":attribute deve essere una data successiva o uguale al :date.","alpha":":attribute pu\u00f2 contenere solo lettere.","alpha_dash":":attribute pu\u00f2 contenere solo lettere, numeri e trattini.","alpha_num":":attribute pu\u00f2 contenere solo lettere e numeri.","array":":attribute deve essere un array.","attached":":attribute \u00e8 gi\u00e0 associato.","before":":attribute deve essere una data precedente al :date.","before_or_equal":":attribute deve essere una data precedente o uguale al :date.","between":{"array":":attribute deve avere tra :min - :max elementi.","file":":attribute deve trovarsi tra :min - :max kilobyte.","numeric":":attribute deve trovarsi tra :min - :max.","string":":attribute deve trovarsi tra :min - :max caratteri."},"boolean":"Il campo :attribute deve essere vero o falso.","confirmed":"Il campo di conferma per :attribute non coincide.","current_password":"Password non valida.","date":":attribute non \u00e8 una data valida.","date_equals":":attribute deve essere una data e uguale a :date.","date_format":":attribute non coincide con il formato :format.","different":":attribute e :other devono essere differenti.","digits":":attribute deve essere di :digits cifre.","digits_between":":attribute deve essere tra :min e :max cifre.","dimensions":"Le dimensioni dell'immagine di :attribute non sono valide.","distinct":":attribute contiene un valore duplicato.","email":":attribute non \u00e8 valido.","ends_with":":attribute deve finire con uno dei seguenti valori: :values","exists":":attribute selezionato non \u00e8 valido.","file":":attribute deve essere un file.","filled":"Il campo :attribute deve contenere un valore.","gt":{"array":":attribute deve contenere pi\u00f9 di :value elementi.","file":":attribute deve essere maggiore di :value kilobyte.","numeric":":attribute deve essere maggiore di :value.","string":":attribute deve contenere pi\u00f9 di :value caratteri."},"gte":{"array":":attribute deve contenere un numero di elementi uguale o maggiore di :value.","file":":attribute deve essere uguale o maggiore di :value kilobyte.","numeric":":attribute deve essere uguale o maggiore di :value.","string":":attribute deve contenere un numero di caratteri uguale o maggiore di :value."},"image":":attribute deve essere un'immagine.","in":":attribute selezionato non \u00e8 valido.","in_array":"Il valore del campo :attribute non esiste in :other.","integer":":attribute deve essere un numero intero.","ip":":attribute deve essere un indirizzo IP valido.","ipv4":":attribute deve essere un indirizzo IPv4 valido.","ipv6":":attribute deve essere un indirizzo IPv6 valido.","json":":attribute deve essere una stringa JSON valida.","lt":{"array":":attribute deve contenere meno di :value elementi.","file":":attribute deve essere minore di :value kilobyte.","numeric":":attribute deve essere minore di :value.","string":":attribute deve contenere meno di :value caratteri."},"lte":{"array":":attribute deve contenere un numero di elementi minore o uguale a :value.","file":":attribute deve essere minore o uguale a :value kilobyte.","numeric":":attribute deve essere minore o uguale a :value.","string":":attribute deve contenere un numero di caratteri minore o uguale a :value."},"max":{"array":":attribute non pu\u00f2 avere pi\u00f9 di :max elementi.","file":":attribute non pu\u00f2 essere superiore a :max kilobyte.","numeric":":attribute non pu\u00f2 essere superiore a :max.","string":":attribute non pu\u00f2 contenere pi\u00f9 di :max caratteri."},"mimes":":attribute deve essere del tipo: :values.","mimetypes":":attribute deve essere del tipo: :values.","min":{"array":":attribute deve avere almeno :min elementi.","file":":attribute deve essere almeno di :min kilobyte.","numeric":":attribute deve essere almeno :min.","string":":attribute deve contenere almeno :min caratteri."},"multiple_of":":attribute deve essere un multiplo di :value","not_in":"Il valore selezionato per :attribute non \u00e8 valido.","not_regex":"Il formato di :attribute non \u00e8 valido.","numeric":":attribute deve essere un numero.","password":"Il campo :attribute non \u00e8 corretto.","present":"Il campo :attribute deve essere presente.","prohibited":":attribute non consentito.","prohibited_if":":attribute non consentito quando :other \u00e8 :value.","prohibited_unless":":attribute non consentito a meno che :other sia contenuto in :values.","prohibits":":attribute impedisce a :other di essere presente.","regex":"Il formato del campo :attribute non \u00e8 valido.","relatable":":attribute non pu\u00f2 essere associato a questa risorsa.","required":"Il campo :attribute \u00e8 richiesto.","required_if":"Il campo :attribute \u00e8 richiesto quando :other \u00e8 :value.","required_unless":"Il campo :attribute \u00e8 richiesto a meno che :other sia in :values.","required_with":"Il campo :attribute \u00e8 richiesto quando :values \u00e8 presente.","required_with_all":"Il campo :attribute \u00e8 richiesto quando :values sono presenti.","required_without":"Il campo :attribute \u00e8 richiesto quando :values non \u00e8 presente.","required_without_all":"Il campo :attribute \u00e8 richiesto quando nessuno di :values \u00e8 presente.","same":":attribute e :other devono coincidere.","size":{"array":":attribute deve contenere :size elementi.","file":":attribute deve essere :size kilobyte.","numeric":":attribute deve essere :size.","string":":attribute deve contenere :size caratteri."},"starts_with":":attribute deve iniziare con uno dei seguenti: :values","string":":attribute deve essere una stringa.","timezone":":attribute deve essere una zona valida.","unique":":attribute \u00e8 stato gi\u00e0 utilizzato.","uploaded":":attribute non \u00e8 stato caricato.","url":"Il formato del campo :attribute non \u00e8 valido.","uuid":":attribute deve essere un UUID valido.","custom":{"attribute-name":{"rule-name":"custom-message"}}}}}
}
I think the problem is that it doesn't get the correct locale from app()->getLocale()
inside BladeTranslationGenerator:
private function makeMaticeObject(?string $locale): string
{
$translations = json_encode($this->translations($locale));
$appLocale = $locale ?? app()->getLocale(); ---> HERE
$fallbackLocale = config('app.fallback_locale');
I want different locales for different clients
I've already changed 'use_generated_translations_file_in_prod'
to false:
/*
|--------------------------------------------------------------------------
| Use existing generated file in prod
|--------------------------------------------------------------------------
|
| Whether @translations should always use the generated translations in production.
| If false, the @translations directive will always regenerate the translations.
|
*/
'use_generated_translations_file_in_prod' => false,
Ok, I think I fixed it this way:
- using
@translations(app()->getLocale())
- and setting
$useCache = 'false';
inside MaticeServiceProvider'sboot()
function
But I think it's better to investigate this behaviour
Currently, when you call setLocal, Matice changes the local on the client-side only. So when you call setLocal, it's up to you to update the locale on the server-side, for example with an HTTP request. In future releases, I plan to incorporate this behavior into the core of Matice.
I plan to add a route to update the local server-side, but also to auto-detect browser local and optionally define it as the default one. Do you have some suggestions ?,
Hello @GENL, we were having a similar problem in APP_ENV local. The @translations directive was using cache even if app()->isProduction() was false. The cache was being used because of the method \Genl\Matice\BladeTranslationsGenerator::generate that was receiving as $useCache variable a 'false' string. Not a bool value.
'false' == true ------> true! double check it here
There are other reason why the $useCache is resolved to a string (and not a bool) inside the provider's boot method (here)?