Welcome Guest, Not a member yet? Register   Sign In
How use translated database

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


[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




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

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?

i would create 2 tables:

header_id int autoincrement

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.



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

Theme © iAndrew 2016 - Forum software by © MyBB