By shoulders on Monday, 06 March 2017
Posted in Technical Issues
Likes 0
Views 725
Votes 0
Hi

I went to the trouble of translating my RSFeedback integration tab and now after the update to Komento 3.0.5 it now says 'Component Integration'. See image

This *****.

please can you fix this as it is now worse than before, imagine if I now add in more 3rd party extensions they would all say the same thing. The drop down menus are still translated though.

thanks
Hello Shoulders,

Thanks for your brief explanation. Really appreciate it. We will use the getComponentName for the tab as well to make it more standardized.
·
Tuesday, 14 March 2017 11:17
·
0 Likes
·
0 Votes
·
0 Comments
·
You have to add this following method from your plugin in order to get translated based on what you set :
[gist type="php"]
public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_COM_CONTENT_SETTINGS');
}
[/gist]

Please ensure your Komento running latest version.
·
Monday, 06 March 2017 11:03
·
0 Likes
·
0 Votes
·
0 Comments
·
1) Could you point me to the correct code for this, i cant find it. I think i found the function but there is no information and I think it is not correctly implemented (see point 2). getComponentName

2) You not done this for the dropdown menus, there are 2 translation strings but you have only changed 1.
COM_KOMENTO_COM_RSFEEDBACK
COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS

3) are these the same page (they look like it),

https://stackideas.com/docs/komento/administrators/advance/joomla-plugin
https://stackideas.com/docs/komento/administrators/advance/component-plugin

thanks
·
Monday, 06 March 2017 23:41
·
0 Likes
·
0 Votes
·
0 Comments
·

1) Could you point me to the correct code for this, i cant find it. I think i found the function but there is no information and I think it is not correctly implemented (see point 2). getComponentName

Do you mean you would like to know which function file retrieve the integration tab title from plugin file?
If yes, the file is located at JoomlaFolder/administrator/components/com_komento/views/settings/view.html.php


// LINE 106
$obj->title = $componentObj->getTabTitle();


2) You not done this for the dropdown menus, there are 2 translation strings but you have only changed 1.
COM_KOMENTO_COM_RSFEEDBACK
COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS

If you referring the integration setting tab (screenshot : http://take.ms/kbjBF ), you can actually add this following method into your plugin file for example : JoomlaFolder/components/com_komento/komento_plugins/com_content.php

public function getComponentName()
{
return JText::_( 'COM_KOMENTO_' . strtoupper( $this->component ) );
}

public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_COM_CONTENT_SETTINGS');
}

If I misunderstand regarding section, perhaps you can provide us some of the screenshot which dropdown menus you referring?

3) are these the same page (they look like it),

https://stackideas.com/docs/komento/administrators/advance/joomla-plugin
https://stackideas.com/docs/komento/administrators/advance/component-plugin

Thanks for reported, we actually still working on it.
·
Tuesday, 07 March 2017 13:04
·
0 Likes
·
0 Votes
·
0 Comments
·
looking at the code

1) The code you have shown me will just load the values I have added manually in to joomla's language override so they seem a bit pointless

2) when I started my plugin development the following strings were not translated so i added them manually.
COM_KOMENTO_COM_RSFEEDBACK
COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS

3) now as you can see in the images below the tab now says 'component integration' meaning it now ignores COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS or this has been incorrectly translated

4) in the comments image you can see RSFeedback is still translated.

5) this fault occurred in the last Komento update

6) I have not added any further code since I had it working so the fault/change is caused by the update.

thanks
·
Wednesday, 08 March 2017 03:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for getting back to us,

For those 3rd party plugin have to include those following function to set what name they would like to output on integration tab and the dropdown option from backend.


public function getComponentName()
{
return JText::_( 'COM_KOMENTO_' . strtoupper( $this->component ) );
}

public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_COM_EXTENSION_SETTINGS');
}


Regarding those language translation you can actually put the blank text without using JText method, so you do not need to override those language constant from the Joomla language override section.

For example :

public function getComponentName()
{
return 'RSFeedback';
}

