Extension lang files and metadata in 4.6

How do we define extension lang files w/i the metadata file? For example, I have

out/admin/en/ext_lang.php
out/ext_theme/en/ext_lang.php
out/ext_theme/fr/ext_lang.php

They wouldn’t fall under the ‘files’ field since they have no class.

There is no need to put them into the metadata. php, they still will be loaded if you place them in the right directory

Yes, but was this overlooked? I thought one intention of the metadata file was to allow the placement of all extension files under the module directory?

Actually, I see now this also applies to tpl files under the new ‘custom’ folder. That is, defining them in the meta file appears to serve no purpose. They must be copied to actual theme directory.

This just seems inconsistent…

Or is there a reason for this?

ok, i guess i misunderstood you.
You can keep you lang files inside your module directory and if you keep the default directory tree of the shop, your lang files gonna be included by the shop.

e.g:
modules/your-module/out/admin/en/admin_lang.php
modules/your-module/out/lang/en/frontend_lang.php

Shaun, I am not really sure if I got the question correct.
Searching a lot of directories could become a performance issue on high load scenarios so we do not want to check zillions of directories. In this manner, actually limiting the search is a good thing I reckon.

Cheers

Ok, thx, I see. No declaration of lang files needed in extension metadata. Works fine when using the suggested folder structure.

So it seems only the custom tpl files cannot belong in the module folder. As Marco suggested, maybe this is a performance thing? Would have been nice to have everything related to the extension in one place.

[QUOTE=spurvis;102344]
So it seems only the custom tpl files cannot belong in the module folder.[/QUOTE]
still didn’t get it.

i can use my own template files stored in the module directory.
Just like that:
metadata.php:


...
    ),
    'templates' => array(
	'widget_specialoffer.tpl' => 'hdispecialoffer/out/tpl/widget_specialoffer.tpl'
),
...

and in frontend:

[{ include file="widget_specialoffer.tpl" }]

Hmm, maybe it’s the manner in which I’m using the tpl. For me, I declare the same thing as meta data:


...
    ),
    'templates' => array(
	'cust_file.tpl' => 'v6c_anextension/out/tpl/cust_file.tpl'
),
...

Then the controller associated with that view (say cust_file.php) has a ‘render’ function that returns the tpl name as a string. In 4.5.x I would return ‘page/checkout/cust_file.tpl’ because that’s where I used to copy the file.
Now if I have render return ‘cust_file.tpl’ I get a template not found exception.

I’ve also tried declaring as meta:


...
    ),
    'templates' => array(
	'cust_file.tpl' => 'v6c_anextension/out/azure/tpl/custom/cust_file.tpl'
),
...

and then returning ‘custom/cust_file.tpl’ but that also did not work.

Maybe the code that evaluates the return value of ‘render’ does not use the info from metadata file.

well, find the difference:

[QUOTE=vanilla thunder;102345][{ include file=“widget_specialoffer.tpl” }][/QUOTE]

[QUOTE=spurvis;102356]returning ‘custom/cust_file.tpl’ [/QUOTE]