Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translatable custom panel view labels #315

Open
rasteiner opened this issue Jun 7, 2019 · 0 comments

Comments

Projects
1 participant
@rasteiner
Copy link

commented Jun 7, 2019

Normally, inside of components we can use the this.$t function to translate stuff, but when setting the view label we don't have access to that (afaik).

Here some suggestion on how the api could look like:

expose $t function to window.panel:

panel.plugin('rasteiner/todos', {
  views: {
    todos: {
      label: panel.$t('rasteiner.todos.label'),
      //etc
    }
  }
})

check if label is Object with $t property

panel.plugin('rasteiner/todos', {
  views: {
    todos: {
      label: { 
        $t: 'rasteiner.todos.label',
      },
      //etc
    }
  }
})

directly accept translations

panel.plugin('rasteiner/todos', {
  views: {
    todos: {
      label: { 
        en: 'Todo list',
        it: 'Lista di cose da fare'
      },
      //etc
    }
  }
})

@bastianallgeier bastianallgeier added this to Backlog in Roadmap Jul 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.