Skip to content

Add support for translations in Storybook/UI-lib#768

Merged
SjurSutterudSagen merged 2 commits intomainfrom
feature/PxWeb2-685-add-language-support-to-storybook-instance
Aug 15, 2025
Merged

Add support for translations in Storybook/UI-lib#768
SjurSutterudSagen merged 2 commits intomainfrom
feature/PxWeb2-685-add-language-support-to-storybook-instance

Conversation

@SjurSutterudSagen
Copy link
Contributor

@SjurSutterudSagen SjurSutterudSagen commented Jul 7, 2025

This adds a first iteration of language support to the Storybook in the PxWeb2 UI library. The solution was made following Storybooks example for this, but I also made considerations for speed and reducing complexity.

Therefore, there are improvements that can be made to this. For instance, we could consider moving the translation into their own package, and import them into other packages as needed. Now it just imports directly from the web app.

It also adds some stories to the VariableBox component, since we had left those out because they used the translations in such a large degree. The chevron for the groupings is determined by the input, so it does not switch when the language switches in the Storybook. Therefore I added a story for RTLdirection, which shows it being the correct way for RTL.

This adds a first iteration of language support to the Storybook in the
PxWeb2 UI library. The solution was made following Storybooks example
for this, but I also made considerations for speed and reducing
complexity.

Therefore, there are improvements that can be made to this. For
instance, we could consider moving the translation into their own
package, and import them into other packages as needed. Now it just
imports directly from the web app.
@github-actions
Copy link

github-actions bot commented Jul 7, 2025

Branch Deployment to Cloudflare Pages

🚛 Preview URL: https://b3c69c89.pxweb2.pages.dev
🚧 Branch preview URL: https://feature-pxweb2-685-add-langu.pxweb2.pages.dev

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2025

Copy link
Contributor

@PerIngeVaaje PerIngeVaaje left a comment

Choose a reason for hiding this comment

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

OK

@SjurSutterudSagen SjurSutterudSagen merged commit 6172c75 into main Aug 15, 2025
14 checks passed
@SjurSutterudSagen SjurSutterudSagen deleted the feature/PxWeb2-685-add-language-support-to-storybook-instance branch August 15, 2025 08:48
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