Files
vnidrop/localization/src/config.ts
cdricms c71e1b97d9 feat(l10n): advertise app localizations to iOS
The per-app language picker in iOS Settings only appears when the built app
declares multiple localizations. Add the planned languages to the Xcode
project's knownRegions (so Xcode compiles their .lproj from the String
Catalog), and have `generate` keep CFBundleLocalizations in Info.plist in sync
with supportedLanguages (currently en, fr).
2026-07-20 10:41:41 +02:00

31 lines
1.1 KiB
TypeScript

import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
/** Repo root = parent of the localization/ directory. */
export const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
export const LOC_DIR = join(REPO_ROOT, "localization");
export const STRINGS_JSON = join(LOC_DIR, "strings.json");
/** Apple String Catalog — one file, all languages nested. */
export const APPLE_XCSTRINGS = join(
REPO_ROOT,
"apple/VniDrop/Resources/Localizable.xcstrings",
);
/** Apple app Info.plist — its CFBundleLocalizations is kept in sync with supportedLanguages. */
export const APPLE_INFO_PLIST = join(
REPO_ROOT,
"apple/VniDrop/Resources/Info.plist",
);
/** KMP / Compose Multiplatform resources root; one values[-lang]/strings.xml per language. */
export const KMP_RESOURCES = join(
REPO_ROOT,
"shared/src/commonMain/composeResources",
);
/** Directory holding a language's strings.xml under the compose resources root. */
export function kmpValuesDir(lang: string, sourceLanguage: string): string {
return lang === sourceLanguage ? "values" : `values-${lang}`;
}