question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problematic method signature of Component#getTranslation

See original GitHub issue

Component has to methods for i18n:

  • public String getTranslation(String key, Object... params)
  • and public String getTranslation(String key, Locale locale, Object... params)

The second method signature is problematic:

  • You expect public String getTranslation(Locale locale, String key, Object... params) (consistent with the shorter version)
  • What about getTranslation("Current Locale is {0}", Locale.ENGLISH) ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, May 19, 2021

Unless I’m missing something, it should be possible to just add

public String getTranslation(Locale locale, String key, Object... params) { ... }

and deprecate the problematic public String getTranslation(String key, Locale locale, Object... params) in favor of the new method.

0reactions
vaadin-botcommented, Oct 1, 2021

This ticket/PR has been released with platform 22.0.0.alpha5 and is also targeting the upcoming stable 22.0.0 version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I18n Vaadin flow
Hi, I've got a question about localization in Vaadin flow. Will you implement a "transparent" way to internationalize Vaadin app ?
Read more >
Entity system does not provide an API for retrieving ... - Drupal
Problem /Motivation When presenting an entity for interaction by a ... Is "editable" the right signature for the method, it seems like the ......
Read more >
Cakephp i18n get translation locales - Stack Overflow
My method includes overwriting the existing TranslateBehavior, added a new TranslationBehavior, a helper and a component. Here's the zip with the files.
Read more >
Problem with map zoom | Angular - EJ 2 Forums - Syncfusion
We must call the zoomToCoordinates() method after complete render of the Maps component. This method will zoom the map within the provided ...
Read more >
com.vaadin.flow.component.Component.getTranslation java ...
Get the translation for the component locale. * <p> * The method never returns a null. If there is no {@link I18NProvider} *...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found