public function getTabTitle()
{
return 'RSFeedback';
}


If the system detected that 3rd party plugin didn't pass me the integration tab name, it will show 'Component Integration' on the integration tab by default.

By the way, we add this in the plugin instead is because we can’t predict what other component will have integration with Komento in the future. Hence, the developer should aware of this function and they have to define their own name for the integrated component.
·
Wednesday, 08 March 2017 16:36
·
0 Likes
·
0 Votes
·
0 Comments
·
hi

1) you do not need 2 functions to translate both strings, you can use 1 function to set both translation stings.

2) are these functions already present in the plugin / KT:: model ?

3) are you going to add the dropdown menu item to this new systems, you did not mention in your answer?

4) these functions (or single function) should be made mandatory

·
Wednesday, 08 March 2017 16:59
·
0 Likes
·
0 Votes
·
0 Comments
·
1) you do not need 2 functions to translate both strings, you can use 1 function to set both translation stings.

It is safer this way because both function has their own different usage.

2) are these functions already present in the plugin / KT:: model ?

This function not available in KT::model. It is only in the plugin since it is only useful in plugin context.

3) are you going to add the dropdown menu item to this new systems, you did not mention in your answer?

Actually i did mentioned in my previous reply, it might be I didn't explained clearly about this.

// This function is allow 3rd party developer to set what component name they want to show
// Example : that dropdown menu
public function getComponentName()
{
return JText::_( 'COM_KOMENTO_' . strtoupper( $this->component ) );
}

// This function is allow 3rd party developer to set what component name they want to show in integration tab title
public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_COM_EXTENSION_SETTINGS');
}



4) these functions (or single function) should be made mandatory

Yes, it should made mandatory, we will update the documentation accordingly.
·
Wednesday, 08 March 2017 19:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi as a follow up

1) when developing an API for end users to use, you should consider the 3rd party developers, i.e. keep it simple. A question you will get is why do you return the component name twice. Having 2 functions is absolutely daft. The sole purpose of this function is to translate the tab and the dropdown menus. This is all it should do. I think you should just have a word with another colleague about this. I would not know how to even explain this in my documentation.

You only need 1 declaration ie.
A single function or even a variable in the plugin file

// This function sets the component name in Komento Admin (Integration Tab, Dropdown menus etc.... ) - in the plugin file
public function getComponentName()
{
return 'RSFeedback';
}


this would then be called by another function to build the language constants and this is not within the plugin file

public function translatePlugin()
{
'COM_KOMENTO_COM_' . strtoupper( $this->component ) = getComponentName();
'COM_KOMENTO_SETTINGS_TAB_COM_' . strtoupper( $this->component ) . '_SETTINGS' = getComponentName();
}

This code is just to show you what I mean as a proof in concept.


2) thanks

3) The code you supplied will not work without manually adding the language overrides into Joomla. So this does not achieve anything. It is just reading values that are already there.

Secondly this does not address my followup point from my last response. Your developers have changed the code for the Tab, but not the dropdown menus. I refer you to the images I attached.

4) thanks

I hope this clears my thoughts up a little, i just want to get the API/plugin right while you are looking at it.
·
Wednesday, 08 March 2017 22:39
·
0 Likes
·
0 Votes
·
0 Comments
·
1) Thanks for your input.

