i18n: Update internationalization/dates.ts to use locale (#103731)
This commit is contained in:
+2
-1
@@ -69,7 +69,7 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
// Locale is used for some number and date/time formatting, whereas language is used just for
|
||||
// translating words in the interface
|
||||
acceptLangHeader := c.Req.Header.Get("Accept-Language")
|
||||
locale := "en-US" // default to en-US formatting, but use the accept-lang header or user's preference
|
||||
locale := "en-US" // default to en formatting, but use the accept-lang header or user's preference
|
||||
language := "" // frontend will set the default language
|
||||
urlPrefs := getURLPrefs(c)
|
||||
|
||||
@@ -85,6 +85,7 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
}
|
||||
|
||||
if hs.Features.IsEnabled(c.Req.Context(), featuremgmt.FlagLocaleFormatPreference) {
|
||||
locale = "en" // default to "en", not "en-US", matching the locale code
|
||||
if urlPrefs.Locale != "" {
|
||||
locale = urlPrefs.Locale
|
||||
} else if prefs.JSONData.Locale != "" {
|
||||
|
||||
Reference in New Issue
Block a user