I've tried to install cmsmle 1.3 with only two languages several times. Although I followed the instructions in the README.FIRST it didn't work. Ok, here is what i did: I set it up for German and French.
here are the SQL-statements i executed in PhpMyAdmin:
Code: Select all
* ********************************************** *
* TRANSFORM DB FROM MONO TO MULTILANGUAGES CMSMS *
* ********************************************** *
1. Edit config_lang.php.alby (or config_lang.php.alby.label in root directory) for your languages (see examples in file) and rename to config_lang.php
If you try to browse your site you have 404 NOT FOUND: you MUST apply SQL queries
2. APPLY SQL QUERIES. Suppose that you have:
- Table prefix: cms_ , if not change all `cms_xxxxxxx`
- This example is for config_lang.php.alby.my, see 'block' langs: de, fr (de is the DEFAULT_LANG)
I. (change or add for match your require)
content table:
ALTER TABLE `cms_content` ADD `content_name_de` VARCHAR(255) NULL AFTER `content_name`;
ALTER TABLE `cms_content` ADD `content_name_fr` VARCHAR(255) NULL AFTER `content_name_de`;
ALTER TABLE `cms_content` ADD `menu_text_de` VARCHAR(255) NULL AFTER `menu_text`;
ALTER TABLE `cms_content` ADD `menu_text_fr` VARCHAR(255) NULL AFTER `menu_text_de`;
htmlblobs table:
ALTER TABLE `cms_htmlblobs` ADD `html_de` TEXT NULL AFTER `html`;
ALTER TABLE `cms_htmlblobs` ADD `html_fr` TEXT NULL AFTER `html_de`;
II. Change or add (content_block) in: 'content_de,content_fr' string to match your 'block' config_lang.php
UPDATE `cms_content` SET `prop_names`= REPLACE(`prop_names`,'content_en','content_de,content_fr') WHERE `prop_names` LIKE '%content_en%';
III. Fill your DEFAULT_LANG pages with your prev monolingual content (in this example block of DEFAULT_LANG is de, change if not)
content table:
UPDATE `cms_content` SET `content_name_de` = `content_name`, `menu_text_de` = `menu_text`;
content_props:
INSERT INTO `cms_content_props` (`content_id`,`type`,`prop_name`,`param1`,`param2`,`param3`,`content`,`create_date`,`modified_date`)
SELECT `f`.`content_id`, `f`.`type`, 'content_de' , `f`.`param1`, `f`.`param2`, `f`.`param3`, `f`.`content`, `f`.`create_date`, `f`.`modified_date` FROM `cms_content_props` AS `f` WHERE `f`.`prop_name` = 'content_en' AND `f`.`type` = 'string';
htmlblobs:
UPDATE `cms_htmlblobs` SET `html_de` = `html`;
IV. ** OPTIONAL ** (and definitively not necessary if you use $default_lang_fallback in config_lang.php) fill all OTHER languages page with your monolingual (DEFAULT_LANG) content (in this example other langs are en and it)
content table:
UPDATE `cms_content` SET `content_name_fr` = `content_name`, `menu_text_fr` = `menu_text`;
content_props (en is ALWAYS present, so in this example is NOT necessary!):
INSERT INTO `cms_content_props` (`content_id`,`type`,`prop_name`,`param1`,`param2`,`param3`,`content`,`create_date`,`modified_date`)
SELECT `f`.`content_id`, `f`.`type`, 'content_fr' , `f`.`param1`, `f`.`param2`, `f`.`param3`, `f`.`content`, `f`.`create_date`, `f`.`modified_date` FROM `cms_content_props` AS `f` WHERE `f`.`prop_name` = 'content_en' AND `f`.`type` = 'string';
htmlblobs:
UPDATE `cms_htmlblobs` SET `html_fr` = `html`;
Code: Select all
<?php
/* ********************************************************************* *
LANGUAGE ARRAY SINTAX:
'KEY' => array(
'block'=> 'DATABASE KEY', //MANDATORY for modify CMSMS in MLE. If there isn't 'parent' then is the PARENT LANGUAGE also
'flag' => 'HTML IMG TAG FOR LOCALE FLAG', //MANDATORY for compatibility with old MLE - ABSOLUTE URL PATH (in this way is valid for frontend and backend also)
'text' => 'TEXTUAL LANGUAGE', //OPTIONAL use for lang plugin if you don't use flags icon
'parent' => 'PARENT LANGUAGE', //OPTIONAL set for avoid problem with many parent language locale (if you cannot use 'block'), ex: en_US and en_AU
'locale_cms' => 'LOCALE LANGUAGE IN CMSMS', //MANDATORY ONLY if you don't use 'KEY' for locale (ex: 'KEY' is a label), ex: view config_lang.php.alby.label
'locale' => 'SERVER LOCALE', //OPTIONAL set for specific locale server if different from 'KEY' or 'locale_cms' (label case)
),
1. Change DEFAULT_LANG to your default language (one of 'KEY' lang) if check browser lang failed
2. Edit following array with your languages (block, path flag, ...)
3. Rename to config_lang.php AND
4. Read README.FIRST file for add languages in database
5. OPTIONS in Global Setting:
force_mle_default, check for force initial DEFAULT_LANG
default_lang_fallback, check for show content from DEFAULT_LANG if current lang is not ready
opacity_text_replace, replace this text in flag with opacity style if lang is not display
opacity_flags_percent, percent opacity if lang is not display
* ********************************************************************* */
define('DEFAULT_LANG', 'de_DE');
$hls = array(
'de_DE' => array(
'block'=>'de',
'flag'=>'<img src="http://localhost/~dominic/cmsmle13/images/lang/de.png" style="border:0; opacity:1;" alt="Deutsch" />',
'text'=>'Deutsch',
),
'fr_FR' => array(
'block'=>'it',
'flag'=>'<img src="http://localhost/~dominic/cmsmle13/images/lang/fr.png" style="border:0; opacity:1;" alt="Français" />',
'text'=>'Français',
'locale'=>'fr_FR.utf8@euro',
),
);
?>
Thanks for any hints!
Postinog