Skip to content

Conversation

@json-derulo
Copy link

@json-derulo json-derulo commented Aug 10, 2023

Currently the available languages need to be set, otherwise the translated values won't be returned. With this change the translation will also work when omitting the availableLangs config, or setting it to null.

Closes: #653

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Currently it is not allow to omit availableLangs by typings. When setting it to empty array, translation will never work, because there is a check whether the current language is available. There is no way to skip this check.

Issue Number: #653

What is the new behavior?

The check whether the current language is in the list of available languages can be skipped by omitting availableLangs in the config or setting it to null. This allows translation without the need of maintaining availableLangs.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Currently the available languages need to be set, otherwise the
translated values won't be returned. With this change, the translation
will also work when omitting the availableLangs config, or setting it to
null.

✅ Closes: jsverse#653
@json-derulo json-derulo force-pushed the feature/skip-available-langs branch from b65fce9 to a523726 Compare August 12, 2023 08:24
@shaharkazaz
Copy link
Collaborator

Thanks for the PR!
I have to say that I don't have full confidence in this solution as it feels more like shortcircuiting the logic that was made there.
We need to understand how this affects the flow of things as this was made for a reason

@lppedd
Copy link

lppedd commented Oct 31, 2024

I actually like this. The less configuration, the better imo.

@shaharkazaz shaharkazaz force-pushed the master branch 5 times, most recently from c068fa2 to d2ade9f Compare January 6, 2025 00:03
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.

Feature(config): support translation without needing to specify availableLangs

3 participants