Ticket #1744 (closed enhancement: invalid)

Opened 13 months ago

Last modified 4 weeks ago

lang-inheritance in templates

Reported by: ischommer Owned by: bfojcapell
Priority: medium Milestone:
Component: i18n Version:
Severity: medium effort / impact Keywords:
Cc: Hours:

Description

i18n.php->include_by_class() looks for definitions only for the specific template. as most of the templates have an "implied inheritance" through the controller they're attached to, we could try to find the definitions in the inheritance chain as well. this relies on some naming conventions, but as the inheritance is optional its not a big problem.

example: i tried to use _t('ADDLISTING') in the translation-module. i18nAdmin_left.ss -> i18nAdmin.php (extends GenericDataAdmin?) now if either the /lang-folder in the translation-module is not present, or the specific key $lang['en_US']['i18nAdmin_left.ss']['ADDLISTING'] is not present, it should fall back to $lang['en_US']['GenericDataAdmin_left.ss']['ADDLISTING'].

possible rules:

  • templatename without ".ss" as controllername
  • templatename before first "_" as controllername

Change History

Changed 4 weeks ago by ischommer

  • status changed from new to closed
  • resolution set to invalid

The described inheritance goes in the "too much magic" bucket - thats not even possible on a PHP level at the moment. We've now got namespaces in templates, which should enable developers to find generic entities and avoiding redundancy. See r65361

Note: See TracTickets for help on using tickets.