feat(i18n): add pseudolocalization support for testing#1279
Open
yslpn wants to merge 1 commit intoopen-circle:mainfrom
Open
feat(i18n): add pseudolocalization support for testing#1279yslpn wants to merge 1 commit intoopen-circle:mainfrom
yslpn wants to merge 1 commit intoopen-circle:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds pseudolocalization support to the @valibot/i18n package to help test internationalization features by replacing English text with accented characters and special markers.
- Added pseudolocalized error messages with accented characters and boundary markers
- Updated the type system to include
'pseudo'as a valid language code - Integrated pseudolocalization into the build pipeline and package exports
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/i18n/src/types.ts | Added 'pseudo' language code to the Language type union |
| packages/i18n/src/pseudo.ts | Implemented comprehensive pseudolocalized error messages for all validation types |
| packages/i18n/scripts/build-npm.ts | Added pseudo import and included it in the languages array for npm build |
| packages/i18n/scripts/build-jsr.ts | Added pseudo import and included it in the languages array for JSR build |
| packages/i18n/package.json | Added extensive package exports for all pseudo locale files |
| packages/i18n/jsr.json | Added pseudo exports and exclude patterns for JSR configuration |
| packages/i18n/.gitignore | Added pseudo directory to gitignore |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Pseudolocalization Support
This PR adds pseudolocalization support to
@valibot/i18nfor testing internationalization.What is Pseudolocalization?
Pseudolocalization is a testing technique that replaces text with accented characters and special markers to help identify i18n issues:
[!!! ... !!!]help identify truncated text${issue.received}are preservedChanges
pseudo.tswith pseudolocalized error messagestypes.tsto include'pseudo'language codebuild-npm.ts,build-jsr.ts) to include pseudolocalizationpackage.jsonto export pseudo locale filesExamples in other libs:
Lingui - https://lingui.dev/guides/pseudolocalization
Dayjs - https://github.com/iamkun/dayjs/blob/dev/src/locale/x-pseudo.js