Skip to content

Fix Raw ML term names when i18n config is already initialized#1492

Open
Komarovski wants to merge 1 commit into
qtranslate:masterfrom
Komarovski:patch-6
Open

Fix Raw ML term names when i18n config is already initialized#1492
Komarovski wants to merge 1 commit into
qtranslate:masterfrom
Komarovski:patch-6

Conversation

@Komarovski

Copy link
Copy Markdown
Contributor

Fix qtranxf_get_term_joined() so that it always restores the complete Raw ML term name from the language values stored in i18n_config['name']['ts'].

Previously, the Raw ML value was rebuilt only when i18n_config had not yet been initialized. If the term object already contained i18n_config, its name property could remain translated into the currently active language instead of containing the complete multilingual value.

This caused taxonomy term fields in the WordPress admin to display only one language after saving, for example:

Wallpapers

instead of:

[:en]Wallpapers[:uk]Шпалери[:]

The updated function initializes i18n_config when necessary and then independently rebuilds both:

$obj->name $obj->i18n_config['name']['ml']

from i18n_config['name']['ts'].

The issue became visible after updating WordPress from 6.8.5 to 7.0.

Fix `qtranxf_get_term_joined()` so that it always restores the complete Raw ML term name from the language values stored in `i18n_config['name']['ts']`.

Previously, the Raw ML value was rebuilt only when `i18n_config` had not yet been initialized. If the term object already contained `i18n_config`, its `name` property could remain translated into the currently active language instead of containing the complete multilingual value.

This caused taxonomy term fields in the WordPress admin to display only one language after saving, for example:

`Wallpapers`

instead of:

`[:en]Wallpapers[:uk]Шпалери[:]`

The updated function initializes `i18n_config` when necessary and then independently rebuilds both:

`
$obj->name
$obj->i18n_config['name']['ml']
`

from `i18n_config['name']['ts']`.

The issue became visible after updating WordPress from 6.8.5 to 7.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant