Hi Team,
We are managing multilingual site. and need to manage different configuration values based on language site, meaning that we need one configuration per language site.
How we can manage to load specific configuration based on language or any property values inside configuration as input ?
Regards,
AP
Solved! Go to Solution.
Views
Replies
Total Likes
@arvind ,
for your scenario, I suggest using Apache Sling Context-Aware Configuration
The application needs different configuration for different sites, regions and tenants = different contexts. Some parameters may be shared, so inheritance for nested contexts and from global fallback values is supported as well. You have full control which content subtrees are the contexts in your application, the structure above is only an example.
Using the Context-Aware Configuration Java API you can get the matching configuration for each content resource without caring where it is stored or how the inheritance works.
full documentation can be found here: https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configurati...
-------------------------------------------------------
However, if you really wanted to use OSGI configurations, then what you can do is to create your OSGI configuration with your language variations, for example:
And then using AEM backend, to detect the language from the SlingHttpServletRequest object, and either output eng.subscriptionApiKey or fr.subscriptionApiKey.
@arvind ,
for your scenario, I suggest using Apache Sling Context-Aware Configuration
The application needs different configuration for different sites, regions and tenants = different contexts. Some parameters may be shared, so inheritance for nested contexts and from global fallback values is supported as well. You have full control which content subtrees are the contexts in your application, the structure above is only an example.
Using the Context-Aware Configuration Java API you can get the matching configuration for each content resource without caring where it is stored or how the inheritance works.
full documentation can be found here: https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configurati...
-------------------------------------------------------
However, if you really wanted to use OSGI configurations, then what you can do is to create your OSGI configuration with your language variations, for example:
And then using AEM backend, to detect the language from the SlingHttpServletRequest object, and either output eng.subscriptionApiKey or fr.subscriptionApiKey.
Hi @arvind
Agree with @BrianKasingli .In your case there is no need to create OSGi for country level and language level .In your case configuration are based on content hierarchy. so you should go ahead with Context-Aware Configuration
Thanks
Dipti
Views
Likes
Replies
Views
Likes
Replies