openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
224 stars 242 forks source link

[Main UI] Layout and Search Issues in Regional Settings #1083

Open hypetsch opened 3 years ago

hypetsch commented 3 years ago

The problem

The following issues where found in the "Regional Settings" section but may also apply to other elements.

1) Regional Settings > Land/Region: Searching for some characters does not yield an expected result (Browser language set to "German"). e.g. searching for "Öster" is missing "Österreich". p4ai6AFh4c A similar issue happens when searching for "Ä" which yields results without any "Ä". image See also 3)

2) The scrollbar is hidden by the popup header: xpgEH0wFlW

3) The configured language is not consistently used. Although "English" is configured, some UI elements are still shown in German (even after page reload - probably by design?). When switching the browser to "English", the behavior of issue 1) is different; just a guess, but it looks a bit like the search is not using the translated entries? image

Expected behavior

Your environment

runtimeInfo:
  version: 3.1.0.M4
  buildString: Milestone Build
locale: en-AT
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.11
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.48+21-CA
  osName: Linux
  osVersion: 5.10.17-v7+
  osArchitecture: arm
  availableProcessors: 4
  freeMemory: 79250024
  totalMemory: 194772992
bindings:
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1
    prefersColorScheme: light
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 4
    language: en
    languages:
      - en
    onLine: true
    platform: Win32
  screen:
    width: 1920
    height: 1200
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: filled
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/91.0.4472.77 Safari/537.36
timestamp: 2021-06-01T20:08:22.164Z
ghys commented 3 years ago
  1. Related to #718 however since this is a "smart select" popup, the searchbar's removeDiacritics is set to the default true (changed in https://github.com/framework7io/framework7/commit/50f49754246fd6bd72cf87229bdaade68b840695) and AFAIK it's not possible to control it

  2. I noticed it too, this information comes from the API (e.g. /rest/services and I agree it should probably use the configured locale right away after it's changed - maybe @openhab/core-maintainers know why it doesn't/whether it can be improved. In any case if you restart OH the locale will be applied, if I'm not mistaken.

wborn commented 3 years ago

I agree it should probably use the configured locale right away after it's changed

IMHO it would be better if the configured locale is only used as fallback. Other REST operations determine the locale based on the Accept-Language request header. That's also why you currently end up with mixed translations if you don't set the openHAB default locale to the same language as your browser. I.e. the backend should always use LocaleService.getLocale(acceptLanguageHttpHeader) when such headers are available instead of LocaleProvider.getLocale().

rkantos commented 2 years ago

Could we at least make use of some override function since I really wouldn't want to just use another browser extension to send Acccept-Langugage header to Openhab for being able to follow some tutorials which are most likely written in English.