I'm creating a multilingual site and I'm looking to pass some additional configuration data to Twig so I can use it in my template. For example, suppose I have a configuration like this:
{
"serviceName": "arabic",
"language": "ar",
"textDirection": "rtl",
"socialMediaButtons": ["twitter", "facebook"],
...
}
I'd like to use this data to set the dir
attribute in my template:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ craft.locale }}" dir="{{ config.textDirection }}">
<head>
...
</head>
Is there an easy way to do this?
My project structure looks like this:
Where each locale directory has a config file.
Thanks!