code: public static Locale getCurrentLocale() {
          final UI currentUI = UI.getCurrent();
          return currentUI == null ? Locale.getDefault() : currentUI.getLocale();
      }
docs: Gets the locale of the current Vaadin UI. If the locale can not be
  determined, the default locale is returned instead.
  
  @return the current locale, never {@code null}.
  @see com.vaadin.ui.UI#getLocale()
  @see java.util.Locale#getDefault()