You will get results. And in the taxonometry column there will be terms that are not localized.
A piece of code that outputs the lines:
<ul class="result__taxonomy">
<?php foreach ($taxonomies as $type => $taxonomy) : ?>
<?php $branch = Taxonomy::getBranch($type); ?>
<?php if ($branch->state == 1 && in_array($branch->access, $user->getAuthorisedViewLevels())) : ?>
<?php $taxonomy_text = []; ?>
<?php foreach ($taxonomy as $node) : ?>
<?php if ($node->state == 1 && in_array($node->access, $user->getAuthorisedViewLevels())) : ?>
<?php $taxonomy_text[] = $node->title; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if (count($taxonomy_text)) : ?>
<li class="result__taxonomy-item result__taxonomy--<?php echo $type; ?>">
<span><?php echo $type; ?>:</span> <?php echo implode(',', $taxonomy_text); ?>
</li>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
Anticipating the question, are all strings translated ...? Yes, everything is translated. It's not about the constants.
Labels |
Added:
?
|
Found the problem - looking for a solution
Only checked the admin but its almost certainly the same problem. The untranslated words are the taxonomy branches. Taxonomy branches are created in the finder plugins for example
joomla-cms/plugins/finder/contacts/contacts.php
Lines 375 to 379 in 7682b16
As can be seen this will create a taxonomy branch called Country
You can confirm this by first changing Country to Fruit. Clearing the finder index and then reindexing the content.
The dopdown filter will now have a section called Fruit
Changing the code above to
$item->addTaxonomy('PLG_FINDER_QUERY_FILTER_BRANCH_P_COUNTRY', $item->country);
and then updating
to
$name = TEXT::_($branch->text);
Seems to be a good starting point but it becomes a bit of a rabbit hole after that so maybe this isnt the correct approach.
Anyone?
Changing the code above to $item->addTaxonomy('PLG_FINDER_QUERY_FILTER_BRANCH_P_COUNTRY', $item->country);
I do not think that it is a good idea doing it when indexing,
It should be translated while rendering. Somewhere in layout (and field).
$name = $branch->text;
hm, in j3 there it without JText, does it also issue on Joomla 3?
I do not think that it is a good idea doing it when indexing,
Its not translating it during indexing. Its just using a translatable key instead of hard-coded english
hm, in j3 there it without JText, does it also issue on Joomla 3?
Honestly no idea. I never work with joomla in any other language.
Yes, in Joomla 3 the situation is the same. Only in the control panel.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-01-27 00:59:51 |
Closed_By | ⇒ | Quy | |
Labels |
Added:
No Code Attached Yet
Removed: ? |
Closing as having a pull request.
So, how exactly do you translate those now? I have latest translations + I see the merged code is in the search results template, but the labels are still in English. I guess I need some overrides, but not too sure how they should be called.
You have to add translation strings in the format PLG_FINDER_QUERY_FILTER_BRANCH_S_[taxonomy-title]
. No need to create layout overrides or something.
Not layout overrides, language overrides.
Where to get the taxonomy title? I tried e.g. AUTHOR
(PLG_FINDER_QUERY_FILTER_BRANCH_S_AUTHOR
) for Author or TYPE
(PLG_FINDER_QUERY_FILTER_BRANCH_S_TYPE
) for Type but nope. I also looked in other popular language packages and no sign of PLG_FINDER_QUERY_FILTER_BRANCH_S_
in them. This could certainl be better documented IMO.
The same story in the control panel - smart search - content index. Choosing a content map.
By the way, in Joomla 3 too.