3) I am a little bit lost here. May I know which dropdown you are referring to? If you were referring to this dropdown: (screenshot : http://take.ms/xgy0W ) , yes, this is using that getComponentName.
May I know what issue you are facing with this?

Perhaps you can share to us what code you put inside this getComponentName function from your plugin file so it will help us more easy to understand with your existing code.

By the way, I do think that multiple functions with the same output would be a bit redundant. we will see if one of those function can be removed in the next release.
·
Thursday, 09 March 2017 16:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Komento version v3.0.5

the reason I know that the dropdown menu is still using the manual translation i added in the Joomla admin is because when I remove the translation string, COM_KOMENTO_COM_RSFEEDBACK , the following occurs

see image

changing COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS makes no difference to anything


NB: Also I have not implemented getComponentName or getTabTitle in my plugin
·
Thursday, 09 March 2017 17:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Shoulders,

Allow me to explain how that function works. The dropdown's component name is retrieved using getComponentName. You can see the code here: ../administrator/components/com_komento/views/comments/view.html.php : http://take.ms/W3Lyt . But in your case, which you don't have getComponentName in your plugin file, it will fall back to the abstract plugin file: ../components/com_komento/komento_plugins/abstract.php : http://take.ms/ZmSbo . As you can see in my screenshot, it will return this:

return JText::_( 'COM_KOMENTO_' . strtoupper( $this->component ) );
// in your case COM_KOMENTO_COM_RSFEEDBACK

This COM_KOMENTO_COM_RSFEEDBACK must be defined by the 3rd-party developer themself since we can't predict future integration. If you go to our language file, you will see this: http://take.ms/wqnDd . These are the component's name that the plugin file was built by us.

changing COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS makes no difference to anything

Yes, it will have no difference because this is for the settings tab (getTabTitle). This function also in the abstract file.

Hope these help.
·
Friday, 10 March 2017 12:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik

I am trying to point out a bug/inconsistency since the last update.

scenario

Currently I have not implemented getComponentName or getTabTitle in my plugin (and this is why i noticed it.)

These/My template override settings are set manually to = 'RSFeedback' and this was required prior to 3.0.5
COM_KOMENTO_COM_RSFEEDBACK
COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS

current state

The RSFeedback integration tab now shows the title Component Integration

The fall back for the integration tab when the function is not present seems to be the translation Component Integration
(possibly COM_KOMENTO_SETTINGS_TAB_COM_COMPONENT_SETTINGS="Component Integration")
and does not fallback to COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS

The dropdown menus still shows RSFeedback which means the fallback is to use the language string COM_KOMENTO_COM_RSFEEDBACK

Conclusion

The fallbacks are inconsistent. If the tab pre-translation is the preferred method for fallback, the dropdown menu effectively has no default fallback position except to manually add the translation strings which make this automation a bit pointless.

Also within the komento_plugin.php you should only need to state the name once, using 2 functions to do the same thing is confusing. I mentioned this to Arlex above. Both dropdowns and the tab will always have the same translation i.e. RSFeedback

thanks
·
Friday, 10 March 2017 17:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

Perhaps you can try modify on this file -> JoomlaFolder/components/com_komento/komento_plugins/abstract.php


public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_COM_COMPONENT_SETTINGS');
}

// Replace with
public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_' . strtoupper($this->component) . '_SETTINGS');
}

so you do not need to add getTabTitle function in your plugin file.

Also within the komento_plugin.php you should only need to state the name once, using 2 functions to do the same thing is confusing.

And I will discuss with Nick regarding this and see if we can use 1 function to handle this.
·
Sunday, 12 March 2017 11:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

The issue i have reported is a bug and needs fixing in your code.

Thanks
·
Sunday, 12 March 2017 18:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for your input, we will try to combine 2 function in 1 for populate those integration tab and the dropdown extension translation in next version.
·
Monday, 13 March 2017 14:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Arlex,

you keep reading my responses wrong and I have to keep repeating myself . The answer you gave above is about 2 functions and making it into one (good news), but I have told you there is a bug in the fallback mechanisms

see response #12.

tar
·
Monday, 13 March 2017 17:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Try download my attached file and replace into this file and see how it goes?

JoomlaFolder/administrator/components/com_komento/views/settings/view.html.php

if the issue still persists, perhaps you can provide us with your Joomla backend and FTP access so we can directly check this issue on your site.
·
Monday, 13 March 2017 18:23
·
0 Likes
·
0 Votes
·
0 Comments
·
why have you send me this file? You need to step back and re-read the thread, you are making this more difficult than it needs to be.

You are confusing me completely.

