Page 1 of 1

Using Language overrides for menu title/desc.

Posted: 19 May 2016, 20:56
by vAlini
Hello,

thank you for your feature rich extensions and the effort you put into it.

I want my images to have a title in the corresponding language based on the site I'm on (it-en-de).

Image

In which file (and line) can I alter (with an template-override) the title and wrap it with JText::_() in order to get it replaced with an text defined under Joomla Language overrides? Is this also possible with the image description?

Does it make sense to you to implement this in further release?

Thank you!

Reviews and donation are following.

Regards

Re: Using Language overrides for menu title/desc.

Posted: 21 May 2016, 14:58
by Jan
Hi, sorry, I don't understand, Phoca Gallery is standard Joomla! component with all its langauge features, all strings are set in JText::_()

Jan

Re: Using Language overrides for menu title/desc.

Posted: 21 May 2016, 21:48
by vAlini
Hi,

I wanted to ask if it is possible (when I'm for instance in Category: [ New ] -> General settings) to set for Title*=MY_OWN_TITLE,
and than go to Extensions->Language(s)->Overrides. New -> Setting a Constant MY_OWN_TITLE and define a Text(to replace the string)=Catergory Flowers

If so I won't have to create a new catergory for each language. At the moment I'm not able to do this.

I have done it in the same manner e.g. with Module titles by replacing the the part in :

Code: Select all


    <?php if ($module->showtitle) { ?> <h<?php echo $headerLevel; ?>><span
    class="backh"><span class="backh2"><span class="backh3">[b]<?php echo $module->title; ?>[/b]</span></span></span></h<?php echo $headerLevel; ?>>
    <?php };

[b]<?php echo JText::_(strtoupper($module->title));[/b]


Hope it is clearer now and that it makes sense what I'm trying to achieve.
Otherwise I'll create a single Catergory for each language in the corresponding language.

Regards

Re: Using Language overrides for menu title/desc.

Posted: 22 May 2016, 13:18
by Jan
Hi, the multi-language feature in Joomla! does not work this way.

If you have e.g. two languages, you will create two categories, one for first language, second for second language, the same for images.

To add language string as title, yes, there is no such feature that it will be translated - so this needs to be customized directly in the code.

So in fact the same like you did for the module:

Change e.g. in: components\com_phocagallery\views\categories\tmpl\default_categories.php

FROM:

Code: Select all

$cv->title_self
TO:

Code: Select all

JText::_(strtoupper($cv->title_self))
and of course this string must be added to language string file (ini) of the gallery or common Joomla! language file. :idea:

Jan