module settings not used in component/myshortlist/ ?

4 years 1 month ago - 4 years 1 month ago #1 by Filip
I'm testing this module in Dutch language

I did the translations in the module and they show up. Sending list works but:

If you're going to url component/myshortlist/
"Send list" isn't translated
"Send to friend is disabled but shows if clicked on "Send list"
"The "from" is still email@email.com

Seems that on component/myshortlist/ the values of the module settings are not used/imported

Also default_pdf_wrapper_nl-NL.php seems not to work

Please Log in or Create an account to join the conversation.

4 years 1 month ago #2 by Christopher Mavros
Replied by Christopher Mavros on topic module settings not used in component/myshortlist/ ?
Hello Filip and thank you for posting!

First of all, when translating a Joomla site, it is very important to make sure that your site is using the correct language. Sometimes, for example, you may have a site, that despite your content is in Dutch, the site's default language is still English.

Here's another thing:
The component would need somewhere to retrieve settings from. The best way to configure that, would be to create a hidden menu item. (For more information see "How to create a hidden menu item") The module should then automatically redirect to the correct menu item. That is beneficiary, because that way you can also configure your modules, etc.

Finally, changing the filename to something that includes the language code doesn't work. That's not how overrides work. If you need different languages within the same file, you would probably have to do that with a language string. Something like <?php print JText::_('YOUR_CUSTOM_LANGUAGE_STRING'); ?> and then add that language string to your site's language overrides, so that you can have it in all languages.

Thanks again!

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

4 years 1 month ago #3 by Filip
Thanks for your answers.

The site default language is nl-NL (Dutch)

Hidden menu: I did this and it works after putting also the values/text trough the menu item.


The reason why I tested default_pdf_wrapper_nl-NL.php is that this is on your (pdf) file:

"If you need to create a different wrapper per language, you can add the language code at the end of the file in your template, like:
templates/your_template/html/mod_myshortlist/default_pdf_wrapper_en-GB.php. The language code is automatically retrieved by the module."


********************

I tested the file default_emailbody.php


Changed;
<?php // Email Pre Text

//print $helper->i18n('YOU_HAVE_RECEIVED_A_FAVORITES_LIST_FROM',
// 'You have received a favorites list from').' '.$poster_name.' ('.$poster_email.')';
print JText::_('YOU_HAVE_RECEIVED_A_FAVORITES_LIST_FROM');
?><br/><br/>

In nl-NL.com_myshortlist.ini and nl-NL.override.ini I put

YOU_HAVE_RECEIVED_A_FAVORITES_LIST_FROM="U hebt een lijst ontvangen van:"

No Dutch text in the email!


PS Building Joomla sites since 2004; it what named "Mambo" so I have some experience

Filip

Please Log in or Create an account to join the conversation.

4 years 1 month ago #4 by Christopher Mavros
Replied by Christopher Mavros on topic module settings not used in component/myshortlist/ ?
Hi again Filip.
I'm glad you have so much experience. Visitors of this forum may not have it, though, so I usually write as if the user is a beginner in Joomla.

So. You are right! I had forgotten completely about this feature with the pdf_wrapper file. Yes, you can write a language code there.

Are you creating these PDFs from the component or the module?
Checking out the helper.php code, I see that it tries to use the module language.
So, if the site language is Dutch, but the module language is set to All, then it won't load the file default_pdf_wrapper_nl-NL.php, but rather the default file.
Maybe if you set the module language to Dutch?

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

4 years 4 weeks ago - 4 years 4 weeks ago #5 by Filip
Christopher,

Today I've been testing some more things.

default_pdf_wrapper_nl-NL.php works if module is assigned to Dutch language = OK


TCPDF is installed

Create PDF from module: works fine! = OK

Create PDF from component: doesn't work form the url /shortlist ( /shorlist is a 'hidden' menu item, assigned to Dutch language))

Error message (alert): "Something went wrong with creating the PDF file. Please try again later."

Console: script.min.js:1 {"log":"","result":"error","error":""}

Request: Is it possible to add a "Back button" which shows only on the "Component" lay-out URL /shortlist ?



Filip

Please Log in or Create an account to join the conversation.

4 years 4 weeks ago #6 by Christopher Mavros
Replied by Christopher Mavros on topic module settings not used in component/myshortlist/ ?
Hi again Filip.
I'm glad the Dutch language works.

The PDF seems like a different issue, so it would be best if you open a new topic please.
It would also be useful if you can send me a temporary admin account via email to mavrosxristoforos@gmail.com
Thanks again!

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

Moderators: Christopher Mavros