Just show Nik the response #12 of this thread so he can register the Fallback bug in your tracker, he will understand.
·
Monday, 13 March 2017 18:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Shoulders,

I'm sorry for the confusion. Correct me if I'm wrong, your issue is the fallback for the tab title is not same as the dropdown? Now your tab title displaying the Component Integration instead?

However, did the file fixed your issue? Actually the file is for the Tab Title, where it will call the function getComponentName() (Same as the dropdown) means Tab title will also use this language string: COM_KOMENTO_COM_RSFEEDBACK

Arlex has logged this in our issue tracker and we have decided to use getComponentName for all that needs the component integration's name.
·
Monday, 13 March 2017 18:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik

response #12 goes into more detail

This bug report is done with the fact that I have not implemented the 2 new functions for translation getTabTitle() and getComponentName() so i can show you the fallback bug.

but in short

the fall back mechanism for the dropdown menu does not work (or there is was no change to the code on purpose in the new release) and the translation shown is still the one I added manually. i.e if i remove the manual translation it goes back to an untranslated string constant. (COM_KOMENTO_COM_RSFEEDBACK)

The fallback mechanism for the tab displays 'Component integration' this possibly is a typo in the translation string unless this was on purpose. I would of expected the fallback to be the manual strings I added to be (COM_KOMENTO_SETTINGS_TAB_COM_CONTENT_SETTINGS) as they were before v3.0.5

possible typo:
COM_KOMENTO_SETTINGS_TAB_COM_CONTENT_SETTINGS
COM_KOMENTO_SETTINGS_TAB_COM_COMPONENT_SETTINGS

Conclusion

so as you can see the fallback mechanism for both functions are different, so which one is broken? or are they both broken.

thanks
·
Monday, 13 March 2017 19:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Shoulders,

the fall back mechanism for the dropdown menu does not work

- It does work. That's why you are seeing untranslated string COM_KOMENTO_COM_RSFEEDBACK. You have to manually add the translation for that. Since RSFeedback is not in our supported components (../components/com_komento/komento_plugins/), you have to add it yourself unless we add it in our language file which we could do so in the next release . Every of all our supported components integration has its own translation which you can find it here: http://take.ms/KnOWS
·
Monday, 13 March 2017 19:15
·
0 Likes
·
0 Votes
·
0 Comments
·
hi nik,

this make things much easier and actually takes me back to my first post in this thread (i am not joking)

so to confirm this is how things should be in v3.0.5

1) the dropdown menu works as planned. If you use the function getComponentName() in the plugin it will use the text defined in there, else it will default to a translation (component dependent) COM_KOMENTO_COM_RSFEEDBACK which is manually set

2) the tab menu should work the same - If you use the function getTabTitle() in the plugin it will use the text defined in there, else it will default to a translation (component dependent) COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS which is manually set

-------------

Tab Translation issue

In my example, the tab menu fallback mechanism is loading COM_KOMENTO_SETTINGS_TAB_COM_COMPONENT_SETTINGS not COM_KOMENTO_SETTINGS_TAB_COM_RSFEEDBACK_SETTINGS causing an incorrect translation to be displayed.

This is most likely a small typo where the word component is used to build the constant string rather than the name of the component such as rsfeedback

I have not tried the code Arlex has made, perhaps this fixed it. I have not tried it because first I needed the bug to be recognized so i know what is going on and I have got a little frustrated (sorry).

I can find the code responsible if really needed.

shoulders

here is the code that is at fault (abstract.php)

public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_COM_COMPONENT_SETTINGS');
}



it should be (abstract.php)

public function getTabTitle()
{
return JText::_('COM_KOMENTO_SETTINGS_TAB_COM_' . strtoupper( $this->component ) . '_SETTINGS');
}

·
Monday, 13 March 2017 19:41
·
0 Likes
·
0 Votes
·
0 Comments
·
can you just clarify the fallback bug and my solution are valid?
·
Tuesday, 14 March 2017 16:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, thanks for your reported.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Tuesday, 14 March 2017 17:25
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post