e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
318 stars 212 forks source link

[Feature request]: add some way of "callback" when you delete LAN string from core #5193

Open Jimmi08 opened 4 months ago

Jimmi08 commented 4 months ago

Motivation

With PHP 8 missing LAN constant will break your site so this is really important.

I understand the need to clean LAN files but there should be some safe solution not to break the site doing this.

With shortcodes there are legacy_shortcodes, with template there is {LAN} shortcode to manage this.

But there are many places in core or custom plugins that are using constant directly and if you use updated LANs files for older core, deleted LANs end in fatal error.

Could you add something like legacy_language file with the list of deleted LANs? Maybe add a preference/config constant to load legacy LANs?

your

Proposed Solution

Load special file for deleted LANs if it is set by site admin (not needed always)

There are 2 options:

OR

I prefer last option because it says translators what is replacement and you can delete that line and comment from lan file.

Alternatives

.

Additional Context

Example: deleted LAN_ERROR_9 was replaced with LAN_ERROR_3
but there could be plugins that are using LAN_ERROR_9 and this will break them in PHP 8

Thanks