Skip to content

[#32829] The statistics popup form com_finder is not full translatable#2613

Closed
zero-24 wants to merge 17 commits intojoomla:masterfrom
zero-24:patch-2
Closed

[#32829] The statistics popup form com_finder is not full translatable#2613
zero-24 wants to merge 17 commits intojoomla:masterfrom
zero-24:patch-2

Conversation

@zero-24
Copy link
Copy Markdown
Contributor

@zero-24 zero-24 commented Nov 28, 2013

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Nov 28, 2013

done

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Nov 28, 2013

done @infograf768

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Nov 28, 2013

so this shoud work now :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could even do this in a backward compatible way:

<?php 
$lang_key       = 'PLG_FINDER_STATISTICS_'. str_replace(' ', '_', $type->type_title);
$lang_string    = JText::_($lang_key);
echo ($lang_string == $lang_key) ? $type->type_title : $lang_string; 
?>

This way if third party extensions don't have the language string (yet), it will not show as an untranslated string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commited 👍

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Nov 28, 2013

It works for 3rd party extensions as long as they have the language string in their files. I've commented in code to show a solution in case the string isn't present. Maybe someone knows an even better one.

Also to consider: I would use a language key which is consistent with the other keys in the file. So something like strtoupper('PLG_FINDER_' . $type->element . '_TYPE_' . str_replace(' ', '_', $type->type_title)') which would hopefully result in PLG_FINDER_CONTENT_TYPE_ARTICLE

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Nov 28, 2013

@Bakual

strtoupper('PLG_FINDER_' . $type->element . 'TYPE' . str_replace(' ', '_', $type->type_title)')

or
strtoupper('PLG_FINDER_' . $type->element . 'TYPE' . str_replace(' ', '_', $type->type_title))

or

strtoupper('PLG_FINDER_' . $type->element . 'TYPE' . str_replace(' ', '_', $type->type_title)'')

what is better? The first looks not right (not closed) or i'm wrong?

EDIT:
@Bakual

I've commented in code to show a solution in case the string isn't present.

merged

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Nov 28, 2013

Aye, my line was wrong. The ' at the end slipped in due to copy-pasting.
strtoupper('PLG_FINDER_' . $type->element . '_TYPE_' . str_replace(' ', '_', $type->type_title))
should be better (didn't test it).

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Nov 28, 2013

@Bakual
We must add a ";" after it. Than it show this error
Notice: Undefined property: stdClass::$element in I:\Server_new\htdocs\git\administrator\components\com_finder\views\statistics\tmpl\default.php on line 35

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Nov 28, 2013

@zero-24 I had a closer look at the data. Unfortunately my idea doesn't work out as the element isn't even stored anywhere. We would have to use the plugin name for that, but that is just crappy code then.
So better leave it with the current language key. It will work 😃

@zero-24
Copy link
Copy Markdown
Contributor Author

zero-24 commented Nov 29, 2013

ok thanks @Bakual
so we need min. two good tests for this patch.

@MATsxm
Copy link
Copy Markdown

MATsxm commented Feb 5, 2014

@test
Able to reproduce then #2613 works as expected and following Thomas also with 3rd party extensions.
Set RTC on the Tracker
Thanks

infograf768 added a commit that referenced this pull request Feb 17, 2014
Bakual pushed a commit to Bakual/joomla-cms that referenced this pull request May 12, 2014
Bakual pushed a commit to Bakual/joomla-cms that referenced this pull request May 12, 2014
@zero-24 zero-24 deleted the patch-2 branch May 17, 2014 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants