News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Title of the module for a multilingual site

Started by Елeна, March 10, 2016, 16:08:02 PM

Previous topic - Next topic

Елeна

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.

jjk

Create a module for each language in Joomla administration and assign a language tag to each one.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Елeна

Hello.
Three state language + English, seven modules.
For each language to duplicate the module.

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

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 ;)

Jörgen

Hello Patrick

Of course, should have hought of that :)

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Елeна

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

Studio 42

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

Елeна

#8
/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

Studio 42

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

Елeна

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

Studio 42

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 ;)