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

Control supported languages #7

Closed
tobytwigger opened this issue Oct 22, 2020 · 1 comment · Fixed by #14
Closed

Control supported languages #7

tobytwigger opened this issue Oct 22, 2020 · 1 comment · Fixed by #14
Labels
enhancement New feature or request hacktoberfest-accepted Accepted as hacktoberfest issue help wanted Extra attention is needed
Milestone

Comments

@tobytwigger
Copy link
Owner

tobytwigger commented Oct 22, 2020

In some cases, users may want to limit the languages that can be used. This will particularly help for cases when translations have to be better than translation services can provide.

To handle this, a user can easily check translations from the database. However, this will (probably) only be done a language at a time.

Therefore, we should be able to set an array in the configuration file to determine which languages are officially supported. If this array is empty, all languages are supported. If languages are given, and the target language is not supported, the translation should not happen.

@tobytwigger tobytwigger changed the title Allowed langs Control supported languages Oct 22, 2020
@tobytwigger
Copy link
Owner Author

Create an interceptor, which should be registered infront of the cache. If the language is not supported, just return null immediately.

To get the supported languages, a static variable should be used. In the service provider we can add any languages to the static variable from the config. This will enable us to also support languages dynamically, rather than having to change the config.

@tobytwigger tobytwigger added enhancement New feature or request help wanted Extra attention is needed labels Oct 22, 2020
@tobytwigger tobytwigger added this to the Version 1 milestone Oct 22, 2020
@tobytwigger tobytwigger added the hacktoberfest-accepted Accepted as hacktoberfest issue label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest-accepted Accepted as hacktoberfest issue help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant