Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/cli/lib/site-language.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from 'fs';
import path from 'path';
import { Locale } from '@formatjs/intl-locale';
import { match } from '@formatjs/intl-localematcher';
import { DEFAULT_LOCALE } from '@studio/common/lib/locale';
import { getWpFilesPath } from 'cli/lib/dependency-management/paths';
Expand Down Expand Up @@ -82,7 +81,7 @@ export async function getPreferredSiteLanguage( wpVersion = 'latest' ): Promise<
// Filter out invalid locales
.filter( ( item ) => {
try {
new Locale( item );
new Intl.Locale( item );
return true;
} catch ( exception ) {
return false;
Expand Down
3 changes: 2 additions & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
},
"dependencies": {
"@anthropic-ai/sdk": "^0.91.1",
"@inquirer/prompts": "^8.5.2",
"@earendil-works/pi-agent-core": "0.78.0",
"@earendil-works/pi-ai": "0.78.0",
"@earendil-works/pi-coding-agent": "0.78.0",
"@earendil-works/pi-tui": "0.78.0",
"@formatjs/intl-localematcher": "^0.8.10",
"@inquirer/prompts": "^8.5.2",
"@modelcontextprotocol/sdk": "^1.27.1",
"@php-wasm/node": "3.1.36",
"@php-wasm/universal": "3.1.36",
Expand Down
5 changes: 2 additions & 3 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@formatjs/intl-locale": "^3.4.5",
"@formatjs/intl-localematcher": "^0.5.4",
"@formatjs/intl-localematcher": "^0.8.10",
"@sentry/electron": "^7.13.0",
"@studio/common": "file:../../tools/common",
"@vscode/sudo-prompt": "^9.3.1",
Expand Down Expand Up @@ -63,14 +62,14 @@
"@automattic/generate-password": "^0.2.0",
"@automattic/interpolate-components": "^1.2.1",
"@base-ui/react": "^1.3.0",
"@earendil-works/pi-coding-agent": "0.78.0",
"@electron-forge/cli": "^7.11.2",
"@electron-forge/maker-deb": "^7.11.2",
"@electron-forge/maker-dmg": "^7.11.2",
"@electron-forge/maker-squirrel": "^7.11.2",
"@electron-forge/maker-zip": "^7.11.2",
"@electron-forge/plugin-auto-unpack-natives": "^7.11.2",
"@inquirer/prompts": "^8.5.2",
"@earendil-works/pi-coding-agent": "0.78.0",
"@reduxjs/toolkit": "^2.12.0",
"@rive-app/react-canvas": "^4.18.0",
"@sentry/react": "^10.56.0",
Expand Down
5 changes: 4 additions & 1 deletion apps/studio/src/lib/locale-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export function getSupportedLocale() {
// `app.getLocale` returns the current application locale, acquired using
// Chromium's `l10n_util` library. This value is utilized to determine
// the best fit for supported locales.
return match( [ app.getLocale() ], supportedLocales, DEFAULT_LOCALE ) as SupportedLocale;
const matched = match( [ app.getLocale() ], supportedLocales, DEFAULT_LOCALE );
// `match` canonicalizes BCP-47 casing (e.g. `zh-cn` -> `zh-CN`), but our
// supported-locale keys are lowercase
return matched.toLowerCase() as SupportedLocale;
}

export async function getUserLocaleWithFallback() {
Expand Down
46 changes: 11 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@
"patch-package": "^8.0.1",
"prettier": "npm:wp-prettier@3.0.3",
"tsx": "^4.22.1",
"undici": "^8.3.0",
"typescript": "~6.0.3",
"typescript-eslint": "^8.59.4",
"undici": "^8.3.0",
"vite": "^8.0.16",
"vitest": "^4.0.18",
"web-streams-polyfill": "^4.2.0"
Expand Down