Skip to content

feat(cli): add localizableKeys config option to bypass untranslatable…#2004

Merged
AndreyHirsa merged 1 commit intomainfrom
feat/localizableKeys
Feb 23, 2026
Merged

feat(cli): add localizableKeys config option to bypass untranslatable…#2004
AndreyHirsa merged 1 commit intomainfrom
feat/localizableKeys

Conversation

@AndreyHirsa
Copy link
Contributor

@AndreyHirsa AndreyHirsa commented Feb 22, 2026

Summary

Add localizableKeys bucket config option to force‑translate values that would otherwise be auto‑skipped by the untranslatable filter (e.g., pure numbers, URLs, ISO dates).

Changes

  • Added config schema v1.13 with optional localizableKeys: string[] on bucket config.
  • Wired localizableKeys through all 33 bucket types in the loader pipeline and all 10 createBucketLoader call sites.
  • Used matchesKeyPattern for matching — supports exact, prefix, and glob patterns (consistent with lockedKeys, ignoredKeys, preservedKeys).
  • Applied encodeKeys for xcode-xcstrings variants and normalizeCsvPatterns for csv-per-locale (consistent with other key configs).

Testing

Business logic tests added:

  • Exact key match - numeric value bypasses unlocalizable filter.
  • Multiple bypassed keys - several keys kept in a single pull.
  • Push round‑trip - bypassed keys correctly restored on push.
  • Nested key paths - "config/count" matches flattened nested objects.
  • Prefix matching - "config" matches all keys under config/.
  • Glob patterns - "*/count" matches count at any level.

Visuals

N/A - no UI changes.

Checklist

  • Changeset added.
  • Tests cover business logic (not just happy path).
  • No breaking changes - localizableKeys is optional, existing configs unaffected.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added localizableKeys bucket configuration option to force translation of specific values that would normally be excluded (such as numbers, URLs, and dates). This enhancement ensures custom translation rules can be applied to these previously skipped values.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

A new localizableKeys bucket configuration option is introduced to force-translate values that would normally be skipped as untranslatable (e.g., pure numbers, URLs, ISO dates). This option is threaded through the configuration schema, type definitions, loader pipeline, and all CLI command call sites.

Changes

Cohort / File(s) Summary
Configuration Schema Upgrade
.changeset/lazy-wings-joke.md, packages/spec/src/config.ts
Added v1.13 config schema with new optional localizableKeys: string[] field on buckets; updated LATEST_CONFIG_DEFINITION and added parseI18nConfig() export.
Type & Bucket Config
packages/cli/src/cli/cmd/run/_types.ts, packages/cli/src/cli/utils/buckets.ts
Added localizableKeys: string[] property to CmdRunTask interface and BucketConfig; both now include the field in their definitions.
Core Loader Implementation
packages/cli/src/cli/loaders/index.ts
Updated createBucketLoader signature to accept localizableKeys parameter; threaded it through all bucket-type pipelines by passing to createUnlocalizableLoader and transforming as needed (e.g., normalization for CSV, encoding for Xcode).
Unlocalizable Key Logic
packages/cli/src/cli/loaders/unlocalizable.ts
Extended createUnlocalizableLoader to accept localizableKeys parameter; updated _getUnlocalizableKeys to skip keys matching provided patterns, preventing them from being treated as untranslatable in pull/push operations.
Unlocalizable Tests
packages/cli/src/cli/loaders/unlocalizable.spec.ts
Added new test suite "localizableKeys bypass" covering single/multiple key bypass, nested paths, prefix-based bypass, and glob pattern matching scenarios.
CLI Command Integration
packages/cli/src/cli/cmd/cleanup.ts, i18n.ts, lockfile.ts, purge.ts, status.ts, run/execute.ts, run/frozen.ts, run/plan.ts
Consistently updated all createBucketLoader call sites to pass bucket.localizableKeys (or assignedTask.localizableKeys in run context); plan.ts additionally includes localizableKeys in task payload.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • vrcprl
  • cherkanovart

Poem

🐰 A hop through buckets, keys in tow,
Translations bloom where numbers grow,
URLs and dates now translate with care,
The localizable rabbit spreads them everywhere! 🌿✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a localizableKeys config option to bypass the untranslatable filter for values like numbers, URLs, and dates.
Description check ✅ Passed The pull request description follows the required template structure with all major sections completed: Summary, Changes, Testing, Visuals, and Checklist.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/localizableKeys

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

@AndreyHirsa AndreyHirsa merged commit 45c9437 into main Feb 23, 2026
18 checks passed
@AndreyHirsa AndreyHirsa deleted the feat/localizableKeys branch February 23, 2026 08:25
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.

2 participants