Skip to content

V1.0.1#39

Merged
Starllordz merged 3 commits intomainfrom
v1.0.1
Feb 26, 2026
Merged

V1.0.1#39
Starllordz merged 3 commits intomainfrom
v1.0.1

Conversation

@Starllordz
Copy link
Copy Markdown
Contributor

@Starllordz Starllordz commented Feb 26, 2026

Release v1.0.1 — Bug fixes for key deletion and TS file parsing

Summary

  • Fixed a bug where i18n keys containing / (e.g. date/format) were incorrectly deleted during
    translation, as / was being used as the internal key separator
  • Fixed .ts file parsing being applied to all TypeScript files instead of only i18n translation
    files
  • Bumped version to 1.0.1

Details

  • Replaced / with the null character (\0) as the internal flat-key separator to avoid conflicts
    with keys that legitimately contain /
  • Restricted the TS parser to only match files that are actual i18n sources
  • Updated and expanded test coverage across JSON, TS, Vue parsers, and locale/checksum utilities

* fix: restrict .ts file parsing to i18n files only

## Changed
- Skip non-i18n .ts files during locale extraction to avoid parse errors on regular TypeScript files
- Updated extractLocaleFromPath and extractAllLocalesFromProject to match only `i18n.ts` files

## New
- Tests for non-i18n .ts file filtering in both extraction functions
- Added .claude/ to .gitignore

* fix: added checks for non i18n files in locale directory

* refactor: replace `any` with proper type assertions in tests

## Changed
- Replace `as any` with `as unknown as ParserFactory` for mock parser arguments in checksum tests
- Replace `as any` with `as unknown as void` for mock implementations in checksum and locale tests
- Replace `as any` with `as unknown as Record<string, unknown>` for edge-case inputs in parser tests
- Replace `as any` with `as unknown` for mock return values in locale tests

Made-with: Cursor

* fix: improved ts files recognition for patterns xx-i18n.ts
* fix: prevent deletion of keys containing "/"

## Changed
- Use null byte (\0) as internal flat/unflatten delimiter instead of "/"
- Convert flattened keys back to "/" for user-facing pattern matching (lockedKeys, ignoredKeys, keyInstructions)
- Update locale extraction to split on null byte delimiter

## New
- Tests verifying keys with "/" (e.g. "harassment/threatening") survive parse/serialize round-trip

* refactor: deduplicate delimiter conversion logic

## Changed
- Extract toUserKey() helper for \0 → "/" key conversion
- Compute user-facing key once per key in translation loop
- Update JSDoc examples to reflect \0 delimiter
## Changed
- Updated version in package.json from 1.0.0 to 1.0.1
- Updated version badge in README.md to 1.0.1
@Starllordz Starllordz marked this pull request as ready for review February 26, 2026 11:54
@Starllordz Starllordz marked this pull request as draft February 26, 2026 11:54
@Starllordz Starllordz marked this pull request as ready for review February 26, 2026 13:13
@Starllordz Starllordz merged commit 9d41f2b into main Feb 26, 2026
@Starllordz Starllordz deleted the v1.0.1 branch March 10, 2026 10:04
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