I18n: Stricter collator for the string extraction (#117875)

Stricter collator
This commit is contained in:
Andrej Ocenas 2026-02-13 09:04:20 +01:00 committed by GitHub
parent 88d87f4346
commit b0ce27d38f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 56 additions and 8 deletions

View file

@ -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),
},
});

View file

@ -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),
},
});

View file

@ -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),
},
});

View file

@ -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),
},
});

View file

@ -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),
},
});

View file

@ -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),
},
});

View file

@ -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),
},
});

View file

@ -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),
},
});