New MVC GSOC 2014

https://groups.google.com/forum/#!topic/joomla-dev-cms/AH6piuw2IR0

http://gwilson.org/index.php/new-mvc
Thank you for clarifying your concern, I think I understand your position now. 

However, I'm not convinced that it is a valid concern. 

First, I'm not talking about all language strings. Just the ones prefixed in the MVC. All of which are generic messages anyway.

Second from what I know about the language system, language string are loaded very close to where they are consumed (at least they should be).

So a components lang file would be loaded during it's execution and modules during their execution. The only wild card would be plugins.

Once JText::_('string') is called the output is no longer dependent on JLanguage. So even if a module loaded another version of the same string, it wouldn't override the component output.

Of course plugins could be a problem, because they are executed throughout the cycle, but in this case prefixing string with JCOMPONENT and saying "don't override these in your plugin, seems more that sufficient to prevent this scenario. 

IMO the main reason why plugins load components language files to begin with is caused by the prefixing of component strings. 

Since it is already being done, why not make it official practice and set guidelines for how to do it properly. 
We could even go so far as to make it a separate INI file, en-GB.component.ini 

This would not only improve the user experience (no more untranslated strings), it would also lower the JDev learning curve (no need to read every line of code to find every possible message sent in the MVC)

And the best part is we don't have to change anything out side of the MVC. 

Does that make sense?

Sincerely,
Mathew Lenning

Babel-university.com

P.S. This message was sent via iPhone, so please forgive any errors

> On Aug 24, 2014, at 4:16 AM, Thomas Hunziker <notifications@github.com> wrote:
> 
> In libraries/cms/model/actions.php:
> 
> > +				// Trigger the onContentBeforeDelete event.
> > +				$result = $dispatcher->trigger('onContentBeforeDelete', array($context, $activeRecord));
> > +
> > +				if (in_array(false, $result, true))
> > +				{
> > +					throw new RuntimeException($activeRecord->getError());
> > +				}
> > +
> > +				$activeRecord->delete($pk);
> > +
> > +				// Trigger the onContentAfterDelete event.
> > +				$dispatcher->trigger('onContentAfterDelete', array($context, $activeRecord));
> > +			}
> > +			else
> > +			{
> > +				throw new RuntimeException($this->text_prefix . '_ACL_ERROR_DELETE_NOT_PERMITTED');
> Funny, so modules or plugins can load core strings, but components shouldn't. Sounds like your priorities are backwards.
> 
> I think either I or you understood something wrong. I didn't say you can't load or use core strings. You can load the files containing them or use strings already loaded fine. But you should never override a core string within your extension. It doesn't matter if it's a component, module or plugin.
> The thing is that this may work fine as long as your extension is the only one using it during a given page cycle. However you don't know that. At the same time there may be plugins and modules using the same string, or they may load your language file with the override. This may cause unexpected side effects. That's why extensions need prefixes for their language strings, so they don't accidentally override strings from other extensions (or core).
> 
> There is of course nothing wrong with using a generic string which works for most extensions. Extensions which need a different value just need to override the code (not the value!) and use an own string instead.
> 
> \
> Reply to this email directly or view it on GitHub.