openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
221 stars 240 forks source link

Use decimal point for float in widget UI #779

Closed s0170071 closed 3 years ago

s0170071 commented 3 years ago

The problem

when configuring a stepper widget, the step size can be given as float. It does, however, use a comma instead of a decimal point.

Expected behavior

I use the german language, however, this part of the UI seems untranslated. I would expect a decimal point, e.g. 0.2°C, not 0,2°C

Steps to reproduce

  1. Go to an item,
  2. edit properties
  3. set the widget to stepper
  4. the step size can be adjusted, however not in 0.5 steps but 0,5

Your environment

runtimeInfo:
  version: 3.0.0
  buildString: Release Build
locale: de
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.9
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.43+88-CA
  osName: Linux
  osVersion: 5.4.79-v7l+
  osArchitecture: arm
  availableProcessors: 4
  freeMemory: 50674088
  totalMemory: 230912000
bindings:
  - astro
  - homematic
  - http
  - hue
  - mail
  - mqtt
  - shelly
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: true
    macos: false
    windows: false
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    pixelRatio: 1.5
    prefersColorScheme: light
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 6
    language: de
    languages:
      - de
      - en-US
      - en
    onLine: true
    platform: Linux x86_64
  screen:
    width: 2560
    height: 1440
    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 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0
timestamp: 2021-01-09T10:18:12.796Z

Browser console

LoginManagerPrompter: _getShortDisplayHost couldn't process http://192.168.1.30:8080 8 LoginManagerPrompter.jsm:982:11
LoginManagerPrompter: _getShortDisplayHost couldn't process http://192.168.1.1 6 LoginManagerPrompter.jsm:982:11
LoginManagerPrompter: _getShortDisplayHost couldn't process http://192.168.1.9 13 LoginManagerPrompter.jsm:982:11
TypeError: parent is null
    canMutationImpactCurrentStyles resource://devtools/client/inspector/shared/style-change-tracker.js:67
    onMutations resource://devtools/client/inspector/shared/style-change-tracker.js:84
    _emit resource://devtools/shared/event-emitter.js:226
    emit resource://devtools/shared/event-emitter.js:172
    emit resource://devtools/shared/event-emitter.js:324
    getMutations resource://devtools/client/fronts/walker.js:405
event-emitter.js:241:21
TypeError: container.node.targetFront is null
    _getVisibleChildren resource://devtools/client/inspector/markup/markup.js:2252
    _updateChildren resource://devtools/client/inspector/markup/markup.js:2161
    _forceUpdateChildren resource://devtools/client/inspector/markup/markup.js:2050
    _onWalkerMutations resource://devtools/client/inspector/markup/markup.js:1446
    _emit resource://devtools/shared/event-emitter.js:226
    emit resource://devtools/shared/event-emitter.js:172
    emit resource://devtools/shared/event-emitter.js:324
    getMutations resource://devtools/client/fronts/walker.js:405
markup.js:417:15
TypeError: container.node.targetFront is null
    _getVisibleChildren resource://devtools/client/inspector/markup/markup.js:2252
    _updateChildren resource://devtools/client/inspector/markup/markup.js:2161
    _forceUpdateChildren resource://devtools/client/inspector/markup/markup.js:2050
    _onWalkerMutations resource://devtools/client/inspector/markup/markup.js:1446
    _emit resource://devtools/shared/event-emitter.js:226
    emit resource://devtools/shared/event-emitter.js:172
    emit resource://devtools/shared/event-emitter.js:324
    getMutations resource://devtools/client/fronts/walker.js:405
markup.js:417:15
TypeError: container.node.targetFront is null
    _getVisibleChildren resource://devtools/client/inspector/markup/markup.js:2252
    _updateChildren resource://devtools/client/inspector/markup/markup.js:2161
    _forceUpdateChildren resource://devtools/client/inspector/markup/markup.js:2050
    _onWalkerMutations resource://devtools/client/inspector/markup/markup.js:1446
    _emit resource://devtools/shared/event-emitter.js:226
    emit resource://devtools/shared/event-emitter.js:172
    emit resource://devtools/shared/event-emitter.js:324
    getMutations resource://devtools/client/fronts/walker.js:405
