Helo,
We are trying to make multi-language website.
Our website itself is based on php/mysql, plus some other things here and there.
Now, we have talked about different ways of accomplishing it and it came down to two options:
1. Use templates.
Basically what this means is that we will create two identical templates, with different texts used depending on the language the user is currently looking at. When we load our pages, we will have to check the current language and load the templates accordingly.
This is similar to what apache's manual has.
2. Use variables.
Similar to option 1, we would define a list of variables which contain the texts we want to use. The variable will then be placed in a single template file. When we load the page, we would read the contents of the variable and then it will be replacing the variables in our template.
This is similar to what phpmyadmin has.
The question is, which do you think is a better approach?
With option 1, we would be less confused when defining the template, as we can see it right away when we create the templates. However, changing one language's template will require us to remember changing the template for other languages, and this is more likely to be missed.
With option 2, changing the template only needs to be done once. However, we need to be sure that our variables contain correct entries. Plus, when the variables grow in size (which is not unlikely), the maintenance may give us headache.
So, which one should we use?
Or, do you have other suggestions as to how to create multi-language website without having to recreate too much code?
Thank you.
-stndn.
We are trying to make multi-language website.
Our website itself is based on php/mysql, plus some other things here and there.
Now, we have talked about different ways of accomplishing it and it came down to two options:
1. Use templates.
Basically what this means is that we will create two identical templates, with different texts used depending on the language the user is currently looking at. When we load our pages, we will have to check the current language and load the templates accordingly.
This is similar to what apache's manual has.
2. Use variables.
Similar to option 1, we would define a list of variables which contain the texts we want to use. The variable will then be placed in a single template file. When we load the page, we would read the contents of the variable and then it will be replacing the variables in our template.
This is similar to what phpmyadmin has.
The question is, which do you think is a better approach?
With option 1, we would be less confused when defining the template, as we can see it right away when we create the templates. However, changing one language's template will require us to remember changing the template for other languages, and this is more likely to be missed.
With option 2, changing the template only needs to be done once. However, we need to be sure that our variables contain correct entries. Plus, when the variables grow in size (which is not unlikely), the maintenance may give us headache.
So, which one should we use?
Or, do you have other suggestions as to how to create multi-language website without having to recreate too much code?
Thank you.
-stndn.