This thread is resolved. Here is a description of the problem and solution.
Problem:
The client wants to have separate 404 pages for different languages instead of a single redirect via the 404.php page.
Solution:
We recommend the following steps to create language-specific 404 pages:
1. Ensure that the strings on the 404 page are wrapped in the gettext function. You can find more information on how to enable text translation for themes not compatible with WPML in our documentation: Enabling Text Translation for Themes Not Compatible with WPML.
2. Scan your theme for strings by navigating to WPML >> Theme and plugins localization, select your theme, and click the “Scan selected themes for strings” button.
3. Translate the required strings by going to WPML >> String Translation, searching for the strings, and adding their translations.
4. Use the
wpml_current_language
hook to get the current language and display or include content accordingly. For more details, check out our documentation: wpml_current_language Hook.
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.