Issue's with multilanguage |
[eluser]Maaark[/eluser]
Hello, I just followed this tutorial: http://codeigniter.com/wiki/i18n_Multi-l...ry_Helper/ but I can not make it work.. I added all the files to my ftp, I emptied the $config[language] array and the autoload language array and in the controller I putted: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); I added in the view: Code: <h2><?= i18n('register_pagetitle');?></h2> and in the folder dutch/ I added the file register But I have to place the , 'dutch' to the controller otherwise it won't work.. The site is placed on a .nl site so application/config/language.php should have set a default_lang dutch.. Could this problem been caused since I use a subdomain? PS. I'm new to codeigniter ![]() Thanks in advance!
[eluser]Stoney[/eluser]
Hi, I'm using this i18 library, works like a charm: http://maestric.com/doc/php/codeigniter_i18n I think you should use Code: <h2><?=lang('register_pagetitle');?></h2> Quote:
[eluser]Maaark[/eluser]
Thanks for your reply, your suggestion won't work unfortunattely. I think the problem is that the default language isn't loaded propperly, even when I add /nl/ in the url it won't work.
[eluser]approacher[/eluser]
I think whatever language that you want to use must be located inside ...>application/libraries Hope you got this if I understood your problem.
[eluser]Maaark[/eluser]
[quote author="approacher" date="1305762250"]I think whatever language that you want to use must be located inside ...>application/libraries Hope you got this if I understood your problem.[/quote] The files are located in the libaries folder. [quote author="Julio Fagundes" date="1305762328"]http://maestric.com/doc/php/codeigniter_i18n ![]() That doesn't support to change the pagename for each language? example: site.com/nl/nieuws site.com/en/news am I right?
[eluser]approacher[/eluser]
[quote author="Maaark" date="1305766727"][quote author="approacher" date="1305762250"]I think whatever language that you want to use must be located inside ...>application/libraries Hope you got this if I understood your problem.[/quote] The files are located in the libaries folder. am I right?[/quote] Sorry for the mistake... I was willing to tell <b>application\language\ </b>but by mistake I wrote <i>libraries</i>. Try if it works. http://ellislab.com/codeigniter/user-gui...guage.html
[eluser]Stoney[/eluser]
[quote author="Julio Fagundes" date="1305762328"]http://maestric.com/doc/php/codeigniter_i18n ![]() That doesn't support to change the pagename for each language? example: site.com/nl/nieuws site.com/en/news am I right?[/quote] [/quote] Yes and No... Your pages are controllers (or controller functions), so you have to route each language specific page to one controller function. Code: // Urls start
[eluser]Maaark[/eluser]
[quote author="cimet" date="1305806687"][quote author="Julio Fagundes" date="1305762328"]http://maestric.com/doc/php/codeigniter_i18n ![]() That doesn't support to change the pagename for each language? example: site.com/nl/nieuws site.com/en/news am I right?[/quote] [/quote] Yes and No... Your pages are controllers (or controller functions), so you have to route each language specific page to one controller function. Code: // Urls start Thanks! That explains a lot! I fixed it by autoloading the language config :$ Was that stupid?
[eluser]Stoney[/eluser]
The i18 library should load it's config and the appropriate language, after it's initialization. You can debug it from the CI logs. BTW as long as it works it can't be stupid ![]() |
Welcome Guest, Not a member yet? Register Sign In |