CodeIgniter Forums

Full Version: How use translated database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3

El Forum

[eluser]keevitaja[/eluser]
first read [email=http://ellislab.com/codeigniter/user-guide/libraries/language.html]language class doc[/email] and underestand it. if you have some specific questions, ask them.

language filenames are the same for english and portuguese

./application/language/english/home_lang.php
./application/language/portuguese/home_lang.php

El Forum

[eluser]keevitaja[/eluser]
[quote author="Shwetang" date="1349185563"]I found because the application is showing the write screen, because any helper was not loaded so I loaded them and works but I received one error like this:


A PHP Error was encountered

Severity: Notice

Message: Undefined property: Main_Controller::$db

Filename: core/Model.php

Line Number: 50

Main_Controller:

http://pastebin.com/XRQcJdut


[/quote]

this error is originated from the main_model i think... use $this->db instead of $db

El Forum

[eluser]Shwetang[/eluser]
To do the translation database I created new tables with the same structure but with a prefix according to language.

Now I need in the load of application to verify the chosen language and change the $config['bdprefix'].

Does anyone have a suggestion of how I'll do it?

El Forum

[eluser]keevitaja[/eluser]
i would create 2 tables:

header
header_id int autoincrement

content
content_id int autoincrement
header_id int
language varchar
content text
+ some other fields

to add new content:

first create header and get its header_id
second create content and add created header_id and language segment

lets say you have about controller with 2 languages. in content table both languages have identical header_id, but different language segment.

to pull out the data from content table, you use header_id(both languages) and language segment.


El Forum

[eluser]Shwetang[/eluser]
Hi,

this is my route file :
*/

$route[‘default_controller’] = “redireciona”;
$route[‘404_override’] = ‘’;

// All re-mappings must begin with ‘^(en|et|ru)’ !!!

$route[’^(en|pt)/(.+)$’] = “$2”;
$route[’^(en|pt)$’] = $route[‘default_controller’];


//novas rotas para o menu
$route[‘home’] = ‘main_controller’;
$route[‘en/home’] = ‘main_controller’;
$route[‘a-bysat’] = ‘bysat_controller’;
$route[‘en/a-bysat’] = ‘bysat_controller’;
$route[‘en/produtos-e-servicos’] = ‘prod_serv_controller’;
$route[‘produtos-e-servicos’] = ‘prod_serv_controller’;
$route[‘en/casos-de-sucesso’] = ‘casos_controller’;
$route[‘casos-de-sucesso’] = ‘casos_controller’;
$route[‘en/trabalhe-conosco’] = ‘trabalhe_controller’;
$route[‘trabalhe-conosco’] = ‘trabalhe_controller’;
$route[‘en/entre-em-contato’] = ‘contato_controller’;
$route[‘entre-em-contato’] = ‘contato_controller’;
$route[‘en/contato’] = ‘contato_controller/contato/’;
$route[‘contato’] = ‘contato_controller/contato/’;
$route[‘casos_detalhes/(:num)’] = ‘casos_controller/detalhes/’;
$route[‘en/casos_detalhes/(:num)’] = ‘casos_controller/detalhes/’;
$route[‘segmentos/(:num)’] = ‘casos_controller/segmentos/’;
$route[‘en/segmentos/(:num)’] = ‘casos_controller/segmentos/’;


I have translated my website using mci language package but now the problem is link en/casos_detalhes/(:num) and en/segmentos/(:num) are not working but the other routes as in the links are working very fine ..Someone please help if you know what is happening ...

Thank You
Pages: 1 2 3