elementor / elementor

The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design.
https://elementor.com/
GNU General Public License v3.0
6.42k stars 1.39k forks source link

🔣 🔃 📚 Translations loaded too early (PR #27200) #27199

Closed swissspidy closed 2 weeks ago

swissspidy commented 2 weeks ago

Prerequisites

Description

Translations should typically be loaded after the init action has fired, to ensure that the current user has been already set up. Otherwise, the translation won't be loaded in the correct locale as set in the user's profile.

Right now, Elementor manually loads translations on plugins_loaded, which happens before init.

To solve this, I recommend just relying on the just-in-time translation loading functionality in WordPress itself. This will ensure translations are only loaded when needed.

Steps to reproduce

  1. Look at elementor.php to see how load_plugin_textdomain() is called too early.

Expected behavior

Translations should be loaded later

Isolating the problem

Elementor System Info

Click to reveal ````txt == Server Environment == Operating System: Darwin Software: nginx/1.16.0 MySQL version: MySQL Community Server - GPL v8.0.16 PHP Version: 8.2.10 PHP Memory Limit: 256M PHP Max Input Vars: 4000 PHP Max Post Size: 1000M GD Installed: Yes ZIP Installed: Yes Write Permissions: All right Elementor Library: Connected == WordPress Environment == Version: 6.6-alpha-57778-src Site URL: https://wordpress-develop.local Home URL: https://wordpress-develop.local WP Multisite: No Max Upload Size: 300 MB Memory limit: 256M Max Memory limit: 256M Permalink Structure: /%postname%/ Language: de_DE Timezone: Europe/Zurich Debug Mode: Active == Theme == Name: Twenty Twenty-Four Version: 1.1 Author: the WordPress team Child Theme: No == User == Role: administrator WP Profile lang: de-DE User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 == Active Plugins == Akismet Anti-spam: Spam Protection Version: 5.3.2 Author: Automattic - Anti-spam Team bbPress Version: 2.6.9 Author: The bbPress Contributors Elementor Version: 3.21.4 Author: Elementor.com Hello Dolly Version: 1.7.2 Author: Matt Mullenweg LiteSpeed Cache Version: 6.2.0.1 Author: LiteSpeed Technologies RTL Tester Version: 1.2 Author: Yoav Farhi, Automattic WooCommerce Version: 8.8.3 Author: Automattic Yoast Duplicate Post Version: 4.5 Author: Enrico Battocchi & Team Yoast == Must-Use Plugins == login-test.php Version: Author: Reset Helper Version: 0.1.0 Author: Pascal Birchler server-timing.php Version: Author: trac-60862.php Version: Author: == Elementor Experiments == Improved Asset Loading: Active by default Improved CSS Loading: Active by default Inline Font Icons: Active by default Additional Custom Breakpoints: Active by default admin_menu_rearrangement: Inactive by default Flexbox Container: Active by default Upgrade Swiper Library: Active by default Grid Container: Active by default Nested Elements Performance: Inactive by default Optimized Control Loading: Inactive by default Elementor Home Screen: Active by default Editor Top Bar: Inactive by default Build with AI: Active by default Landing Pages: Active by default Nested Elements: Inactive by default Lazy Load Background Images: Active by default == Log == == Elementor - Compatibility Tag == ````

Agreement

nicholaszein commented 2 weeks ago

Hi @swissspidy!

Thank you for contributing and submitting your issue! 🙏

Please allow us to discuss this internally, and we'll get back to you as soon as we have an answer.

Best regards

swissspidy commented 2 weeks ago

Sounds good. Let me know if I can help with testing instructions or so.