Component text customization #1098
-
Hi, while using the new react dropdown component we notice that some of the previous text customization has been removed here. We were wondering if there is a replacement option for us to customize the text used in green component moving forward? p.s. we notice the usage for |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yes, 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 should work to import and register custom translations and create some better documentation. In the mean time, if you need an other language than Swedish or English, you can create a copy of this file and rename it to the language code that you need, update the translation, and open a PR, and then I can integrate it in the built-in localization module for you. |
Beta Was this translation helpful? Give feedback.
-
@eweseong There is a PR open now with some additional documentation, and some code changes to make it possible to import custom localization. This is still in an early stage though, so i'm not sure if it will solve your problem. If you can elaborate on exactly what you need, we can try to make sure that your use case is covered. |
Beta Was this translation helpful? Give feedback.
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:
I'll have a look at how it…