Welcome Guest, Not a member yet? Register   Sign In
New CI 1.54 and autoloading languages
#1

[eluser]Référencement Google[/eluser]
Hi,

New versions of CI are always welcome and I am everytime happy to discover them.
I've got a question about Language autoloading, how it is intended to be used exactly and where do I place the languages files ?
#2

[eluser]Derek Jones[/eluser]
The Language Class docs describe what you need to accomplish this, elitemedia. If you're not seeing information regarding auto-loading on that page, try dumping your browser cache to make sure you're getting a fresh copy of the page.
#3

[eluser]mihu[/eluser]
This is a good feature, and hopefully we can attract more international users.
#4

[eluser]Référencement Google[/eluser]
Yes Derek, I've missed it, browser cache needed to be cleared... thanks
#5

[eluser]sikkle[/eluser]
But indeed,

where is the best place to load default if Session or cookie doesnt have any preference and load the user preference language if session cookie have it ?

if you have to do it on every page, what is the best practices ?

thanks.
#6

[eluser]Derek Allard[/eluser]
The language class doesn't (on its own) allow for the dynamic changing of languages. This is something you'd need to do pro programmatically on your own. If you want to see how I've used it, download a copy of BambooInvoice and play around a bit.
#7

[eluser]sikkle[/eluser]
Will be efficient to do this to be able change it on the fly ?

Create a library,

Detect if session have language set in userdata

if yes load it.

Detect if the browser have accepted language

if yes load it and write it in the session.

If nothing in the session and nothing detect from browser, load the default from the config file.


Just call this library in autoload just after the session.

Seem logic to do this ?
#8

[eluser]Derek Allard[/eluser]
Seems logical enough. There have been people who have written multilingual apps around these forums. I'd check out some of those threads first... I think at least 1 supported "on the fly" language switching.




Theme © iAndrew 2016 - Forum software by © MyBB