Welcome Guest, Not a member yet? Register   Sign In
Multilingual i18n enviroment for CodeIgniter
#21

[eluser]brizoo[/eluser]
Hi, Thank you very much for this i18n library, this is the only easy one I've found.
I'm still stuck with a little problem, how do you do to remove the index.php part of the URL ?

I have
Code:
$config['index_page'] = '';
like this

my routes are these :

Code:
$route['default_controller'] = "example";
$route['404_override'] = '';

// All re-mappings must begin with '^(fr|en|es)' !!!

$route['^((fr|en|es)/)?test/(.+)$'] = "example/test/$3";

$route['^(fr|en|es)/(.+)$'] = "$2";
$route['^(fr|en|es)$'] = $route['default_controller'];

and my .htaccess file is like this :
Code:
RewriteEngine on

AddDefaultCharset UTF-8

RewriteCond $1 !^(index\.php|images|img|javascript|js|fonts|content|uploads|images|styles.css|layout.html|public|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
What do you think is wrong ?

Thanks
#22

[eluser]keevitaja[/eluser]
http://ellislab.com/codeigniter/user-gui.../urls.html

read the part which begins with the "Removing the index.php file"
#23

[eluser]brizoo[/eluser]
[quote author="keevitaja" date="1355835511"]http://ellislab.com/codeigniter/user-guide/general/urls.html

read the part which begins with the "Removing the index.php file"[/quote]

This is exactly what I've followed but this is still not working for me Sad
#24

[eluser]brizoo[/eluser]
Ok,
I got it !

I had to do this for the .htaccess file :

[Code]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

<Files "index.php">
AcceptPathInfo On
</Files> [\Code]
#25

[eluser]darksoulsong[/eluser]
I'm using this library and everything is doing just fine.
But I'm trying to make CI redirect to the main lang when an unsupported lang is supplied.

I tried to debug it on the MY_Lang file, but it seems that the language request is handled somewhere else before reaching this location, giving me a 404 page.

Any ideas about how to acomplish that? TYVM.
#26

[eluser]keevitaja[/eluser]
try config/routes.php

but what does a unsupported lang stand for? when you have french and english with en and fr then xx would be unsupported? i that case you have to redirect all first uri segments with length of 2. not wise
#27

[eluser]darksoulsong[/eluser]
Well, the idea is to handle the following situation:
My site has 2 supported languages: "pt-br" and "en". The first one was set as the main site language.
Let's say a user commits a typo and writes "pt" instead of "pt-br". In that case, the system redirects him to the default language that was set previously (pt-br, in my situation).
My goal is to redirect the user to "pt-br" if an unsupported lang is supplied, like "chinese", for example. That would be much more friendly than just give him a 404 page.
#28

[eluser]ranggadablues[/eluser]
Hi there, I like your multi language helper. But every time I go to another menu it's always back to default language, so I have to change the other language again. For the example the default language is English, and from about page I change to Dutch language then I go to news page it's back to default language. How that every time I go to another page without changing the language?

thank you
#29

[eluser]keevitaja[/eluser]
you must use helper lanchor() instead of anchor() in view files.
#30

[eluser]ranggadablues[/eluser]
[quote author="keevitaja" date="1360230162"]you must use helper lanchor() instead of anchor() in view files.[/quote]

thanks, I will try..




Theme © iAndrew 2016 - Forum software by © MyBB