elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.63k stars 8.23k forks source link

Users can not tweak time range when the locale is set to Japanese #180554

Open TomonoriSoejima opened 7 months ago

TomonoriSoejima commented 7 months ago

reproducible in 8.12.2

repro step

  1. add i18n.locale: "ja-JP" to kibana.yml and restart Kibana

  2. open a dashboard and choose Absolute (絶対 in Japanese) image

  3. Tweak the minute to 03:33:00.000 by hand Then you would notice this message "想定されている形式:MMM D, YYYY @ HH:mm:ss.SSS" image

想定されている形式 comes from this code

x-pack/plugins/translations/translations/ja-JP.json
563:    "core.euiAbsoluteTab.dateFormatError": "想定されている形式:{dateFormat}",
[ip-192-168-180-197:kibana]$ 

And I believe {dateFormat} should come from Advanced Settings (This screenshot was taken from another English Kibana for readability.

image

To avoid it, we should handle it like this in the date picker, perhaps?

const moment = require('moment');
require('moment/locale/ja');

moment.locale('ja');

let date = moment();
console.log(date.format('MMM D, YYYY @ HH:mm:ss.SSS'));

After doing npm install moment

[ip-192-168-180-197:kibana_jp]$ node test.js 
4月 11, 2024 @ 16:16:56.296
[ip-192-168-180-197:kibana_jp]$ 
elasticmachine commented 7 months ago

Pinging @elastic/kibana-core (Team:Core)

dmlemeshko commented 7 months ago

@Bamieh could you have a look?