samedi 31 octobre 2015

A system for creating multilingual static websites

I have a website I'm working on that I wish to add another few (properly translated) language options for, and I can't find as much readily accessible information as I thought I could on producing a multilingual website.

There's a nice amount of information on how to structure your URL schema (with .com/LANGUAGE being the nicest), but if you have http://ift.tt/1n7zTmo, http://ift.tt/1innf4c, and http://ift.tt/KYWWe4 — then for a static site, how do you avoid manually duplicating code just to drop-in each language's strings?

My site has about 8 webpages with on average 400 words of content on each page. It's not enough content to require a database for. However, the website is still in development and I don't want to wait until the 'end' (it's an informational tool) of its development cycle to create static versions for each language. I also don't want to swap out variables server-side because I am under the impression this will greatly diminish SEO scoring?

So, without much information of the topic available to me, I have devised a system/program that I would like some feedback of feasibility on - or if an alternative exists (?), before I begin.

  • I am planning on creating master versions of each .html file (the only file that I actually edit for code changes) that contains a unique variable string for each instance of text
  • Create /language directories for each language, copying over all files from the master
  • Create a JSON file, structured appropriately to contain language strings for each variable
  • Using a small C program, parse each language into the appropriate variables for each language's .html file

...As I am using .git, I would also copy over only changes that need to be made, by comparing strings against existing variables. — The way I could compare files I have not yet thought through — was thinking of storing the variable for each string as a .html tag so that it is always existent in the file.

Does anybody know if a tool like this exists, or if there is a much more compelling and SEO-compliant method of performing this?

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire