Skip to content

v0.2: register & install as the Ainu language (transient LCID) - #2

Closed
mkpoli wants to merge 2 commits into
rust-migrationfrom
v0.2-ainu-locale
Closed

v0.2: register & install as the Ainu language (transient LCID)#2
mkpoli wants to merge 2 commits into
rust-migrationfrom
v0.2-ainu-locale

Conversation

@mkpoli

@mkpoli mkpoli commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Draft — needs testing on a real Windows machine. Stacked on #1 (retarget to master after #1 merges).

Moves ainuKey off the ja-JP fallback so it installs and appears as Ainu.

How (per the MS-LCID / Keyman research)

Ainu (ain) has no Windows LCID, so it uses a transient LCID (0x2000/0x2400/0x2800/0x2C00):

  • DLL (registry.rs): DllRegisterServer now registers the profile against all four transient LCIDs (not-enabled-by-default), instead of ja-JP.
  • Per-user enable (installer/enable-user.ps1): adds ain via Set-WinUserLanguageList, then enables the TIP via InstallLayoutOrTip("<lcid>:{CLSID}{PROFILE}", 0). Must run as the real (non-elevated) user.
  • install.ps1: machine half (copy + regsvr32) elevated; per-user half in the user's context.
  • Inno installer: bundles enable-user.ps1 and runs it runasoriginaluser; uninstall disables first.

Needs verification on Windows

  • The InstallLayoutOrTip install-string format (%04x:{CLSID}{PROFILE}, no 0x — from Keyman source; MS docs show a 0x variant).
  • Whether LocaleNameToLCID("ain") returns the transient LCID immediately after Set-WinUserLanguageList.
  • The 4-transient-slot ceiling (install fails if all are taken by other IMEs).
  • Elevation handoff (machine step elevated, per-user step as original user).

Verified here

  • cargo check --target x86_64-pc-windows-msvc green (DLL side).

mkpoli and others added 2 commits June 15, 2026 04:39
Replace the ja-JP fallback langid with registration against the four desktop transient LCIDs (0x2000/0x2400/0x2800/0x2C00), per [MS-LCID] and Keyman's RegisterTransientTips. Profiles are registered not-enabled-by-default; the per-user enable (Set-WinUserLanguageList + InstallLayoutOrTip) is the installer's job. DLL side only; installer step follows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
enable-user.ps1 adds 'ain' to the user's language list (Set-WinUserLanguageList) and enables the TIP via InstallLayoutOrTip under the transient LCID Windows assigns. install.ps1 now runs the machine half elevated and the per-user half in the user's own context. The Inno installer bundles enable-user.ps1 and runs it with runasoriginaluser; the release zip includes it. NEEDS Windows testing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 264f31d5-eade-45a4-871e-211ad6aefeee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v0.2-ainu-locale

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mkpoli

mkpoli commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

Closing as stale. This PR registered the profile against transient LCIDs (0x2000–0x2C00) and enabled it per-user via Set-WinUserLanguageList ain + InstallLayoutOrTip. On real Windows that path fails: Set-WinUserLanguageList rejects ain as an invalid language and Windows assigns no transient LCID, so the profile never surfaces.

The shipping build (on integration, released as v0.2.x) instead registers under the Japanese langid (0x0411), enabled by default — the IME works, listed under Japanese. Proper "shows as Ainu" needs Keyman-style direct registry provisioning of a custom language, tracked separately (task #3). Superseded; not merging.

@mkpoli mkpoli closed this Jun 15, 2026
@mkpoli
mkpoli deleted the v0.2-ainu-locale branch June 16, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant