So in the past day I worked on translating my project.
I followed the guide, and added the Cultures and selected one as Default.
I then translated the various XLF files, and changed the status to "translated" from "new", meanwhile I kept "final" on the default Culture.
So all should be good.
Now I added in my layout page a language picker, and started the app.
The language picker shows correctly the Cultures I added, and preselects correctly the default one.
The problem is, when changing language, nothing happens. Literally nothing.
I put some console.logs, I can tell you that:
-${locale} always stays the same, even after changing languages, it has the value of my default culture ("de-CH")
I went and looked the code of the LanguagePicker Component and I saw this:
LanguagePickerComponent.prototype.onChange = function (value) {
var path = location.href.replace(this.value, value);
if (!location.href.startsWith(path)) {
location.href = path;
}
};
here what I see is, there should be in the URL bar somewhere the current language, so I should have in my URL bar "de-CH" somewhere for this code to work, right?
This is not the case,
so I m wondering if I'm missing some crucial steps to activate the other languages or what I am doing wrong?
here a picture of the DEV tools where I put some breakpoints, as you can see, it will never enter the "if" condition as I don't have the "locale value" inside my URL