Skip to content

Conversation

yslpn
Copy link
Contributor

@yslpn yslpn commented Aug 17, 2025

Add Pseudolocalization Support

This PR adds pseudolocalization support to @valibot/i18n for testing internationalization.

What is Pseudolocalization?

Pseudolocalization is a testing technique that replaces text with accented characters and special markers to help identify i18n issues:

  • Accented characters test Unicode support and font rendering
  • Increased text length (~30% longer) tests UI layout with longer translations
  • Boundary markers [!!! ... !!!] help identify truncated text
  • Template variables like ${issue.received} are preserved

Changes

  • Added pseudo.ts with pseudolocalized error messages
  • Updated types.ts to include 'pseudo' language code
  • Updated build scripts (build-npm.ts, build-jsr.ts) to include pseudolocalization
  • Updated package.json to export pseudo locale files
// Before (English)
Invalid type: Expected string but received 123

// After (Pseudolocalized)  
[!!! ẋẋẋ Ìñvàlìd týpé: Éxpéçţéd string büţ réçéìvéd 123 ẋẋẋ !!!]

Examples in other libs:

Lingui - https://lingui.dev/guides/pseudolocalization
Dayjs - https://github.com/iamkun/dayjs/blob/dev/src/locale/x-pseudo.js

@Copilot Copilot AI review requested due to automatic review settings August 17, 2025 12:20
Copy link

vercel bot commented Aug 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
valibot Ready Ready Preview Comment Aug 17, 2025 0:23am

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Aug 17, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant