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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bun.lock

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

22 changes: 22 additions & 0 deletions plugins/pseudo-localization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# @game-ci/pseudo-localization (draft)

Injects pseudo-loc strings pre-translation to catch UI overflow/
truncation bugs. **Not functional yet**, and `pseudo-localize` is not yet
registered anywhere in core's CLI.

## Why this, distinct from translation sync

UI _testing_, not translation management - deliberately different from a
Crowdin/Lokalise-style sync plugin (which was considered and cut from the
roadmap for not being game-specific enough).

## Remaining work before this is real

1. Add `pseudo-localize <projectPath>` to core's `CliCommands`.
2. Pseudo-loc transform (accented characters, length expansion/padding,
bracket markers around each string) applied to whatever localization
table format the target engine uses - this is genuinely
engine-specific (Unity's Localization package format differs
completely from a flat JSON/CSV table), so the first real
implementation will likely need to pick one engine's format to start.
3. Tests once the above is real.
32 changes: 32 additions & 0 deletions plugins/pseudo-localization/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@game-ci/pseudo-localization",
"version": "0.0.1",
"description": "Pseudo-localization QA plugin (draft). Injects pseudo-loc strings pre-translation to catch UI overflow/truncation bugs.",
"license": "MIT",
"repository": "git@github.com:game-ci/cli.git",
"files": [
"dist"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"bun": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/node": "^17.0.23",
"typescript": "4.7.4",
"vitest": "^4"
},
"engines": {
"node": ">=18.x"
}
}
42 changes: 42 additions & 0 deletions plugins/pseudo-localization/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Pseudo-localization QA plugin - DRAFT.
*
* Plan: `game-ci pseudo-localize <projectPath>` injects pseudo-loc
* strings (accented/expanded characters standing in for real
* translations) into a project's localization tables pre-translation, so
* UI overflow/truncation bugs surface before real translation work ever
* starts. Distinct from a translation-*sync* plugin (pulling/pushing real
* strings to a vendor) - this is UI testing, not translation management.
*
* NOTE: `pseudo-localize` is not yet registered as a core CLI command.
*/

export const pseudoLocalizationPlugin = {
name: "pseudo-localization",
version: "0.0.1",

commands: [
{
engine: "*",
createCommand(command: string, _subCommands: string[]) {
if (command === "pseudo-localize") {
return {
name: "Pseudo-localize",
async configureOptions() {
// TODO: register --sourceLocale, --expansionFactor, --outputPath.
},
async execute(): Promise<boolean> {
throw new Error(
"Pseudo-localization QA is not implemented yet (draft plugin), and `pseudo-localize` " +
"is not yet registered as a core command either. See plugins/pseudo-localization/README.md.",
);
},
};
}
return null;
},
},
],
};

export default pseudoLocalizationPlugin;
19 changes: 19 additions & 0 deletions plugins/pseudo-localization/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es2022",
"lib": ["es2022"],
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"noImplicitAny": false,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"types": ["node"]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.test.ts", "dist"]
}