runlinenl / nova-profile-tool

This package adds a tool for Laravel nova to let a user manage their profile data
MIT License
37 stars 40 forks source link

Field Translation #12

Open nordentwickler opened 5 years ago

nordentwickler commented 5 years ago

Hey, with your last commit translation should work now. With resources/lang/vendor/de.json i'm able to translate the "Profile"-Sidebar-Title or the "Save Profile"-Submit - Button. But how are field-translations been handled - via json or php?

Kind regards, Marten

wemersonrv commented 5 years ago

Hello @nordentwickler I had the same problem.

The menu label and file name labels i can translate them adding to my language json file, just like you. In my case, Brazilian-portuguese *(resources/lang/vendor/pt-br.json)

{ 
    "...,": "...",
    "Profile": "Meu perfil",
    "Name": "Nome",
    "E-mail address": "E-mail",
    "Password": "Senha",
    "Password Confirmation": "Confirmar senha"
}

Unfortunately some structural component texts, such as title, update button and success message remains in english and i solve it adding then to resources/lang/vendor/nova/pt-br.json

{
    "...,": "...",
    "Update Profile": "Atualizar meu perfil",
    "Save Profile": "Atualizar",
    "Your profile has been saved!": "Seu perfil foi atualizado"
}

if you don't have this folder, just publish it from vendor tag and duplicate the en.json file to your language:

php artisan vendor:publish --tag=nova-lang
accentinteractive commented 5 years ago

Hi @wemersonrv, thanks for your comment. It helped me solve this issue.

The path in your text it not correct though, resources/lang/vendor/pt-br.json should be resources/lang/pt-br.json. It took me some time to find out.