[wp-trac] [WordPress Trac] #39587: link problems with language settings

WordPress Trac noreply at wordpress.org
Wed Apr 5 12:19:10 UTC 2023


#39587: link problems with language settings
--------------------------+------------------------------
 Reporter:  aansel        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  I18N          |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |     Focuses:
--------------------------+------------------------------

Comment (by rmpel):

 Replying to [comment:14 swissspidy]:
 > It's generally discouraged to make post type slugs translatable because
 you will constantly run into situations like this, or permalinks breaking
 because translations get updated.

 If only we lived in a single-language world ;)

 > In theory, on `options-permalink.php` we could wrap the
 `flush_rewrite_rules()` call in a `switch_to_locale()` to always use the
 site language, but this alone is no guarantee that nothing else could
 break. Especially since `flush_rewrite_rules();` is called in many places
 both in core and plugins.

 Tried that, doesn't work. In fact; merely accessing the options-
 permalinks.php page already changes the permalinks in the rewrite-rules
 option value.

 > So I would consider closing this as a wontfix because it's plugins
 `doing_it_wrong()`. Adding `dev-feedback` though to get more feedback.

 I understand a "won't fix", but at least a decent work-around would be
 helpful. Perhaps a filter that allows a developer to change the slug
 before it enters the database / htaccess / etc. ??

 > I am not saying they should not be translatable. If you want to make
 post type slugs translatable it's better to do that differently though,
 for example via a dedicated settings field.

 Yeah, I think we are going in that direction too. Still, should not be
 necessary...

 Thanks for your insight!

 R.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/39587#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list