Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#50752 closed defect (bug) (duplicate)

Internationalization of a slug using user language instead of site language

Reported by: dennismenken's profile dennismenken Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.4.2
Component: I18N Keywords:
Focuses: Cc:


I have tried to make a custom post type slug translatable.

For this I have used the following snippet:

'slug' => _x('recipes', 'URL slug', THEME_TEXT_DOMAIN)

Then I have added the string translation for recipes in german called "rezepte". The dynamic links in the frontend got an update. But the regeneration of permalinks doesn't work for my user because my language is set to English (UK) and the site language is set to German Formal. I have switched my profile language to German Formal and have updated the permalink structure again. Then it works.

It must be bug because if a user using an another language than the site language and refreshing the permalink structure it falls back to the user language or non-language if a translation is missing.

Change History (1)

#1 @swissspidy
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #40298, but really not supported like this. Rewrite rules are saved to the database, and that conflicts with dynamic (translated) slugs based on the current language.

Note: See TracTickets for help on using tickets.