Skip to content

Commit 23e990c

Browse files
committed
Read language packs directly from bundled wp-files/latest/languages/
1 parent a9a9f94 commit 23e990c

2 files changed

Lines changed: 3 additions & 23 deletions

File tree

apps/cli/lib/dependency-management/setup.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import semver from 'semver';
55
import { readCliConfig, updateCliConfigWithPartial } from 'cli/lib/cli-config/core';
66
import { getSqliteVersionFromInstallation } from 'cli/lib/sqlite-integration';
77
import {
8-
getLanguagePacksPath,
98
getPhpMyAdminPath,
109
getSqliteCommandPath,
1110
getSqlitePluginPath,
@@ -200,34 +199,13 @@ async function copyBundledPhpMyAdmin() {
200199
} );
201200
}
202201

203-
async function copyBundledLanguagePacks() {
204-
const sourceLanguagePacksPath = path.join( getWpFilesPath(), 'latest', 'languages' );
205-
if ( ! fs.existsSync( sourceLanguagePacksPath ) ) {
206-
return;
207-
}
208-
const targetLanguagePacksPath = getLanguagePacksPath();
209-
const isSourceDirectoryDifferent = await areDirectoriesDifferentBySizeAndMtime(
210-
sourceLanguagePacksPath,
211-
targetLanguagePacksPath
212-
);
213-
if ( isSourceDirectoryDifferent ) {
214-
try {
215-
await fs.promises.rm( targetLanguagePacksPath, { recursive: true, force: true } );
216-
} catch {
217-
// Do nothing if the target directory is missing or corrupted
218-
}
219-
await recursiveCopyDirectory( sourceLanguagePacksPath, targetLanguagePacksPath );
220-
}
221-
}
222-
223202
export async function setupServerFiles() {
224203
const steps: [ string, () => Promise< void > ][] = [
225204
[ 'WordPress version', copyBundledLatestWpVersion ],
226205
[ 'SQLite integration', copyBundledSqlite ],
227206
[ 'WP-CLI', copyBundledWpCli ],
228207
[ 'SQLite command', copyBundledSqliteCommand ],
229208
[ 'translations', copyBundledTranslations ],
230-
[ 'language packs', copyBundledLanguagePacks ],
231209
[ 'phpMyAdmin', copyBundledPhpMyAdmin ],
232210
];
233211

apps/cli/lib/server-files.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ export function getSqliteCommandPath(): string {
4646
return path.join( getServerFilesPath(), SQLITE_COMMAND_DIRNAME );
4747
}
4848

49+
// Language packs ship read-only with the CLI bundle and are copied into each site's
50+
// `wp-content/languages/` directory on site create. No writable cache needed.
4951
export function getLanguagePacksPath(): string {
50-
return path.join( getServerFilesPath(), 'language-packs' );
52+
return path.join( getWpFilesPath(), 'latest', 'languages' );
5153
}
5254

5355
// AI instructions ship read-only with the CLI bundle and are installed into each site's

0 commit comments

Comments
 (0)