Part of the EllisLab Network
   
2 of 7
2
Language Translations
Posted: 31 March 2006 10:02 AM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  886
Joined  03-06-2006
lubos - 31 March 2006 08:59 AM

This is all nice, but in fact CI is not ready for multilingual sites, see my post http://codeigniter.com/forums/viewthread/44721/ - no answer till today. There is no easy way how to transfer language in URL.

I guess you mean that CI does not have built-in functions for multilingual sites. OTOH it is pretty easy to do without built-in functions. I added some suggestions to your thread.

You should not assume that CI does not provide a solution just because your post didn’t get any response. You might have done a little more study of the documentation and you would have seen a solution, or at least refined your question and asked again.

 Signature 

Corozal, Belize | Linux.bz | Using Kubuntu Linux 7.10 | CodeIgniter 1.5.3

Profile
 
 
Posted: 31 March 2006 10:16 AM   [ Ignore ]   [ # 17 ]  
Summer Student
Total Posts:  4
Joined  03-22-2006

Thanks for your suggestions, but it doesn’t help (see the thread for my reply). Be sure that I was thinking how to solve it before I post to forum. I studied Code Igniter URLs, URI Class, URI routing etc. in docs but I couldn’t find an easy and flexible solution without need of hacking CI itself.

Profile
 
 
Posted: 02 April 2006 03:02 PM   [ Ignore ]   [ # 18 ]  
Grad Student
Avatar
Rank
Total Posts:  71
Joined  04-02-2006
Ingmar - 14 March 2006 01:23 AM

Great to hear. Sorry my German pack will take another day or two.

Need some help?

Profile
 
 
Posted: 02 April 2006 03:44 PM   [ Ignore ]   [ # 19 ]  
Grad Student
Rank
Total Posts:  85
Joined  04-01-2006

Anybody need an English version? No? raspberry

Profile
 
 
Posted: 03 April 2006 04:58 AM   [ Ignore ]   [ # 20 ]  
Grad Student
Avatar
Rank
Total Posts:  63
Joined  03-02-2006
lubos - 31 March 2006 08:59 AM
Elliot Haughin - 28 March 2006 06:36 PM

I hope these are all integrated to the base of CI, to allow for better multilingual capabilities of CI.

This is all nice, but in fact CI is not ready for multilingual sites, see my post http://codeigniter.com/forums/viewthread/44721/ - no answer till today. There is no easy way how to transfer language in URL.


I don’t know if this may help you:
If you want to set the language for current session (of current user) you may create a little controller to set your lang in a cookie.
BTW the translations we are doing are simply for the base errors and functions integrated in the core, for a complete multilang solution you have to work with something like ‘i18l’.

 

Edit:
I just read the post at: http://codeigniter.com/forums/viewthread/44721/
take the good suggestions from linuxbz!

Profile
 
 
Posted: 05 April 2006 07:43 AM   [ Ignore ]   [ # 21 ]  
Summer Student
Avatar
Total Posts:  2
Joined  04-05-2006

The French Translation by my good friend NiKo was a bit clumsy, I edited and revised it. You may find them here:

French files for 1.2 : http://jehaisleprintemps.net/codeigniter/ci_french_translations_1.2b.zip
French files for 1.3 : http://jehaisleprintemps.net/codeigniter/ci_french_translations_1.3.zip

Profile
 
 
Posted: 05 April 2006 10:20 AM   [ Ignore ]   [ # 22 ]  
Summer Student
Avatar
Total Posts:  19
Joined  03-25-2006
kNo’ - 05 April 2006 07:43 AM

The French Translation by my good friend NiKo was a bit clumsy, I edited and revised it.

Bruno, take a look at the previous page of this thread… wink

Profile
 
 
Posted: 07 May 2006 06:04 PM   [ Ignore ]   [ # 23 ]  
Summer Student
Avatar
Total Posts:  13
Joined  05-07-2006

Oh! NiKo and kNo’! I know these geeks! smile Good job! Thanks for the french translation.

Profile
 
 
Posted: 09 May 2006 07:46 AM   [ Ignore ]   [ # 24 ]  
Summer Student
Avatar
Total Posts:  3
Joined  05-09-2006

Hi there,

would like to share my german translation. But where can I put it? Uploading is allowed only for images, not for zip files.

Profile
 
 
Posted: 17 May 2006 04:47 AM   [ Ignore ]   [ # 25 ]  
Summer Student
Total Posts:  17
Joined  05-17-2006

Thoughts on translations.
================

When I had to create a new multi-linguage site in Expression Engine I hacked some code I had previously written to replace the translation system in EE, similar to Code Igniter.  There are advantages and disadvantages to doing this which I outline below in case my approach is useful to anyone.

There are two elements to developing multi-lingual sites.  First is the fixed translations, ie. the labels and text that appears in templates that does not change.  Second, there is the dynamic content, in a blog, the blog entries and comments.  In a recent blog site I did that currently an english and german version, the templates for both sites are the same, but the content is different - ie. the user does the translation.  Using the method below I can view the german site in english or the english site in german by using google to (badly) translate the blog entries.


My translation system:

Translations are held in a database table:

+-------------+---------------------------+------+-----+---------+----------------+
|
Field       | Type                      | Null | Key | Default | Extra          |
+-------------+---------------------------+------+-----+---------+----------------+
|
phrase_id   | int(11)                   |      | PRI | NULL    | auto_increment |
|
phrase      | varchar(25)               |      | MUL |         |                |
|
lang_id     | varchar(6)                |      |     | en_gb   |                |
|
say_text    | mediumtext                | YES  |     | NULL    |                |
|
status      | enum('OK','auto','Check') | YES  |     | auto    |                |
|
userlevel   | int(1)                    |      |     | 0       |                |
|
usedin      | mediumtext                |      |     |         |                |
|
screen_name | varchar(50)               | YES  |     | NULL    |                |
|
last_update | datetime                  | YES  |     | NULL    |                |
+-------------+---------------------------+------+-----+---------+----------------+

and output using a class, eg:

$say->it("DataEntryForm");  
or
{lang:DataEntryForm}

The class will first look to see what language to use.  The site will have a default language that can be overriden by the users language preference. 

It then checks to see if the phrase DataEntryForm exists in the database in the required language.  If it doesn’t and the required language is english, then the entry is added with the text “Data Entry Form”  (similarly Data_Entry_Form) can be used for the phrase).  If the language is not english, it gets a translation from google and puts that in.  This is great for development because you can do all your programming work and only then go back and update the translations.

The other advantage is that there is a control panel that can be used by the clients to modify some of the text in the system.  This is not intended as a CMS, but for example, I can put a $say->it(“Headlines”) at the top of the index page which allows the client to go and change their headline news that appears on the page.

This database works across the whole system, so there is no need to create separate files for each module or language.

The disadvantage of course is speed because of the hits to the database.  I could go one of two ways in improving this.  One would be to record the pages where a phrase is used during the development phase so that there is only one call per page to load all the translations.  The other is to create a language file as expected by Expression Engine or Code Igniter.

If these thoughts interest anyone am happy to share code…

Profile
 
 
Posted: 30 May 2006 09:14 PM   [ Ignore ]   [ # 26 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  317
Joined  04-25-2006

Well I made a Spanish translation but have the same problem than Nemesis, I haven’t a server to upload the language folder with all the .php files.
Regards

 Signature 

ReynierPM | Joven Club de Computación y Electrónica Granma

Profile
 
 
Posted: 02 June 2006 04:44 AM   [ Ignore ]   [ # 27 ]  
Summer Student
Total Posts:  20
Joined  03-22-2006

Maybe we could move the links avaliable here to the Wiki.

ReynierPM and Nemesis, if you can’t find other way, send me the ZIPed files that I put it on my host.

mauriciommaia at gmail.com

Regards

Profile
 
 
Posted: 02 June 2006 07:56 AM   [ Ignore ]   [ # 28 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  317
Joined  04-25-2006

Ok, when it’s done I send you, let me finish some test in my school and then I finish the language file
Regards,

 Signature 

ReynierPM | Joven Club de Computación y Electrónica Granma

Profile
 
 
Posted: 19 June 2006 02:20 PM   [ Ignore ]   [ # 29 ]  
Summer Student
Total Posts:  10
Joined  06-13-2006

Is there a way to provide a translation for application? Would it be better to extend CodeIgniter classes or locate array of strings in config.php

Has anyone got any ideas? cool smirk

Profile
 
 
Posted: 01 July 2006 09:59 AM   [ Ignore ]   [ # 30 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  317
Joined  04-25-2006

Well, finally after few days without any PHP Code Lines (because of I very busy days ago with test for Artificial Intelligence and Informatic Security). I send to Mauricio an hope it release ASAP.
Regards,

 Signature 

ReynierPM | Joven Club de Computación y Electrónica Granma

Profile
 
 
   
2 of 7
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64437 Total Logged-in Users: 30
Total Topics: 80911 Total Anonymous Users: 4
Total Replies: 435475 Total Guests: 244
Total Posts: 516386    
Members ( View Memberlist )
Newest Members:  herrmoinsenStuart MacLeansukebegaptekjstewMizoBobbyBDan HessMateus SouzagiusiMoli