New MVC GSOC 2014

https://groups.google.com/forum/#!topic/joomla-dev-cms/AH6piuw2IR0

http://gwilson.org/index.php/new-mvc
@Bakual 

>You're saying the same language string should have a different value depending on the active extension, and it may even change during the life cycle of a page load.

This is not what I am saying.

Your assumption is that component developers have a desire to override the messages that come from the MVC. 

In my case I am saying this is not true. In most cases I believe this will not be true, and even in the very few cases in which it might be true, there is already a way to do it without prefixes. In fact it is already being done in **JOOMLA CORE EXTENSIONS!**

**OPEN YOUR EYES** and see the ridiculousness of legacy thinking. 
administrator/languages/en-GB/en-GB.com_weblinks.ini

    COM_WEBLINKS_N_ITEMS_ARCHIVED="%d weblinks successfully archived"
    COM_WEBLINKS_N_ITEMS_ARCHIVED_1="%d weblink successfully archived"
    COM_WEBLINKS_N_ITEMS_CHECKED_IN_0="No weblink successfully checked in"
    COM_WEBLINKS_N_ITEMS_CHECKED_IN_1="%d weblink successfully checked in"
    COM_WEBLINKS_N_ITEMS_CHECKED_IN_MORE="%d weblinks successfully checked in"
    COM_WEBLINKS_N_ITEMS_DELETED="%d weblinks successfully deleted"
    COM_WEBLINKS_N_ITEMS_DELETED_1="%d weblink successfully deleted"
    COM_WEBLINKS_N_ITEMS_PUBLISHED="%d weblinks successfully published"
    COM_WEBLINKS_N_ITEMS_PUBLISHED_1="%d weblink successfully published"
    COM_WEBLINKS_N_ITEMS_TRASHED="%d weblinks successfully trashed"
    COM_WEBLINKS_N_ITEMS_TRASHED_1="%d weblink successfully trashed"
    COM_WEBLINKS_N_ITEMS_UNPUBLISHED="%d weblinks successfully unpublished"
    COM_WEBLINKS_N_ITEMS_UNPUBLISHED_1="%d weblink successfully unpublished"

administrator/languages/en-GB/en-GB.com_users.ini

    COM_USERS_NOTES_N_ITEMS_ARCHIVED="%d User Notes successfully archived"
    COM_USERS_NOTES_N_ITEMS_ARCHIVED_1="%d User Note successfully archived"
    COM_USERS_NOTES_N_ITEMS_CHECKED_IN="%d User Notes successfully checked in"
    COM_USERS_NOTES_N_ITEMS_CHECKED_IN_1="%d User Note successfully checked in"
    COM_USERS_NOTES_N_ITEMS_DELETED="%d User Notes successfully deleted"
    COM_USERS_NOTES_N_ITEMS_DELETED_1="%d User Note successfully deleted"
    COM_USERS_NOTES_N_ITEMS_PUBLISHED="%d User Notes successfully published"
    COM_USERS_NOTES_N_ITEMS_PUBLISHED_1="%d User Note successfully published"
    COM_USERS_NOTES_N_ITEMS_TRASHED="%d User Notes successfully trashed"
    COM_USERS_NOTES_N_ITEMS_TRASHED_1="%d User Note successfully trashed"
    COM_USERS_NOTES_N_ITEMS_UNPUBLISHED="%d User Notes successfully unpublished"
    COM_USERS_NOTES_N_ITEMS_UNPUBLISHED_1="%d User Note successfully unpublished"

