Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jimmi08 opened this issue Feb 10, 2024 · 0 comments
Labels
type: enhancement An improvement or new feature request

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Feb 10, 2024

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:

  • add deleted LAN there (as was originally defined)

OR

  • check if deleted LAN exists and if not, add a definition by a constant that is its replacement.

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

@Jimmi08 Jimmi08 added the type: enhancement An improvement or new feature request label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement An improvement or new feature request
Projects
None yet
Development

No branches or pull requests

1 participant