Multilanguage title for modules and other stuff

248 views
Skip to first unread message

Nils Rückmann

unread,
Feb 22, 2013, 6:07:18 PM2/22/13
to joomla-...@googlegroups.com
Hi, i recently build a multilanguage site and i just freaked out because of many many duplicated modules for the different languages.
Would it not be much simplier, if we have the ability to translate the modules title for example ?
I know, we are very flexibel with our current solution for multilanguage, but maybe there are things which can be done easier.
Another idea was to translate the category, because there are situation when you want to have one category for multiple languages.

JM Simonet

unread,
Feb 23, 2013, 5:14:37 AM2/23/13
to joomla-...@googlegroups.com
For modules, this would imply quite a few changes.

1. You would have to change in the site templates /html/modules.php
<?php echo $module->title; ?>
to
<?php echo JText::_($module->title); ?>

2. This would evidently mean that, for each module, you enter the title as a UNIQUE constant when editing the module:
exemple:
MY_MOD_MENU_MAIN

then you would have to create a string with this constant and a value in an override.ini (Language Manager=>Overrides=>New) for EACH language used
MY_MOD_MENU_MAIN="Main Menu"  // for en-GB
MY_MOD_MENU_MAIN="Menu principal"  // for fr-FR

3. Obviously the module has to be set to language "All"

We could help this process to do it in a cleaner way, if desired, by creating a new parameter in module.xml to decide if the title should be translated or not, avoiding step1 and introducing there a conditional.

Not sure we should do that for 2 reasons:
1. Creating all these custom ini strings would not be IMHO a simplification of the present process.
2. In many cases, the parameters for the same module may depend on the language they are assigned to.
3. It's easy to duplicate a series of module AND changing at the same time their assigned language by using the batch function, then change titles and other parameters and filter by language in the manager.

JM
--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-cm...@googlegroups.com.
To post to this group, send an email to joomla-...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


-- 
Please keep the Subject wording in your answers
This e-mail and any attachments may be confidential. You must not disclose or use the information contained in this e-mail if you are not the
intended recipient. If you have received this e-mail in error, please notify us immediately and delete the e-mail and all copies.
-----------------------------------------------------------
Jean-Marie Simonet  /  infograf768
Joomla Production Working group
Joomla! Translation Coordination Team 

Ove

unread,
Feb 23, 2013, 7:55:47 AM2/23/13
to joomla-...@googlegroups.com, JM Simonet
I completely understand the issue. The workload doesn't come with creating a lot of extra modules but from the mainatenance. I have a very parameterised module written instead of spitting them up in say 15 single modules where 95% of the code is the same. Allready with 3 languages and 4 module copies I would have to maintain 12 modules. Even without multilanguage is sometimes the module title in frontend not what the admin want to see in backend module lists.

My flexibility workaround especially for the title :

added two options, title alternatives and a title textfield that are handled in the output.
- Use Joomla default
- Use text from field below
- Use text from language file - predefined title
- Use text from field below - translated in the language overrides

Hope it gives you some idea.

Ove

Nils Rückmann

unread,
Feb 23, 2013, 9:13:05 AM2/23/13
to joomla-...@googlegroups.com
Hi Jean-Marie,

that's exactly the implementation i suggest. Just a parameter to enable the translation of the title, all the other stuff is handled by the module itself. My question is if there is a need for such feature.

Matt Thomas

unread,
Feb 23, 2013, 9:19:32 AM2/23/13
to joomla-...@googlegroups.com

Would there be any way to change the value of
$module->title, from within the module, based on the language?

Best,

Matt Thomas
Founder betweenbrain™
Lead Developer Construct Template Development Framework
Phone: 203.632.9322
Twitter: @betweenbrain
Github: https://github.com/betweenbrain

Composed and delivered courtesy of Nexus 7.

On Feb 23, 2013 9:13 AM, "Nils Rückmann" <syb...@googlemail.com> wrote:
Hi Jean-Marie,

that's exactly the implementation i suggest. Just a parameter to enable the translation of the title, all the other stuff is handled by the module itself. My question is if there is a need for such feature.

Roberto Segura

unread,
Feb 23, 2013, 9:22:58 AM2/23/13
to joomla-...@googlegroups.com

Even being able to translate the module title most users will probably require translate the content too. This can be done with a custom module chrome. You can reuse any unused module param to set if you want to show the module title or the language override. You can also use the standard title for the default language and use the language strings for the rest.

You already can use categories for all languages. You can also build your own pseudo-language system into overrides like in module chromes.

The current multilanguage system can be tedious but is powerful.

El 23/02/2013 15:13, "Nils Rückmann" <syb...@googlemail.com> escribió:
Hi Jean-Marie,

that's exactly the implementation i suggest. Just a parameter to enable the translation of the title, all the other stuff is handled by the module itself. My question is if there is a need for such feature.

Nils Rückmann

unread,
Feb 23, 2013, 12:30:57 PM2/23/13
to joomla-...@googlegroups.com
It's not about overrides or workaround for doing multilanguage. Of course, you will often have different params for each language, but in many cases you use the same params and have to duplicate the modules just for the title.
Well, on a specific projects you can just use module chromes, but i ask for a core implementation which isn't related to the template.

Same thing on categories. If you want to store different languages in a category you have to write an override to display the category , because the correct title for example is not the same in each language.

But the categories are not my first priority (but it would be still cool, if we could translate the title and the description by language tags),
my attempt is about the module title, because that's the only thing you can't provide by the module itself.

Bakual

unread,
Feb 23, 2013, 1:00:34 PM2/23/13
to joomla-...@googlegroups.com
To me it sounds a bit wrong from a design view. I mean currently the language strings are used to translate hardcoded stuff which comes from the extension program. What you suggest is adding a completely new layer of translation for stuff which is entered by the user itself, be it the module title or a category name.
There are two things to consider here in my opinion:
  • It is already possible to do what you like by creating multiple instances of the same module with different titles. It's some work to do, but I'm not even sure if it's more work than manually adding language strings. And it clutters the module manager since you have to multiply each module by the count of languages installed. Maybe it would be possible to improve the module manager so the same modules are grouped together, showing as one module that can be unfolded.
  • There are various extensions available which offer this functionality as well. At least I think extensions like JoomFish allow to translate module titles. Correct me if I'm wrong here.

Nils Rückmann

unread,
Feb 23, 2013, 1:47:27 PM2/23/13
to joomla-...@googlegroups.com
Yes, JoomFish (or Falang now) has the ability to translate module title, like everything else ;)

If i summarize all responses, it looks like that kind of feature is not on our wishlist. That's fine and the reason i ask before i get to start coding. Not every idea has to be the right one ;)

So for me: Topic closed.

Victor Drover

unread,
Feb 25, 2013, 8:38:35 PM2/25/13
to joomla-...@googlegroups.com
Josetta might solve it for you if you want to keep the translations native: http://d.pr/i/9mOx

-V

Reply all
Reply to author
Forward
0 new messages