Started a new au2 project with webpack: npx makes aurelia
and selected option: Default TypeScript Aurelia 2 App
Got started with setting up i18n from the docs: Internationalization (i18n)
After installing the plugin and registering the first example, it seems to work just fine:
options.initOptions = {
resources: {
en: { translation: { key: "Hello I18N"} },
de: { translation: { key: "Hallo I18N"} },
}
};
I’m interested in getting the i18next Backend plugin method working to asynchronously load the resource file when needed. I followed the instructions in the docs and installed i18next-fetch-backend plugin and using the default settings:
options.initOptions = {
plugins: [Fetch],
backend: {
loadPath: '/locales/{{lng}}/{{ns}}.json',
}
};
After that setup and running the app with npm start
the translation <span t="key"></span>
is not working anymore because the translation.json
file I created gets a 404 somehow. I also noticed that the favicon.ico file that came with the aurelia template is getting a 404:
Maybe these 404’s are somehow connected that webpack is not able to serve these static files? Has anybody got an idea?