New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language overrides do not work in SEF 1.8.9 and Joomla 3.6.5 #16

Closed
andrewscaya opened this Issue Jan 24, 2017 · 9 comments

Comments

Projects
None yet
2 participants
@andrewscaya
Owner

andrewscaya commented Jan 24, 2017

Hi Guys,

I like Simple Mail Form very much, mainly because it can be used in modules. Not everyone wants a mail for in content, and for many components solutions like Components Anywhere do not work!

Plus Simple mail form is ... eh, well, simple!

But I found one problem (Joomla and SMF both latest stable versions): the language overrides do not work.

For example: I created one for MOD_SIMPLEEMAILFORM_button_submit and nothing shows up!

Can it be fixed easily?

Met vriendelijke groet,

Eric

@andrewscaya andrewscaya self-assigned this Apr 8, 2017

@andrewscaya andrewscaya added this to the 2.1.0 milestone Apr 8, 2017

@andrewscaya

This comment has been minimized.

Owner

andrewscaya commented Dec 11, 2017

@martinbeaudry --

Can you please have a look at this issue? If this issue requires development on our part, please let me know as I will create a separate branch for it.

Many thanks!

-- Andrew

@martinbeaudry

This comment has been minimized.

Contributor

martinbeaudry commented Dec 11, 2017

I'll look at it as soon as I can.

@martinbeaudry

This comment has been minimized.

Contributor

martinbeaudry commented Dec 15, 2017

Here's my report on this request. I'll wait for your decision before I start coding.

Issue – A user reports that Joomla's language overrides don't work in SEF.

Language overrides – This Joomla feature allows users to replace a default text with a custom one, either manually (by creating language files) or through the CMS' administration interface.

Using the admin interface, changes are done in Extensions>>Language(s)>>Overrides. Only one constant's value can be changed for only one language at a time, either for the site or the admin interface. Creating a language file manually is much faster and rather straightforward.

The main benefit of language overrides compared to SEF language files is that user changes won't be lost when Joomla or SEF is updated.

Relevance – The user's comment seems relevant, as the Joomla documentation mentions that language overrides can be used to edit text from the CMS kernel, but also from extensions. A user can therefore legitimately expect to be able to use this feature in SEF.

It is not a bug, however, as SEF wasn't designed with language overrides in mind.

Work required – Joomla looks into the /language/overrides/ folder to see if there's a .override.ini file for the language in use. For this feature to work, the overridden values and their constants must be in /language//.mod_simpleemailform.ini (if we use the English language as an example).

Therefore, each file that currently sits in SEF's language_files folder would have to be installed in the appropriate language folder, for instance /language/en-GB/. To do so, changing the mod_simpleemailform.xml file could prove to be enough.

We would also need to replace the $translang property with Joomla's JText class. For example, line 1 555 in modsimpleemailform.php:

value=\"{$this->transLang['MOD_SIMPLEEMAILFORM_button_submit']}\"

would become:

value=\"" .  JText::_('MOD_SIMPLEEMAILFORM_BUTTON_SUBMIT') . "\"

Please note that, in this example, the constant is entirely in capital letters. That's because Joomla automatically replaces small letters with capital ones when the administration interface is used to create a language override.

Risks – Unforeseen problems could make it difficult to complete all changes in time for the Joomla 2.1 deadline.

It remains to be seen if adding files outside of the SEF repository could run into permission issues in some installations. Joomla's module installation process might have all the necessary rights to install files in language folders, reading the settings from an .xml file.

Adding this feature would also create minor backward compatibility breaks. Users who edited some entries in their language files would discover that their changes have no effect in version 2.1.

Mitigating strategies – Some existing modules already implement the language overrides feature. Finding one or some of them to see how they did it might help us gain some time.

The documentation will be updated to account for the changes. If required, it could mention that language files might have to be installed manually in case of a permission problem. Manual installation of language files may also be required when a new language is added to a website.

Comments could be added to the current SEF language files in order to explain the new way to work. They could also link to the relevant documentation.

Conclusion – This new feature would be a welcome addition to SEF as it fits right in with the efforts to better integrate the module with Joomla.

However, since it would create minor backward compatibility breaks, it might be better to wait until version 3.0 to add it.

@andrewscaya

This comment has been minimized.

Owner

andrewscaya commented Dec 15, 2017

@martinbeaudry --

I agree with you and we will postpone implementing this feature until version 3.0.0.

Many thanks!

Yours,

Andrew

@andrewscaya

This comment has been minimized.

Owner

andrewscaya commented Feb 20, 2018

@martinbeaudry --

I will proceed to release version 2.2.0 of SEF this week. I will include this feature (#16) in the new release. Can you spare me some time in the next few days for tests and doc updates?

Many thanks!

Yours,

Andrew

@martinbeaudry

This comment has been minimized.

Contributor

martinbeaudry commented Feb 20, 2018

Yes, I'll fit this in my schedule for this week or next, depending on your needs.

My pleasure!

@andrewscaya

This comment has been minimized.

Owner

andrewscaya commented Feb 21, 2018

@martinbeaudry --

Branch '2.2.0-doc' is all yours! Please let me know when you are done.

Many thanks!

Andrew

@martinbeaudry

This comment has been minimized.

Contributor

martinbeaudry commented Feb 21, 2018

Good, I'll start working on it today.

andrewscaya added a commit that referenced this issue Feb 23, 2018

@andrewscaya

This comment has been minimized.

Owner

andrewscaya commented Feb 23, 2018

Feature completed. Blackbox testing can begin on the '2.2.0-codefreeze' branch.

Repository owner locked as resolved and limited conversation to collaborators Feb 23, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.