Locale should be included in FTL files
At the moment, FTL files are full of localized messages, but they do not provide a way of communicating for which locale or locales those messages apply. This is a bit problematic, as it means that this metadata effectively gets encoded in the file or directory name, where there is less regularity in the encoding and practically speaking no ability to include more than one locale.
Following the pattern of #180 and #208, this would probably mean adding a new file-level semantic comment:
# @locale en-UK, en-CA
I encountered this issue while working on fluent-loader, a Webpack loader that uses my fluent-compiler internally. In that application, FTL files get loaded with a command like import bundle from './messages.ftl', and with multi-locale support the locale detection currently ends up being rather fragile.
Other file formats we use at mozilla do that (XLIFF, for example), and it's generally a PITA to deal with on the tooling side. Also, tools like Pontoon couldn't save a file w/out having context information at the serialization level they might commonly not have. For example, in XLIFF, we don't handle that, as that meta data is generated when creating the bilingual files from templates.
To me, this sounds more like creating a source of errors than a solution to prevent them.
I also don't think this is a strong-enough argument to unwrap the design of Resources and Bundles.
So what is the recommended alternative for storing the locale or locales of an FTL file?
This feels to me like a perfect use case of https://github.com/projectfluent/fluent/issues/139