mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +02:00
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).
31 lines
1.1 KiB
TypeScript
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}`;
|
|
}
|