Part of the EllisLab Network
This thread is a discussion for the wiki article: CodeIgniter 2.1 internationalization i18n
   
6 of 7
6
CodeIgniter 2.1 internationalization i18n
Posted: 31 October 2011 03:29 AM   [ Ignore ]   [ # 76 ]  
Summer Student
Total Posts:  2
Joined  10-31-2011

i had this problom too .. thanx alot

 Signature 

www.gegli.com/sara_starr87
add me here plz

Profile
 
 
Posted: 01 November 2011 02:54 PM   [ Ignore ]   [ # 77 ]  
Summer Student
Avatar
Total Posts:  1
Joined  04-30-2011
sineld - 10 October 2011 06:37 AM

My forms do not post anymore. All POST’s has turned into GET. What should I do?

There are a problem with forms via POST , CI makes a redirect via GET, the POST data is gone, Someone knows how to solve this issue

Profile
 
 
Posted: 19 November 2011 06:16 AM   [ Ignore ]   [ # 78 ]  
Summer Student
Total Posts:  3
Joined  11-19-2011

Hello folks, and first of all congrats for this wonderful code to make available site in various languages. Right now I have a problem with keeping selected the selected language, the problem is that when I change the language and go to another category (for example) it will go back to default language. I was looking through the code and I saw that you don’t use any sessions or whatever to keep the selected language, so have I missed something?

Profile
 
 
Posted: 20 November 2011 09:55 AM   [ Ignore ]   [ # 79 ]  
Summer Student
Total Posts:  6
Joined  01-30-2008

The piece of code

return (array_key_exists($browser_lang$this->languages)) ? $browser_lang:'en'

should be replace by

// get first key element
  
$default_lang array_splice(array_keys($this->languages), 0,1); 
  return (
array_key_exists($browser_lang$this->languages)) ? $browser_lang$default_lang[0]

I don’t have rights to edit the wiki. When you don’t support english, you’ll get an error.

Profile
 
 
Posted: 21 November 2011 12:04 PM   [ Ignore ]   [ # 80 ]  
Summer Student
Total Posts:  3
Joined  11-19-2011

I don’t know Jelle if that was ment for me, but if it was… it doesn’t work.

Profile
 
 
Posted: 21 November 2011 12:41 PM   [ Ignore ]   [ # 81 ]  
Summer Student
Total Posts:  6
Joined  01-30-2008

No, just a general reply to the wiki

Profile
 
 
Posted: 23 November 2011 08:29 AM   [ Ignore ]   [ # 82 ]  
Summer Student
Avatar
Total Posts:  7
Joined  06-25-2011

I’m (re)building my site to multilingual.
For user convenience I would like to remember the user preferred language. So when this user returns it would read its language cookie and redirect to the preferred language.

some user (like me) have their computer setup in English and would prefer to have a site in different language (when available of course)


What is the best place to solve this? I started in MY_controller, but then I thought that this should be done a lot earlier in the process. Ie when loading the language helper or is this an improvement / extension on this great library?

someone ideas?

Profile
 
 
Posted: 28 November 2011 07:35 AM   [ Ignore ]   [ # 83 ]  
Summer Student
Total Posts:  7
Joined  12-19-2009

How can i fetch available languages list from db? Is there way to access db driver from MY_lang file?

Profile
 
 
Posted: 24 December 2011 10:13 AM   [ Ignore ]   [ # 84 ]  
Summer Student
Total Posts:  12
Joined  04-20-2011

I’m using this library but it has given me more headaches then a framework should.

For one, I have used htaccess to remove index from the url but for some reason the language the user has selected doesn’t show in the links to the other pages any more either. Let me enlighten this with an example:

I have a menu with the following item:

<li <?php if (($this->uri->segment(2))== $menu[1]) echo 'class="active"';?> ><a href="<?php echo $menu[1]?>"><?php echo ucfirst($menu[1])?></a></li

the variable

$menu[1] 

comes from the controller and contains a string with the name of the menu item, in this case it’s either ‘activities’ or ‘activiteiten’, depending on what language the user selected (english or dutch).

The link to that page is the same as the name, again, either ‘activities’ or ‘activiteiten’.

but here is the problem, when I hover over it and see the entire path, the language segment isn’t shown and when I click it, it goes to the page but in the default language, english.

Why is this? I know that it once went to the correct page, before I used .htaccess.

Of course when I use the anchor object/variable/whatever, it works without having to specify the language.

Profile
 
 
Posted: 27 December 2011 03:23 PM   [ Ignore ]   [ # 85 ]  
Summer Student
Total Posts:  12
Joined  04-20-2011

Ok, this library doesn’t work like it should, no matter what language is at the top, it will always load english version.

Edit: just read http://codeigniter.com/forums/viewthread/179036/P75/#955310

I’m amazed that this hasn’t been fixed yet.

Profile
 
 
Posted: 05 January 2012 09:31 PM   [ Ignore ]   [ # 86 ]  
Summer Student
Total Posts:  29
Joined  11-17-2011

Is it possible to add check to function default_lang() to check default language with session or maybe you will add an idea. I have already asked about this here

Trying to add check session I get error

Profile
 
 
Posted: 31 January 2012 05:56 PM   [ Ignore ]   [ # 87 ]  
Summer Student
Total Posts:  1
Joined  08-26-2010

Since I spent like 2 hours figuring the problem it might be useful to someone.

On my local WAMP install… All was working fine.
When I uploaded in the client’s sever… Hell !!
with for instance :
Fatal error: Call to undefined method CI_Lang::CI_Lang() in /www/websites/audio-machinery/application/core/MY_Lang.php on line 32.

Language variable were parsing fine, but routing was down. So was language switching… All that was in the MY_Lang.php extend. why why why ??

It’s stupid and so am I. I was searching complexity here where there was none :

MY_Lang.php
MY_lang.php
is the same on WAMP not on *nix based

MY_Config.php
MY_config.php
is the same on WAMP not on *nix based

Stupid caps sensitive / insensitive.

Profile
 
 
Posted: 31 January 2012 06:54 PM   [ Ignore ]   [ # 88 ]  
Summer Student
Avatar
Total Posts:  6
Joined  01-31-2012

Hi there,

I have changed the helper MY_language_helper to play with singular/plural:

$CI =& get_instance();

 if((int) 
$id 1)
 
{
  $line 
$line .'_plural';
 
}
 
$line 
$CI->lang->line($line); 

Between first and last rows I’am just checking if $id parameter as integer is greater than 1 then change the content of $line adding ‘_plural’ to the end. Then when you configure your language file just do:

$lang['tot_prod'"There is 1 item in the cart";
$lang['tot_prod_plural'"There are %s items in the cart"

Now you can echo your language like this:

<?php
  $items 
2;
  echo 
lang('tot_prod'$items);
?> 

Just try different values for $items.

Hope this helps!

 

Profile
 
 
Posted: 27 February 2012 07:22 AM   [ Ignore ]   [ # 89 ]  
Summer Student
Total Posts:  4
Joined  02-27-2012

I have some issues in routes. At the begining, I don’t use internationalization, so I have hide method name in routes look like that:

$route['/product/(:any)'"product/detail/$1"

my website can run with:
  http://localhost:8080/CI_demo1/product/abc
instead of
  http://localhost:8080/CI_demo1/product/detail/abc

But when I use internationalization i18n. My routes file add more some line:

// URI like '/en/about' -> use controller 'about'
$route['^(vi|en)/(.+)$'"$2";

// '/en', '/de', '/fr' and '/nl' URIs -> use default controller
$route['^(vi|en)$'$route['default_controller']

Then My website can’t run with URL: http://localhost:8080/CI_demo1/en/product/abc any more.
It’s just run with URL:http://localhost:8080/CI_demo1/en/product/detail/abc.
Can anyone help me ?

Profile
 
 
Posted: 27 February 2012 05:25 PM   [ Ignore ]   [ # 90 ]  
Summer Student
Total Posts:  3
Joined  11-17-2010

I switched from Windows wamp server to lubuntu lamp, same code. Now the same address localhost/Projects/Test/en/ and I get Not found. If I remove this mod then it’s fine. I’m tired of working on this. This same code works on my production hostgator server (linux). Am I missing something on my server maybe?

This works:
http://server-959f1293/Projects/Test/index.php/en/welcome

This doesn’t:
http://server-959f1293/Projects/Test/en/welcome

Profile
 
 
   
6 of 7
6
 
‹‹ Paypal Lib issue      OB Session ››