Skip to content

Commit 66323b2

Browse files
Internationalisation: More markup in prometheus/grafana-data (#108378)
* mark up units * remaining category markup * prometheus translations... * load prom resources in core * more prom markup * don't load prometheus resources directly in core * isolate @grafana/data import in jest-setup to prevent side effects in tests * directly use tz
1 parent a421f55 commit 66323b2

File tree

14 files changed

+2380
-464
lines changed

14 files changed

+2380
-464
lines changed

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ module.exports = [
311311
files: [
312312
'public/app/!(plugins)/**/*.{ts,tsx,js,jsx}',
313313
'packages/grafana-ui/**/*.{ts,tsx,js,jsx}',
314+
'packages/grafana-data/**/*.{ts,tsx,js,jsx}',
314315
'packages/grafana-sql/**/*.{ts,tsx,js,jsx}',
315316
'packages/grafana-prometheus/**/*.{ts,tsx,js,jsx}',
316317
...pluginsToTranslate.map((plugin) => `${plugin}/**/*.{ts,tsx,js,jsx}`),

packages/grafana-data/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
},
5757
"dependencies": {
5858
"@braintree/sanitize-url": "7.0.1",
59+
"@grafana/i18n": "12.1.0-pre",
5960
"@grafana/schema": "12.1.0-pre",
6061
"@leeoniya/ufuzzy": "1.0.18",
6162
"@types/d3-interpolate": "^3.0.0",

packages/grafana-data/src/datetime/moment_wrapper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import moment, { Moment, MomentInput, DurationInputArg1, DurationInputArg2 } from 'moment';
2+
import { tz } from 'moment-timezone';
23

34
import { TimeZone } from '../types/time';
45
/* eslint-disable id-blacklist, no-restricted-imports */
@@ -130,9 +131,9 @@ export const dateTimeForTimeZone = (
130131
let result: moment.Moment;
131132

132133
if (typeof input === 'string' && formatInput) {
133-
result = moment.tz(input, formatInput, timezone);
134+
result = tz(input, formatInput, timezone);
134135
} else {
135-
result = moment.tz(input, timezone);
136+
result = tz(input, timezone);
136137
}
137138

138139
if (isDateTime(result)) {

0 commit comments

Comments
 (0)