Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
request #15000: added new example (sql + php settings) for usage with…
… one table per language git-svn-id: http://svn.php.net/repository/pear/packages/Translation2/trunk@268996 c90b9560-bf6c-de11-be94-00142212c4b1
- Loading branch information
Showing
4 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
CREATE TABLE i18n_de ( | ||
string_id varchar(100) NOT NULL DEFAULT '', | ||
page_id varchar(100) DEFAULT NULL, | ||
string text, | ||
UNIQUE KEY id (string_id,page_id) | ||
); | ||
|
||
CREATE TABLE i18n_en ( | ||
string_id varchar(100) NOT NULL DEFAULT '', | ||
page_id varchar(100) DEFAULT NULL, | ||
string text, | ||
UNIQUE KEY id (string_id,page_id) | ||
); | ||
|
||
CREATE TABLE i18n_it ( | ||
string_id varchar(100) NOT NULL DEFAULT '', | ||
page_id varchar(100) DEFAULT NULL, | ||
string text, | ||
UNIQUE KEY id (string_id,page_id) | ||
); | ||
|
||
INSERT INTO i18n_en (string_id, page_id, string) VALUES ('smallTest',NULL,'very small test'); | ||
INSERT INTO i18n_de (string_id, page_id, string) VALUES ('smallTest',NULL,'kinder'); | ||
INSERT INTO i18n_it (string_id, page_id, string) VALUES ('smallTest',NULL,'piccolissimo test'); | ||
|
||
|
||
CREATE TABLE langs_avail ( | ||
id varchar(10) NOT NULL DEFAULT '', | ||
name varchar(200) DEFAULT NULL, | ||
meta text, | ||
error_text varchar(250) DEFAULT NULL, | ||
encoding varchar(16) DEFAULT NULL, | ||
UNIQUE KEY ID (id) | ||
); | ||
INSERT INTO langs_avail (id, name, meta, error_text, encoding) VALUES ('it','italiano','charset: UTF-8','non disponibile in Italiano','UTF-8'); | ||
INSERT INTO langs_avail (id, name, meta, error_text, encoding) VALUES ('en','english','my meta info','not available in English','UTF-8'); | ||
INSERT INTO langs_avail (id, name, meta, error_text, encoding) VALUES ('de','deutsch','charset: UTF-8','kein Text auf Deutsch verfügbar','UTF-8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
define('TABLE_PREFIX', ''); | ||
|
||
$dbinfo = array( | ||
'hostspec' => 'host', | ||
'database' => 'dbname', | ||
'phptype' => 'mysql', | ||
'username' => 'user', | ||
'password' => 'pwd' | ||
); | ||
|
||
$params = array( | ||
'langs_avail_table' => TABLE_PREFIX.'langs_avail', | ||
'lang_id_col' => 'id', | ||
'lang_name_col' => 'name', | ||
'lang_meta_col' => 'meta', | ||
'lang_errmsg_col' => 'error_text', | ||
'lang_encoding_col' => 'encoding', | ||
'strings_tables' => array( | ||
'en' => TABLE_PREFIX.'i18n_en', | ||
'it' => TABLE_PREFIX.'i18n_it', | ||
'de' => TABLE_PREFIX.'i18n_de' | ||
), | ||
'string_id_col' => 'string_id', | ||
'string_page_id_col' => 'page_id', | ||
'string_text_col' => 'string' | ||
//'prefetch' => false //more queries, smaller result sets | ||
//(use when db load is cheaper than network load) | ||
); | ||
|
||
$driver = 'MDB2'; |