Post by i2Paq » Sun Jul 03, 2011 9:21 pm

Qphoria wrote: Language fallback has been around since OpenCart 0.x
It was added to the core by me in 0.7.9
It was removed by daniel in 1.x through 1.3.x
Added back into the core by me in 1.4.7 through 1.4.9.x
Removed again by daniel in 1.5.0

Daniel needs to be convinced.
I was wondering why I had and see strange issues with language-packs made for 1.4.9.x.

I never knew that Daniel removed the Language Fallback in 1.5.x, what a MAJOR bummer!
And I cannot understand why as this generates more issues with older language files.

Danial put it back please!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Tue Jul 05, 2011 9:15 am

Preaching to the choir.. just complain complain to daniel about it. I tried adding it back twice but keep getting vetoed.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Tue Jul 05, 2011 9:41 am

Is there any legitimate reason for it not being there?

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by i2Paq » Tue Jul 05, 2011 12:50 pm

Qphoria wrote:Preaching to the choir.. just complain complain to daniel about it. I tried adding it back twice but keep getting vetoed.
We are already seeing lots of issues with not compatible languages.
I had the same once and wondered why I was getting the "cannot load \catalog\languages\dutch\module\wtf?.php" ;)

So, Daniel, what is the reason?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Tue Jul 05, 2011 7:01 pm

Well I can guess that it is due to the code not belonging in the framework part of it. It doesn't flow with the "proper" way of doing it. The same way the template fallback could be done in one place, but instead gets done in every single controller. And why the language isn't "autoloaded", but needs to be array_merged now to avoid having to manually define each language variable.

Unfortunately there seems to be a good and evil side to having a proper framework that daniel is forced to battle with and it makes the cart a ball of redundant code

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by madimar » Tue Jul 05, 2011 7:23 pm

I agree with all of you. I still didn't upgrade on 1.5.x, waiting for more stability, but I think similar major features can't be missing!!!
Daniel, please, evaluate to re-include language fallback, it is really important IMHO.

-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------


User avatar
Active Member

Posts

Joined
Thu Sep 24, 2009 6:27 pm


Post by Xsecrets » Tue Jul 05, 2011 8:51 pm

Qphoria wrote:Well I can guess that it is due to the code not belonging in the framework part of it. It doesn't flow with the "proper" way of doing it. The same way the template fallback could be done in one place, but instead gets done in every single controller. And why the language isn't "autoloaded", but needs to be array_merged now to avoid having to manually define each language variable.

Unfortunately there seems to be a good and evil side to having a proper framework that daniel is forced to battle with and it makes the cart a ball of redundant code
Speaking of array_merging the language data is it working for you in 1.5? for some reason the few times I've tried it it hasn't worked for me, but I've been in to big of a rush to try to figure out why.

Also I don't really get the whole it has to be a 100% proper framework. It's not like he's releasing the framework separately.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Tue Jul 05, 2011 9:14 pm

Xsecrets wrote: Speaking of array_merging the language data is it working for you in 1.5? for some reason the few times I've tried it it hasn't worked for me, but I've been in to big of a rush to try to figure out why.

Also I don't really get the whole it has to be a 100% proper framework. It's not like he's releasing the framework separately.
Yea I've used the array_merge in all my payment modules with no issue

As far as the framework.. I think the way things are now, keeping it separate just adds thousands of redundant lines of code. But I see his point of doing it the right way.

I think the issue is that there needs to be another layer that interfaces with the system library from the application side. The application needs its own libraries and the system/library should be generic classes instead of a mix of application specific libraries like the currency library.

For example....
The mail.php file is written as a class, but it is annoying that we need to use:

Code: Select all

$mail = new Mail(); 
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');			
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_query->row['store_name']);
everytime we want to send a simple email.
This default configuration should be handled somewhere else like the model/tool area. Then we could just call
$this->model_tool_mail->sendMail('me@you.com', $msg);

similarly a language tool library should be made that handles the fallback and merge so you can just do:

$this->model_tool_language->load('product/product'); and it will handle the merging and fallback, while leaving the generic language class in the system/library folder alone.

I think the problem is that we try to use classes as if they were shared libraries and it just isn't working well since classes have to be fully initialized each time.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Tue Jul 05, 2011 9:40 pm

Qphoria wrote:
This default configuration should be handled somewhere else like the model/tool area. Then we could just call
$this->model_tool_mail->sendMail('me@you.com', $msg);

similarly a language tool library should be made that handles the fallback and merge so you can just do:

$this->model_tool_language->load('product/product'); and it will handle the merging and fallback, while leaving the generic language class in the system/library folder alone.

I think the problem is that we try to use classes as if they were shared libraries and it just isn't working well since classes have to be fully initialized each time.
That sounds like a very reasonable solution. It's what you would do if you were building off a prepackaged framework like codeigniter or yii, though in this case since the framework is not packaged for distribution I don't really see why it has to stay "pure", but if you want to keep it that way you really should make some application level libraries to make many of these things cleaner.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by i2Paq » Tue Jul 05, 2011 11:52 pm

I wished that Daniel would response to why it has been removed and when we could see it back.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands
Who is online

Users browsing this forum: Majestic-12 [Bot] and 9 guests