diff --git a/e2e-playwright/test-plugins/grafana-extensionstest-app/i18next.config.ts b/e2e-playwright/test-plugins/grafana-extensionstest-app/i18next.config.ts index 6978b148631..b6ef3417c90 100644 --- a/e2e-playwright/test-plugins/grafana-extensionstest-app/i18next.config.ts +++ b/e2e-playwright/test-plugins/grafana-extensionstest-app/i18next.config.ts @@ -1,6 +1,12 @@ import { defineConfig } from 'i18next-cli'; import pluginJson from './plugin.json'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: pluginJson.languages, extract: { @@ -10,6 +16,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, }); diff --git a/e2e-playwright/test-plugins/grafana-test-datasource/i18next.config.ts b/e2e-playwright/test-plugins/grafana-test-datasource/i18next.config.ts index 6978b148631..b6ef3417c90 100644 --- a/e2e-playwright/test-plugins/grafana-test-datasource/i18next.config.ts +++ b/e2e-playwright/test-plugins/grafana-test-datasource/i18next.config.ts @@ -1,6 +1,12 @@ import { defineConfig } from 'i18next-cli'; import pluginJson from './plugin.json'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: pluginJson.languages, extract: { @@ -10,6 +16,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, }); diff --git a/e2e-playwright/test-plugins/grafana-test-panel/i18next.config.ts b/e2e-playwright/test-plugins/grafana-test-panel/i18next.config.ts index 6978b148631..b6ef3417c90 100644 --- a/e2e-playwright/test-plugins/grafana-test-panel/i18next.config.ts +++ b/e2e-playwright/test-plugins/grafana-test-panel/i18next.config.ts @@ -1,6 +1,12 @@ import { defineConfig } from 'i18next-cli'; import pluginJson from './plugin.json'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: pluginJson.languages, extract: { @@ -10,6 +16,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, }); diff --git a/packages/grafana-alerting/i18next.config.ts b/packages/grafana-alerting/i18next.config.ts index 22fc83fc2a0..e2161ffc84d 100644 --- a/packages/grafana-alerting/i18next.config.ts +++ b/packages/grafana-alerting/i18next.config.ts @@ -1,5 +1,11 @@ import { defineConfig } from 'i18next-cli'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: ['en-US'], // Only en-US is updated - Crowdin will PR with other languages extract: { @@ -9,6 +15,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, }); diff --git a/packages/grafana-prometheus/i18next.config.ts b/packages/grafana-prometheus/i18next.config.ts index c7a22e2acd2..f62569616f1 100644 --- a/packages/grafana-prometheus/i18next.config.ts +++ b/packages/grafana-prometheus/i18next.config.ts @@ -1,5 +1,11 @@ import { defineConfig } from 'i18next-cli'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: ['en-US'], // Only en-US is updated - Crowdin will PR with other languages extract: { @@ -9,6 +15,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, }); diff --git a/packages/grafana-sql/i18next.config.ts b/packages/grafana-sql/i18next.config.ts index 12a616eee7d..50bd26c4351 100644 --- a/packages/grafana-sql/i18next.config.ts +++ b/packages/grafana-sql/i18next.config.ts @@ -1,5 +1,11 @@ import { defineConfig } from 'i18next-cli'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: ['en-US'], // Only en-US is updated - Crowdin will PR with other languages extract: { @@ -9,6 +15,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, }); diff --git a/public/app/plugins/datasource/azuremonitor/i18next.config.ts b/public/app/plugins/datasource/azuremonitor/i18next.config.ts index d2d90c5085f..d4838ec714a 100644 --- a/public/app/plugins/datasource/azuremonitor/i18next.config.ts +++ b/public/app/plugins/datasource/azuremonitor/i18next.config.ts @@ -1,5 +1,11 @@ import { defineConfig } from 'i18next-cli'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: ['en-US'], // Only en-US is updated - Crowdin will PR with other languages extract: { @@ -9,6 +15,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, }); diff --git a/public/app/plugins/datasource/mssql/i18next.config.ts b/public/app/plugins/datasource/mssql/i18next.config.ts index a5816b0c59b..5e38cebbb33 100644 --- a/public/app/plugins/datasource/mssql/i18next.config.ts +++ b/public/app/plugins/datasource/mssql/i18next.config.ts @@ -1,5 +1,11 @@ import { defineConfig } from 'i18next-cli'; +const collator = new Intl.Collator('en-US', { + sensitivity: 'variant', + ignorePunctuation: false, + numeric: false, +}); + export default defineConfig({ locales: ['en-US'], // Only en-US is updated - Crowdin will PR with other languages extract: { @@ -9,6 +15,6 @@ export default defineConfig({ functions: ['t', '*.t'], transComponents: ['Trans'], // eslint-disable-next-line no-restricted-syntax - sort: (a, b) => a.key.localeCompare(b.key, 'en-US'), + sort: (a, b) => collator.compare(a.key, b.key), }, });