Closed tobytwigger closed 4 years ago
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.
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.