markup.js:417:15
TypeError: container.node.targetFront is null
    _getVisibleChildren resource://devtools/client/inspector/markup/markup.js:2252
    _updateChildren resource://devtools/client/inspector/markup/markup.js:2161
    _forceUpdateChildren resource://devtools/client/inspector/markup/markup.js:2050
    _onWalkerMutations resource://devtools/client/inspector/markup/markup.js:1446
    _emit resource://devtools/shared/event-emitter.js:226
    emit resource://devtools/shared/event-emitter.js:172
    emit resource://devtools/shared/event-emitter.js:324
    getMutations resource://devtools/client/fronts/walker.js:405
markup.js:417:15
[Exception... "Favicon at "https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/optimized/2X/5/59a91d5aac9b5fafe843efc04e2edda03f3c2ec6_2_180x180.png" failed to load: Forbidden."  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource:///modules/FaviconLoader.jsm :: onStopRequest :: line 253"  data: no] FaviconLoader.jsm:253:22
Error: Can't find profile directory. 2 XULStore.jsm:66:15
InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable 8 PictureInPictureChild.jsm:298
[Exception... "Favicon at "https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/optimized/2X/5/59a91d5aac9b5fafe843efc04e2edda03f3c2ec6_2_180x180.png" failed to load: Forbidden."  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource:///modules/FaviconLoader.jsm :: onStopRequest :: line 253"  data: no] FaviconLoader.jsm:253:22
Tastenereignis ist in manchen Tastaturlayouts nicht verfügbar: Taste="r" Modifikatoren="accel,alt" ID="key_toggleReaderMode" browser.xhtml
Tastenereignis ist in manchen Tastaturlayouts nicht verfügbar: Taste="i" Modifikatoren="accel,alt,shift" ID="key_browserToolbox" browser.xhtml
[Exception... "Favicon at "https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/optimized/2X/5/59a91d5aac9b5fafe843efc04e2edda03f3c2ec6_2_180x180.png" failed to load: Forbidden."  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource:///modules/FaviconLoader.jsm :: onStopRequest :: line 253"  data: no] FaviconLoader.jsm:253:22
[Exception... "Component returned failure code: 0x804b0051 (NS_ERROR_HOST_IS_IP_ADDRESS) [nsIEffectiveTLDService.getKnownPublicSuffixFromHost]"  nsresult: "0x804b0051 (NS_ERROR_HOST_IS_IP_ADDRESS)"  location: "JS frame :: resource:///modules/UrlbarUtils.jsm :: stripPublicSuffixFromHost :: line 688"  data: no] UrlbarUtils.jsm:688:35
No user input on targetField LoginManagerChild.jsm:1762
Error: No user input on targetField LoginManagerChild.jsm:1762:17
LoginManagerPrompter: _getShortDisplayHost couldn't process http://192.168.1.9 6 LoginManagerPrompter.jsm:982:11
TypeError: aBrowser is null
SessionStore.jsm:1184:9
InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable 24 PictureInPictureChild.jsm:298
Tastenereignis ist in manchen Tastaturlayouts nicht verfügbar: Taste="r" Modifikatoren="accel,alt" ID="key_toggleReaderMode" browser.xhtml
Tastenereignis ist in manchen Tastaturlayouts nicht verfügbar: Taste="i" Modifikatoren="accel,alt,shift" ID="key_browserToolbox" browser.xhtml
debuggee 'resource://devtools/shared/base-loader.js:289' would run builtin-modules.js:196:11
InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable 8 PictureInPictureChild.jsm:298

Browser network traffic

none.

Additional information

ghys commented 3 years ago

According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat and actually verified both in Firefox and Chrome the decimal separator for the de locale is the comma:

> new Intl.NumberFormat("de").format(0.5)
< "0,5"

If you want a dot instead change your locale to e.g. en.

> new Intl.NumberFormat('en').format(0.5)
< "0.5"

See also https://stackoverflow.com/questions/48273724/complete-list-of-all-different-intl-numberformats Sorry, but unless this leads to an actual bug (it appears not to be the case), this will be a "wontfix" for me.

s0170071 commented 3 years ago

just accepted that this is highly unusual in Germany. The only software using a comma as decimal so far is Excel. And it differs from the textual configuration.