Home›Support›English Support›[Resolved] The function of changing the language in string translation does not work
[Resolved] The function of changing the language in string translation does not work
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing an 'Internal Server Error' on their website. After the hosting support suggested changes to the .htaccess file, the website pages started working correctly, but the string translation language change function stopped working.
Solution: First, we recommended testing in a minimal environment with only WPML plugins enabled and a default theme, preferably on a staging site. We also advised enabling debug mode by adding the following code to the wp-config.php file:
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
We provided links to WordPress debugging documentation:
After enabling debugging, we asked the client to reproduce the issue and check for a debug.log file in the wp-content folder, and to look for any errors in the browser dev tools console.
If the solution provided here is not relevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket in the WPML support forum.
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.
A few days ago, pages on the site stopped loading and displayed the following error:
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at server@admin.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request."
I asked hosting technical support for help and this is what they replied:
"Your language plugins generated incorrect directives."
We changed the line in the .htaccess file located in the root directory of the site
RewriteBase /en/
on
RewriteBase /
And also changed
RewriteRule . /en/index.php [L]
on
RewriteRule . /index.php [L]
And after that, all pages work correctly and we continued the translation.
But now it turns out that the function of changing the language in string translation has stopped working. This function is needed because the site is in Ukrainian by default, but the theme is installed in English. And in order to change these lines from the topic from English to Ukrainian, I changed the line to any other third language and then wrote the correct options in Ukrainian and English.
I’m not sure that the history of changes in the .htaccess file is related to the fact that the function for changing the language in string translation now does not work, but since the function stopped working after changes in .htaccess, perhaps this is connected.
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hi there,
Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.
Are you able to test it in a minimal environment, to see if you're able to change the language of that string with only WPML plugins enabled and a default theme? If possible, please try it in a staging site to not affect the live site.
In addition to that, I'd like your help enabling the debug mode, please add the following code to the wp-config.php file:
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
I did everything as you wrote.
After I added this code to wp-config.php, the ability to select a category disappeared. The screenshot shows that it does not find categories, although they are there.
Then I tried to at least create one for all products, without dividing them into categories, but it gave me the error “Something went wrong with the creation of the layout!” Second screen.
Therefore, I could not repeat the problem. And the debug.log file is missing.
I made a copy of the site so as not to break the main one.
I don’t see the opportunity to write in private mode, I would like to write you the address, login and password.
I really hope for some help, otherwise I will have to abandon the plugin. Unfortunately, this is not the first time that we have had incomprehensible problems, although everything should be easy.
Сегодня увидела в разделе "Поддержка" плагина WPML в ведомостях, что WooCommerce Multilingual не установлен. Но это не так - он есть в плагинах, включен, отображается в панели Вордпресса слева со всеми своими функциями (скрин прилагаю).
Скопировала сайт на поддомен, отключила все плагины кроме минимально необходимых:
WPML (и все что с ним шли)
Elementor и Woodmart Core (они обязательны для темы Woodmart)
WooCommerce (именно макеты от Woodmart для WooCommerce и не получается перевести, конкретно макеты Single product layout.
Начались проблемы с того что WPML сформировал некорректные директивы в .htaccess
У меня несколько заказов висит, которым нужен плагин перевода.
И я хотела купить Multilingual Agency.
Но сейчас в растерянности, не понимаю как заставить WPML работать или что ему мешает.
Начались проблемы с того что WPML сформировал некорректные директивы в .htaccess
Это проблема решается по ссылке Выше.
Очень странно, что WooCommerce Multilingual не отображается, как активированный.
Мне нужно запросить временный доступ (WP-администратора и FTP) на Ваш сайт - предпочтительно к тестовому сайту, где проблема была воспроизведена, если это возможно - для того, чтобы лучше помочь. Вы найдете необходимые поля ниже поля для комментариев, когда Вы войдете, чтобы оставить свой следующий ответ. Информацию, которую Вы ведете является частной, что означает только Вы и я могу видеть и иметь доступ к ней.
Спасибо за доступы. Я все проверил и также установил новые версии плагинов WPML. WooCommerce Multilingual & Multicurrency работает на Вашем тестовом сайте.
Насколько я вижу, WPML в целом работает должным образом. Не могли бы Вы указать в чем именно заключается проблема?
Проблема:
В теме WoodMart, в Layouts, в Single product не получается сделать перевод.
Когда делаю перевод и сохраняю - отображаются стрелочки, крутящиеся по кругу (скрин).
И на самом сайте не отображается перевод.
На втором скрине видно что перевод в процессе.
1. Могли бы вы подсказать, пожалуйста почему блок с фильтром не появляется в переводах?
Оригинал сайта на украинском языке и фильтры здесь отображаются: hidden link
Но при переходе на русский или английский фильтра нет: hidden link hidden link
В виджетах поставлено "Все языки".
Все таксономии переведены.
Макет "Product archive layout" переведен.
2. В String Translation не находит слова "Ціна", хотя в "Локализации теми и плагинов" просканировала тему и дочернюю тему, которые выводят этот виджет.
New threads created by Andrey and linked to this one are listed below:
Рад слышать, что теперь это работает. Так как исходной проблемы больше нет, я открыл для Вас новый билет для каждого нового вопроса, отвечу в каждом. Это также поможет другим пользователям с подобными проблемами найти решение при поиске на форуме.