I made a plugin library called Aurelia-Slickgrid and I'm looking at adding i18n to support multiple locales. I got it all setup and working in my own development environment but then once I have it all bundled and everything, how will the user use the locale that I created (from node_modules/aurelia-slickgrid/locales
)? Will the user have to copy & paste the keys/values that I created? I only have a dozen keys or so, not that big of a deal but still, I would rather use them directly.
The current setup that I have is like this
import { I18N, TCustomAttribute } from 'aurelia-i18n';
import * as Backend from 'i18next-xhr-backend';
export function configure(aurelia: Aurelia) {
aurelia.use.plugin(PLATFORM.moduleName('aurelia-i18n'), (instance) => {
instance.i18next.use(Backend);
return instance.setup({
backend: {
loadPath: './locales/{{lng}}.json',
},
lng: 'en',
attributes: ['t', 'i18n'],
fallbackLng: 'en',
debug: false
});
});
}
I know that I can add the {{ns}}
in the play but I don't think that will help me. The problem is more around, how can I add another endpoint? If I add ns
like this
loadPath: './locales/{{lng}}/{{ns}}.json', // <-- XHR settings for where to get the files from
It still comes from the same endpoint. So the question is really about, how to handle multiple backend endpoints/paths.