I have the following in my `config/locales/en.json`
{
"countries": {
"au": {
"name": "Australia",
"fiatCurrency": "AUD",
"subnationalDivisions": {
"NSW": "New South Wales",
"WA": "Western Australia",
"VIC": "Victoria",
"QLD": "Queensland",
"TAS": "Tasmania",
"SA": "South Australia",
"NT": "Northern Territory",
"ACT": "Australian Capital Territory"
}
}
}
}
My `config/i18n.js` file looks like
module.exports.i18n = {
// Which locales are supported?
locales: ['en', 'es', 'fr', 'de'],
objectNotation: true
};
In my controller I am trying to retrieve the correct `subnationalDivision` name via
res.i18n("countries." + country + ".subnationalDivisions." + state)
but that just gives me `"countries.au.subnationalDivisions.ACT"`, not `"Australian Capital Territory"`
I've checked and trivial translations work fine but anything involving the use of objectNotation is ignored.
Does anyone have any examples of more complex i18n stuff with Sails?
As ever I've popped this question into Stackoverflow
Further to this, is there a way I can break the translations up into multiple files? Eg creating a /config/locales/en/ folder with separate translations for countries, various views, controls, etc.