Skip to content
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

component library #171

Closed
genvlad opened this issue Feb 27, 2024 · 0 comments
Closed

component library #171

genvlad opened this issue Feb 27, 2024 · 0 comments

Comments

@genvlad
Copy link

genvlad commented Feb 27, 2024

Hello, I would like to ask you for some hints, because i dont know how to solve it.

I have two project based on svelte kit:

ui-components - selft stand, independent component library which is bild as library not app

my-application - application with pages, routes, layouts and so on, it has dependency to ui-components

In both project I use https://github.com/sveltekit-i18n/lib for app translation.

Now let imagine this case, for example. In ui-components I have SaveButton.svelte component. Which is simple component with icon, label and some tailwind css classes. ui-components contains localisation files en.json and de.json, with localised key "save" which is used as name of this buuton. In ui-components is implemented also one page.svelte which show all components contained in this library. But this page is only for develop purpose and is not exported to dist folder and this demo page using default en locale.

my-application contains several pages with also ssr. it has implemented own sveltekit-i18n with custom localisation files en.json and de.json. But it also using components from component library ui-components. in header user can select locale of app, and after that app is switch to correct translation.

Problem: I dont know how to deal with it that ui-components and my-application has own translations. How to connect selected locale from my application to ui-components. How to handle change. I would like to have custom translation files for components included in ui-component library, but I would like to reflect to locale which is selected in owned app.

I hope that is clear. If not please let me know. Thank you very much for each help.

@genvlad genvlad closed this as completed Feb 28, 2024
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

No branches or pull requests

1 participant