I'm trying to expand my site to multiple languages. The layout and code on all pages are exactly the same. The only thing I want is different languages.
I know from experience with Angular and i18n before, that creating a language file for each langauge is really easy. It would go something like this:
Which would, depending on the language you have set, output the string.
I know I can do something like this by creating a content page called "EN", then copy it and rename it "DK". However, these pages would contain the exact same values/models/objects, except if I go and add a new one. This is extremely bad practise, unless they are paired and always in sync, but the pages are not.
I know I can achieve the above using a dictionary (one for each translation). That is exactly what I want, but I don't want the culture from the content page to be the "determiner".
This seems like an extremely easy thing to do, but doing the "if I use this language, use this dictionary" doesn't seem to play nice with me.
Requirements:
No /en/ or /dk/ in the URL
Relatively easy to add new translations
Distinguish between each language
I will have a dropdown in my header with country selection.
Thanks!
EDIT: I should also mention, that I want labels/text to be translated (like I showed above), but I also want each content item to be translated. I can do this using Vorto or creating a new input. That won't be hard.
Multiple languages without copying
Hello!
I'm trying to expand my site to multiple languages. The layout and code on all pages are exactly the same. The only thing I want is different languages.
I know from experience with Angular and i18n before, that creating a language file for each langauge is really easy. It would go something like this:
and then another file for another language (like Danish):
On the page, I would then do something like this:
Which would, depending on the language you have set, output the string.
I know I can do something like this by creating a content page called "EN", then copy it and rename it "DK". However, these pages would contain the exact same values/models/objects, except if I go and add a new one. This is extremely bad practise, unless they are paired and always in sync, but the pages are not.
I know I can achieve the above using a dictionary (one for each translation). That is exactly what I want, but I don't want the culture from the content page to be the "determiner".
This seems like an extremely easy thing to do, but doing the "if I use this language, use this dictionary" doesn't seem to play nice with me.
Requirements:
I will have a dropdown in my header with country selection.
Thanks!
EDIT: I should also mention, that I want labels/text to be translated (like I showed above), but I also want each content item to be translated. I can do this using Vorto or creating a new input. That won't be hard.
Ended up using Vorto. I simply created an input for each text I wanted translated.
A bit more work than I was hoping, but now I simply have one content page with two cultures for languages. Pretty neat.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.