简体   繁体   中英

how to create codeigniter website in multi language

I have read many questions regarding developing code igniter website multi language. I can make it for a single page using language class. I have an ecommerce website in code igniter and I want to convert it to multi language. should I have to copy the whole website in french folder and link English and french site?

The idea behind the language class is to have one copy of the website and simply insert strings pre-defined strings for the proper local when needed. So you will keep the website in one folder BUT you will have multiple language folders as defined in the codeigniter documents here http://ellislab.com/codeigniter/user-guide/libraries/language.html This way to add a local all you have to do is add a new language folder with all the proper strings and you don't have to edit links or anything in theory if done properly.

Well 1 more thing to the same / as shared above, you have to take care of images too to server / fit the purpose... If in case there are a certain images persisting to a certain language - it will be a faulty image being displayed for the language. Hence try to make sure you maintain such images too for seperate language. By default .. all default language images can stay in 1 folder.. and in other folders seperated by languages can rely in the same as sub-directories ... yes - try to make sure you have same name for the image. What you can do is write a function to retrieve the image for the specific language. If separate image for the language exists - it will be displayed else, the image for default language should be displayed. This way you can make sure you have entrusted the site to be completely for multi-linguistic approach

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM