Managing multilanguage website with CI |
[eluser]WebMada[/eluser]
Hello! Is there an advised way to manage that in CI For me, I do like the following: Code: switch ($Language) { In each start of all views It's so long and it will be harder when we add more languages I just remark that other MVC frameworks like JELIX have special classes to manage internationalization (multilanguage)
[eluser]Kamarg[/eluser]
CodeIgniter has a core library for multi-language support. Check the documentation.
[eluser]WebMada[/eluser]
ok, CI has it like in Jelix! Thanx for the link So, do u advise me to use that now? I just remark that for my DB datas, i use 2 fields as: Title_en, Title_fr, Content_en, Content_fr !!! The problem is if we will support more languages!
[eluser]Kamarg[/eluser]
Personally I've found the CI library works wonderfully and would recommend you go that route. If you have many languages, it can be tedious to update your files but it would be just as bad with a database.
[eluser]Miroslav Vitanov[/eluser]
[quote author="WebMada" date="1268919270"]ok, CI has it like in Jelix! Thanx for the link So, do u advise me to use that now? I just remark that for my DB datas, i use 2 fields as: Title_en, Title_fr, Content_en, Content_fr !!! The problem is if we will support more languages![/quote] I personally would advise you to split the logic. Create one table which would hold the diffrent laguages for example 'language' with the following structure - lang_id, lang_name, and the if you have news in the news table simply put a field lang_id and depending on the loaded language you select the content written in it. I hope you got the idea :d |
Welcome Guest, Not a member yet? Register Sign In |