Skip to content

DEV: Add a Translation component. #33082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

pento
Copy link
Member

@pento pento commented Jun 5, 2025

✨ What's This?

Reference: t/155601

A new <Translation> component for interpolating components into translatable strings.

Example:

/// "some.translation.key" = "Welcome, %{username}! The date is %{shortdate}!"
<Translation
  @scope="some.translation.key"
  @placeholders={{array "username"}}
  @options={{hash shortdate=shortDate}}
>
  <:placeholders as |Placeholder|>
    <Placeholder @name="username">
      <UserLink @user={{user}}>{{user.username}}</UserLink>
    </Placeholder>
  </:placeholders>
</Translation>

📺 Screenshots

image

👑 Testing

(There's currently only a single demo test, more tests will be included once the API is properly defined.)

@pento pento self-assigned this Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant