Forum Moderators: coopster

Message Too Old, No Replies

Included files when there are many languages

         

toplisek

6:10 pm on Jun 18, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm testing languages and versions. It works perfect but I have seen an issue that included file should not have the same file name inside particular language folder like en.

If I have fr folder and en folder and the same included file like footer.php, it will be all the time English version.

How to solve this issue as all tpl files are actually inside separate language folder but included files with the same name?

Language sessions are correct using Smarty framework.

lucy24

7:30 pm on Jun 18, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



included file should not have the same file name inside particular language folder like en

Do you mean for example
/en/folder/footer.php
/fr/folder/footer.php
/iu/folder/footer.php
like that?

It isn't 100% clear from your question whether you're linking to one file in one place, or to a bunch of separate files that are all really the same file, just copied to different URLs. If that's the case, seems like they shouldn't be inside the /en/ /fr/ etcetera directories at all, but instead inside a separate /includes/ directory that everyone points to. (Only it might be safer to call it by a different name.)

whitespace

7:55 pm on Jun 18, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



It's not clear why this would be a problem ("all the time English version") - assuming a folder structure like lucy24 suggests.

Although...

...all tpl files are actually inside separate language folder


All "templates" are inside the language folder as well? Why is that?

Maybe if you post your folder structure and how you are including files that will give us a better clue.

toplisek

6:42 pm on Jun 19, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It seems that internal memory was completely confused by errors. I have deleted files and uploaded again. It works now.

Thank you for all replies. I thought that I need to set Unset session when using languages as there is GET variable like en. As I like to be 100% sure that old languages (fr) is changed there is not needed to destroy session.

Is there any Javascript code to GET en value like my language.php?lang=en as browsers see all information which is not needed like mydomain/language.php?setlang=en but correct is mydomain/en