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

SLD parser causes i18next issue in projects that use i18next #944

Open
hwbllmnn opened this issue Jun 28, 2024 · 5 comments
Open

SLD parser causes i18next issue in projects that use i18next #944

hwbllmnn opened this issue Jun 28, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@hwbllmnn
Copy link
Contributor

Bug

Describe the bug

The initialization of i18next in the parser causes the initialization in downstream projects to fail. If using e.g. the fetch backend will not run (will not fetch the i18n files) in case the initialization in the SLD parser runs first.

To Reproduce
Steps to reproduce the behavior:

Embed the SLD parser in a project that also uses i18next (or react-i18next).

Expected behavior

I'd expect the i18next usage in the SLD parser not to influence the usage in downstream projects.

Desktop (please complete the following information):

Happens in all browsers.

Additional context

The initialization of i18next should probably be managed by configuration or by construction option. Perhaps a i18next configuration module could be created that can be used by downstream projects.

@hwbllmnn hwbllmnn added the bug Something isn't working label Jun 28, 2024
@marcjansen
Copy link
Contributor

I am a bit surprised. Why does a parser need i18next at all?

@hwbllmnn
Copy link
Contributor Author

This was added during the codesprint in Paris to enable localized error messages, which in principle I like. I was also surprised that i18next seems so inflexible regarding initialization (especially since in react it uses a proper context which obviously still doesn't prevent polluting the globals).

@KaiVolland
Copy link
Contributor

I suggested @ocruze to use i18next. He started with a different library but i told him that we use i18next elsewhere and it works well... 🤦‍♂️

@ocruze
Copy link
Member

ocruze commented Jul 1, 2024

Actually initially I didn't use any library at all, it was pure ts types. Maybe I can make another proposal with ts types and you can revert my PR?

@KaiVolland
Copy link
Contributor

Yeah this would be great. I'm afraid that this is kind of blocking the release of geostyler / geostyler-demo.

hwbllmnn added a commit that referenced this issue Jul 4, 2024
feat: reimplementing i18n for error messages without i18next #923 #924 #928 #944
github-actions bot pushed a commit that referenced this issue Jul 4, 2024
## [6.1.0](v6.0.0...v6.1.0) (2024-07-04)

### Features

* reimplementing i18n for error messages without i18next [#923](#923) [#924](#924) [#928](#928) [#944](#944) ([8252180](8252180))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants