VirtueMart Forum

VirtueMart 2 + 3 + 4 => Language/Translations => Topic started by: Елeна on March 10, 2016, 16:08:02 PM

Title: Title of the module for a multilingual site
Post by: Елeна on March 10, 2016, 16:08:02 PM
Hello.
VirtueMart 3.0.12 и Joomla 3.4.8
How to translate for a multilingual web-site title  module    VirtueMart Manufacturers, VirtueMart Category, VirtueMart Currency Selector.
I hope for Your advice.
Thank you.
Title: Re: Title of the module for a multilingual site
Post by: jjk on March 10, 2016, 23:40:13 PM
Create a module for each language in Joomla administration and assign a language tag to each one.
Title: Re: Title of the module for a multilingual site
Post by: Елeна on March 11, 2016, 07:01:01 AM
Hello.
Three state language + English, seven modules.
For each language to duplicate the module.
Title: Re: Title of the module for a multilingual site
Post by: Jörgen on March 11, 2016, 07:14:43 AM
Yes

Regards

Jörgen @ Kreativ Fotografi
Title: Re: Title of the module for a multilingual site
Post by: Studio 42 on March 11, 2016, 15:23:17 PM
You don't need to do this, if you add jText for module title !
Here a sample:

function modChrome_STYLE($module, &$params, &$attribs)
{
if (!empty ($module->content)) : ?>
<?php if ($module->showtitle) : ?>
<h3><?php echo jText::_($module->title); ?></h3>
<?php endif; ?>
<?php echo $module->content?>
<?php endif;
}


And you use a Joomal language KEY.
eg. for category module title : COM_VIRTUEMART_CATEGORY

I'm wondering why this is not in most templates as default, i have change this already for 4 or 5 sites, So you don't have to manage 3 time same VM modules only because the Module title ;)
Title: Re: Title of the module for a multilingual site
Post by: Jörgen on March 11, 2016, 16:25:37 PM
Hello Patrick

Of course, should have hought of that :)

regards

Jörgen @ Kreativ Fotografi
Title: Re: Title of the module for a multilingual site
Post by: Елeна on March 11, 2016, 17:40:46 PM
Thank you. A hope appeared.
In what file to insert a code. :-[
/modules/mod_virtuemart_category/mod_virtuemart_category.php - error - 500
/modules/mod_virtuemart_category/tmpl/default.php - error - 500
Title: Re: Title of the module for a multilingual site
Post by: Studio 42 on March 11, 2016, 18:54:17 PM
modChrome is in your template:
YOUR_SITE/templates/YOUR_TEMPLATE/html/modules.php
If this not exist, check in YOUR_SITE/templates/system/html/modules.php and copy this in your template
Title: Re: Title of the module for a multilingual site
Post by: Елeна on March 11, 2016, 21:22:43 PM
/templates/protostar/html/modules.php - insert code unfortunately there is no result
Not knowing where to insert the KEY - COM_VIRTUEMART_CATEGORY inserted in
/language/
/administrator/language/
/modules/mod_virtuemart_category/language/
/templates/protostar/language/
Displays the key COM_VIRTUEMART_CATEGORY in the module header
Sorry
Title: Re: Title of the module for a multilingual site
Post by: Studio 42 on March 11, 2016, 22:14:34 PM
modChrome_STYLE
STYLE is to replace by your internal template style used to render the module in index.php
eg. modChrome_html5
in protostart you have some using none, this don't use modChrome_none but rendder directly.

So if you need to chenge this then you have to replace it :
<jdoc:include type="modules" name="position-0" style="none" />
to
<jdoc:include type="modules" name="position-0" style="mystyle" />
and use

// mystyle style
function modChrome_mystyle ($module, &$params, &$attribs)
{
if (!empty ($module->content)) : ?>
<?php if ($module->showtitle) : ?>
<h3><?php echo jText::_($module->title); ?></h3>
<?php endif; ?>
<?php echo $module->content?>
<?php endif;
}


for existing well style
function modChrome_well($module, &$params, &$attribs)
{
$moduleTag     = $params->get('module_tag', 'div');
$bootstrapSize = (int) $params->get('bootstrap_size', 0);
$moduleClass   = $bootstrapSize != 0 ? ' span' . $bootstrapSize : '';
$headerTag     = htmlspecialchars($params->get('header_tag', 'h3'));
$headerClass   = htmlspecialchars($params->get('header_class', 'page-header'));

if ($module->content)
{
echo '<' . $moduleTag . ' class="well ' . htmlspecialchars($params->get('moduleclass_sfx')) . $moduleClass . '">';

if ($module->showtitle)
{
echo '<' . $headerTag . ' class="' . $headerClass . '">' . jText::_($module->title) . '</' . $headerTag . '>';
}

echo $module->content;
echo '</' . $moduleTag . '>';
}
}

and each style used in your template
Title: Re: Title of the module for a multilingual site
Post by: Елeна on March 11, 2016, 23:41:16 PM
1)/templates/protostar/index.php --<jdoc:include type="modules" name="position-0" style="none" /> mystyle
2)/templates/protostar/html/modules.php -- insert "// mystyle style ...."   and replace the general  "function modChrome_well($module, &$params, &$attribs)...."
where is the error
Title: Re: Title of the module for a multilingual site
Post by: Studio 42 on March 11, 2016, 23:56:34 PM
I think that you don't understand.
This are all sample. So you have to check the style="XXX" XXX is the style to add in modchrome
modChrome is in your template:
YOUR_SITE/templates/YOUR_TEMPLATE/html/modules.php
This XXX style  have to be the same as in your template index.php file.
If you don't understand, then add menu for each language, i think it's better ;)
Title: Re: Title of the module for a multilingual site
Post by: Елeна on March 12, 2016, 14:34:54 PM
Thank you