У этого пользователя нет избранных тем.
Избранные темы форума
Созданные темы форума
| Статус |
Тема
|
Специалист поддержки | Голоса | Сообщения | Свежесть |
|---|---|---|---|---|---|
|
WPML String Translation no longer detects new strings added in Twig templates
Начато: enriqueE-3
в: English Support
Problem: Solution: 1. Register strings using the wpml_register_single_string action and retrieve translations using the wpml_translate_single_string filter in PHP. Example: function theme_t(string $name, string $default, string $context = 'Theme strings'): string {<br /> do_action('wpml_register_single_string', $context, $name, $default);<br /> return apply_filters('wpml_translate_single_string', $default, $context, $name);<br />}<br />$context['i18n'] = [<br /> 'read_more' => theme_t('button.read_more', 'Read more'),<br /> 'search_placeholder' => theme_t('search.placeholder', 'Search'),<br />];<br />Timber::render('template.twig', $context);2. Consider maintaining a centralized PHP file for translations or separate files per component/block for larger projects. 3. For block-based architectures, manage translations at the block level. Example: function get_card_block_i18n(): array {<br /> return [<br /> 'title' => theme_t('blocks.card.title', 'Featured article', 'Theme blocks'),<br /> 'cta' => theme_t('blocks.card.cta', 'Read more', 'Theme blocks'),<br /> ];<br />}Documentation on string registration and translation can be found at: If this solution does not resolve your issue or seems outdated, 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 needed, please open a new support ticket at WPML support forum. |
|
0 | 5 | 1 месяц назад | |
|
Page translation issue and Javascript error
Начато: enriqueE-3 в: English Support |
|
2 | 4 | 2 года, 11 месяцев назад | |
|
WPML chat support ticket by enriqueE-3 — 1692193532
Начато: enriqueE-3 в: English Support |
1 | 1 |
2 года, 11 месяцев назад
|