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

feat(transloco): 🎸 allow to omit available languages #689

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

@stackblitz
Copy link

stackblitz bot commented Aug 10, 2023

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
@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.

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