2012-04-19 107 views
2

我在cakephp 2.0中有多種語言的應用程序。它是用英語和其他語言編寫的。所有的內容,如菜單和相應的數據都是從數據庫中生成的。我完成了英語,但不知道如何在另一種語言中使用相同的內容。我應該創建兩個單獨的數據庫還是在cakephp 2.0中有其他解決此功能的方法。Cakephp 2.0中的多語言

回答

0

我剛開始一個多語言的網站 - 博客,我去,有關語言設置的條目是here我可以證實,作爲食譜已經提到是有很大幫助,因爲這是文章Localizing Japan.

0

把這個代碼APP-> config->的config.php

陣列( '主機', 'GER', 'THA'), '缺省'=> '主機'); 放appcontrol把這段代碼 如果($本 - > _ checkLanguage()){$ 這 - >重定向($這個 - >引用者());如果($ this-> Session-> check('Config.language')){ }配置:: write('Config.language',$ this-> Session-> read('Config.language')) ; // $ this-> redirect($ this-> referer()); } 如何訪問CTP頁

你做出三種語言 你去項目 - > APP->局地>默認情況下,有一個文件夾工程。但使三種語言像ger,泰國,所以你讓這個文件夾eng,ger,泰國, 裏面的文件夾,你把這個代碼就像 local 圖像no1爲eng。 enter image description here img no2.for ger。 enter image description here img no 3for泰國。 enter image description here