Open Yopai opened 6 months ago
I prefer the simplicity of the first solution, just having separate HTML files for each language. The HTML files aren't huge, and there are only a few languages, so the disadvantage you list shouldn't be that big of an issue.
Ok. Then the redesign must be done first, because every change in it will have to be reflected in every file. I don't know what server lorcanajson.org is hosted on; aother solution would be to generate the file with some server-side scripting language like php
There are multiple ways to translate the site; I'll put them here to be able to have a discussion about them and we can pick one.
1) create a static
fr/index.html
Advantages: simple, well-separated. Disadvantages: if it is needed to change the site structure, both files must be modified2) write both in the same html file, and only show one language Either all english, then all french;
Or english block, then french block
Advantages: All text is kept in the html file. Disadvantages: Having both languages in the same file can be difficult to read.
3) Put text in language javascript files Something like what is done here : https://medium.com/@nohanabil/building-a-multilingual-static-website-a-step-by-step-guide-7af238cc8505
Advantages: Separate the HTML structure and the text; easier to translate Disadvantages: Text is not in the HTML file anymore; we have to find a translation key for each text block
Using Javascript also mean two possibilities :
What do you think ? Which one of these do you prefer ?