The standard way to have a taxonomy term localized is by using the function i18n_taxonomy_localize_terms().
However, this function does not accept a custom language code for which we want the taxonomy term to be localized, it can only be used for the current language.

Having a langcode as an argument, would give a lot more flexibility to this function.

I will add a patch for this.

Thank you !

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webfordreams’s picture

Nixou’s picture

Reroll for latest version

joseph.olstad’s picture

Status: Active » Needs review
joseph.olstad’s picture

Status: Needs review » Fixed
commit f0aafd25c8b7fe2ce0d67fb571dabe39595d2714 (HEAD -> 7.x-1.x, origin/HEAD, origin/7.x-1.x)
Merge: 36dd3ad 5fcf18b
Author: Maarten Steurs <44559-webfordreams@users.noreply.drupalcode.org>
Date:   Thu Jan 12 11:06:13 2023 -0500

    Issue #2326329 by webfordreams, Nixou: Allow langcode as argument for i18n_taxonomy_localize_terms()

commit 36dd3ade12a0dd2a6aebf4cbe39b2e4f5f05e457
Author: Maarten Steurs <44559-webfordreams@users.noreply.drupalcode.org>
Date:   Thu Jan 12 11:04:41 2023 -0500

    Issue #2326329 by webfordreams, Nixou: Allow langcode as argument for i18n_taxonomy_localize_terms()
joseph.olstad’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.