Skip to content

Component text customization #1098

Closed Answered by splashdust
eweseong asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, @lit/localize will be used for translations going forward. This is now handled in the underlying Web Component, and we want to keep as much stuff away from the wrapper as possible.

Currently, only English and Swedish are built in, but the idea is that there will be more language packs available for optional import in the future, and that you should be able to import your own if needed.

Currently, it can be used like this:

// Import the localization module
import { setLocale } from '@sebgroup/green-core/localization'

// Then, somewhere in your app code, for example on initialization
// and/or when the user interacts with a language selector:
setLocale('sv')

I'll have a look at how it…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by splashdust
Comment options

You must be logged in to vote
1 reply
@eweseong
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants