• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correct Multi-Language Approach

#11
[eluser]hemoglobina[/eluser]
Hello Koz and CI users,
I'm facing the same challenge myself and this was the best thread regarding the subject that I could find.
Do you mind telling how you approached this in the end?
@Koz: I hope you are still around Smile
Kind regards to all,
HEMOglobina

#12
[eluser]n0xie[/eluser]
[quote author="hemoglobina" date="1261682066"]Hello Koz and CI users,
I'm facing the same challenge myself and this was the best thread regarding the subject that I could find.
Do you mind telling how you approached this in the end?
@Koz: I hope you are still around Smile
Kind regards to all,
HEMOglobina[/quote]
Did you take a look at my links?

#13
[eluser]harbooz[/eluser]
Hi Hemo,

n0xie recommended a more professional method but I've preferred mine, that I find simpler.

The approach that works like a charm is the one I've described in the posts above.

I use 3 controllers, one for each language and I'm grabbing the language identifier into a global variable from the first URI segment. Then, I use this language identifier to display the right content from database, etc.

Cheers!

#14
[eluser]Ben Edmunds[/eluser]
Extending the router class is the correct way.

Take a look at Ionize CMS for an example, ionizecms.com

#15
[eluser]hemoglobina[/eluser]
Hello guys. First of all thanks a lot and xmas to all.

@n0xie: I took a look at your links. Thanks for sharing. I think I will be using i18n. I made some tests with it yesterday and it seems to work for me.

@harbooz: Thanks for sharing your approach. If something goes wrong with the other method, I will definitely use yours. One thing that I did not quite understand is if you have quite a lot of duplicated code if you use 3 controllers to do pretty much the same thing, right? If not, could you explain to me a bit deeper?

@Ben: I will for sure take a look at ionizecms.com. It seems really interesting!

Kind regards to all,
HEMOglobina

#16
[eluser]axmed[/eluser]
changing the language vi session(if users have cookies enabled) is cool but what about caching the pages, they will be stored in the language the first user selected till the page expires.so every time a user requests a page it will be generated for him, am stuck with a host bitching about cpu 10% utilization that's why i ask about caching besides is it not caching that makes codeigintor fast.

so what is the best solution to have multi-lang with caching support.

#17
[eluser]n0xie[/eluser]
Use url based language identification. Since caching is based on url matching, the same pages with different language prefix will be seen as different pages and thus will be separately cached.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.