administrator/languages/en-GB/en-GB.com_contact.ini

    COM_CONTACT_N_ITEMS_ARCHIVED="%d contacts successfully archived"
    COM_CONTACT_N_ITEMS_ARCHIVED_1="%d contact successfully archived"
    COM_CONTACT_N_ITEMS_CHECKED_IN_0="No contact successfully checked in"
    COM_CONTACT_N_ITEMS_CHECKED_IN_1="%d contact successfully checked in"
    COM_CONTACT_N_ITEMS_CHECKED_IN_MORE="%d contacts successfully checked in"
    COM_CONTACT_N_ITEMS_DELETED="%d contacts successfully deleted"
    COM_CONTACT_N_ITEMS_DELETED_1="%d contact successfully deleted"
    COM_CONTACT_N_ITEMS_PUBLISHED="%d contacts successfully published"
    COM_CONTACT_N_ITEMS_PUBLISHED_1="%d contact successfully published"
    COM_CONTACT_N_ITEMS_TRASHED="%d contacts successfully trashed"
    COM_CONTACT_N_ITEMS_TRASHED_1="%d contact successfully trashed"
    COM_CONTACT_N_ITEMS_UNPUBLISHED="%d contacts successfully unpublished"
    COM_CONTACT_N_ITEMS_UNPUBLISHED_1="%d contact successfully unpublished"

administrator/languages/en-GB/en-GB.com_contact.ini

    COM_CATEGORIES_N_ITEMS_ARCHIVED="%d categories successfully archived"
    COM_CATEGORIES_N_ITEMS_ARCHIVED_1="%d category successfully archived"
    COM_CATEGORIES_N_ITEMS_ASSIGNED="%d items are assigned to this category."
    COM_CATEGORIES_N_ITEMS_ASSIGNED_1="%d item is assigned to this category."
    COM_CATEGORIES_N_ITEMS_CHECKED_IN_0="No category successfully checked in"
    COM_CATEGORIES_N_ITEMS_CHECKED_IN_1="%d category successfully checked in"
    COM_CATEGORIES_N_ITEMS_CHECKED_IN_MORE="%d categories successfully checked in"
    COM_CATEGORIES_N_ITEMS_DELETED="%d categories successfully deleted"
    COM_CATEGORIES_N_ITEMS_DELETED_1="%d category successfully deleted"
    COM_CATEGORIES_N_ITEMS_PUBLISHED="%d categories successfully published"
    COM_CATEGORIES_N_ITEMS_PUBLISHED_1="%d category successfully published"
    COM_CATEGORIES_N_ITEMS_TRASHED="%d categories successfully trashed"
    COM_CATEGORIES_N_ITEMS_TRASHED_1="%d category successfully trashed"
    COM_CATEGORIES_N_ITEMS_UNPUBLISHED="%d categories successfully unpublished"
    COM_CATEGORIES_N_ITEMS_UNPUBLISHED_1="%d category successfully unpublished"

That is only 4 components. It is the same in every extension in Joomla, with the exception of ones developed by people who haven't **read every single line of code** in the legacy MVC to find out what messages they need to add to their INI file. 

Tell me honestly, would you care if com_weblinks said,
"5 records deleted" instead of "5 weblinks deleted"? Do you think the admin user would?

Also I want to make it clear that I am not saying do this

````
$this->setMessage(JText::_(($lang->hasKey($this->text_prefix . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS') ? $this->text_prefix : 'JLIB_APPLICATION') . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS'));
````

Besides being a perfect example of why IMO ternary conditionals should be banned from Joomla, it is completely insane. How long does it take you to figure out what the language key is? How long do you think it is going to take someone who just started Joomla component development? Is this what you call clean code?

**What I AM saying** is stop catering to the edge case, because the best way to insure failure is to try to accommodate everyone. Even without the ability to override strings via their ini file, developers have the option of overriding the code. 

So why are you going to force every extension developer to copy/paste these string AND reduce the end users experience with untranslated language keys, for the sake of some phantom extension developer that MIGHT have the desire to override the MVC messages in some yet unknown uses case?

Last but not least I'll leave you with the final reason for my position on this matter. 
Since I know everyone reading this loves acronyms. [YAGNI](http://en.wikipedia.org/wiki/You_aren't_gonna_need_it)