Configuration
You can configure the SDK behavior to your needs with the inlang.config.js
file. This file is located in the root of your project. Just add the sdkPlugin
and configure it to your project's needs.
Configuration options
There are limited configuration options for now. We will add more options in the coming weeks.
languageNegotiation
The languageNegotiation
property makes it possible to customize the behavior how you application detects the language of the user.
strategies
You can choose between different strategies to detect the language of the user. You can specify multiple strategies. The first strategy that returns a language will be used.
localStorage
Detects if the language
key is set in the localStorage and uses it as the language for the application.
url
Detects the language
by looking at the first segment of the url e.g. /en/about
resources
The resources
property defines how to deal with resources read with the resolved inlang.config.js
.
cache
Defines how to cache resources.
Right now we only support static Resources. Please open an Issue if you need to regularly fetch Resources.
build-time (default)
Loads all Resources during build time and adds them to the bundle.
Is something unclear or do you have questions? Reach out to us in our Discord channel or open a Discussion or an Issue on Github.