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

i18n support for templates #3906

Open
ripla opened this issue Apr 17, 2018 · 3 comments
Open

i18n support for templates #3906

ripla opened this issue Apr 17, 2018 · 3 comments

Comments

@ripla
Copy link
Contributor

ripla commented Apr 17, 2018

When creating templates,
I want to use i18n keys as values,
so that I can use the same i18n strategy in my whole UI

The user should be able to use some predefined format in text content and attribute values to input i18n keys.

@pleku pleku added this to the During 2018 candidates milestone Apr 17, 2018
@gianluca-valentini
Copy link

I am very surprised, since this strongly affects the development of a web application with Vaadin 10.

This means that, currently, it is not feasible to create an enterprise web application, and I need to use 'old' approach using all java code to localize the web presentation pages.

It's a big limitation as well as a big problem.

@lightoze
Copy link
Contributor

lightoze commented Nov 6, 2018

I've created a mixin and a server-side class which can attach to any Component to alleviate the problem: https://gist.github.com/lightoze/04a115e4331f6cbee9e875d192a7cd46

In your Java component constructor you add I18nBinding.create(this) line and then in template code use it like so:

<vaadin-text-field id="name" label="[[translate('Name')]]"></vaadin-text-field>

Translation parameters are not supported.

@jcgueriaud1
Copy link
Contributor

Any ideas of how it could be handled for the next LTS?

There are 2 libraries for i18n lit that looks quite promising:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants