This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Exception
This topic contains 1 reply, has 2 voices.
Last updated by Prosenjit Barman 1 year, 3 months ago.
Assisted by: Prosenjit Barman.
Author | Posts |
---|---|
September 21, 2023 at 12:36 pm #14439085 | |
davidR-107 |
I fail to understand what the option " Automatically load the theme's .mo file using 'load_textdomain'" is doing exactly. Here is what I think it does, please tell me if it's correct or not: By default, WPML stores string translations in the database. Questions: - If the checkbox isn't checked, will a theme and plug-in's .mo files be ignored? |
September 25, 2023 at 7:31 am #14455079 | |
Prosenjit Barman Supporter
Languages: English (English ) Timezone: Asia/Dhaka (GMT+06:00) |
Hello There, I understand the queries you have. Your understanding of "Automatically loading the theme's .mo file with 'load_textdomain'" is on point. That feature is designed to ensure that the theme and plugin translations(.mo file) are loaded first from the "/languages" folder and then from the database. WPML will first look for and load the .mo file automatically without you having to manually do it. In summary, activating this feature in WPML will ensure that the translations are automatically loaded using the standard WordPress function `load_textdomain`. This is particularly useful if you're using a theme that's been translated into multiple languages and you want to make sure those translations are utilized by WPML. In response to the Question: - If you left the option unchecked, that means the translation will not be loaded automatically. However, that doesn't mean the translation file will be ignored. If WPML is not told to manage or override this, the default behavior of WordPress will take over, and it will load the .mo files as it usually does. You may need to enable Auto registration of string from "WPML > String Translation" to automatically register the strings for translation. - Loading an MO file and downloading a missing MO file is different. This option uses the "load_textdomain" function, which loads an already present .mo file so translations can be applied. It doesn't download or fetch files from external sources. - When we refer to the "theme's .mo", we aren't exclusively addressing the MO files of the theme alone. It's a general reference to the loading of .mo files. In reality, WPML's feature manages .mo files for both themes and plugins. That's why, the text domain of other plugins are listed there. I hope I'm able to clarify things for you. But, if you still need assistance, feel free to let me know. I will be happy to help. Best regards, |