27-Sep-2013, 07:21 PM
Hi there,
Commentics supports multiple languages itself, but once you have set a frontend language it cannot be changed anymore on the site.
Many sites support multiple languages too, e.g. by clicking a flag icon in the website's menu, the sites changes its language accordingly. This is usually done by submitting a POST parameter in the URL.
Commentics cannot react to that right now. It would be great if it could.
Here is an idea how it could be done.
When commentic.php is called from a web page, the a frontend language could be passed to it. Here is an example how that could look like:
Commentics supports multiple languages itself, but once you have set a frontend language it cannot be changed anymore on the site.
Many sites support multiple languages too, e.g. by clicking a flag icon in the website's menu, the sites changes its language accordingly. This is usually done by submitting a POST parameter in the URL.
Commentics cannot react to that right now. It would be great if it could.
Here is an idea how it could be done.
When commentic.php is called from a web page, the a frontend language could be passed to it. Here is an example how that could look like:
PHP Code:
<?php
$cmtx_identifier = '1';
$cmtx_reference = 'My Topic';
$cmtx_path = 'comments/';
$cmtx_frontend_language = $website_frontend_language;
define('IN_COMMENTICS', 'true'); //no need to edit this line
require_once $cmtx_path . 'includes/commentics.php'; //no need to edit this line
"$website_frontend_language" would be a variable that was set via PHP from a POST paramater.
In commentics.php you could react to that like this:
PHP Code:
<?php
/*************************************************************** LANGUAGE ***************************************************************/
if (!isset($cmtx_frontend_language)) $cmtx_frontend_language = cmtx_setting('language_frontend');
require_once $cmtx_path . 'includes/language/' . $cmtx_frontend_language . '/page.php'; //load language file for page
require_once $cmtx_path . 'includes/language/' . $cmtx_frontend_language . '/comments.php'; //load language file for comments
require_once $cmtx_path . 'includes/language/' . $cmtx_frontend_language . '/processor.php'; //load language file for processor
require_once $cmtx_path . 'includes/language/' . $cmtx_frontend_language . '/form.php'; //load language file for form
require_once $cmtx_path . 'includes/language/' . $cmtx_frontend_language . '/countries.php'; //load language file for countries
require_once $cmtx_path . 'includes/language/' . $cmtx_frontend_language . '/ratings.php'; //load language file for ratings
/****************************************************************************************************************************************/