WordPress.org

Making WordPress.org

Opened 5 years ago

Last modified 2 years ago

#603 new enhancement

Translatable slug in WordCamp Custom Post Types

Reported by: gugaalves Owned by:
Milestone: Priority: low
Component: WordCamp Site & Plugins Keywords: needs-patch
Cc:

Description

The slug in Custom post types of WordCamp sites are not using translatable string in its slugs.

I'm organizing WordCamp Rio de Janeiro, and a sponsor url (called 'patrocinador' in portuguese), is shown like /sponsor instead of /patrocinador.

The same happens with the Speakers, Sessions and Organizers CPT's.

Change History (7)

#1 @iandunn
5 years ago

In 860:

WordCamp Post Type: Internationalize the content stubs for new sites.

get_stub_me_sponsors() was skipped because that will be pulled from the Multi-Event Sponsor posts on Central
in the future.

See #603

#2 @iandunn
5 years ago

Nacin pointed out that r860 won't work because the site's locale won't be set when the site is created.

We could potentially add an input field to the wordcamp post type for the locale, and then set it when the site is created. Or maybe wait until after the site is created and the locale is set before we insert the pages.

Once that's sorted out, we'll need to setup a GlotPress project so that organizers can translate the strings.

#3 @gugaalves
5 years ago

Thanks landunn,

but i think we need to change Custom Post Type slugs too, right?

#4 @iandunn
5 years ago

Ah, you're right, I didn't read the ticket description carefully enough.

#5 @kovshenin
5 years ago

I'm not sure having permalinks structure be constructed via translation files is a great idea. If anything changes we have to flush rules for every site that's affected, which means old links will change and it won't be easy to catch everything with redirects.

As an example, consider we localize the "sponsor" slug in ru_RU, a contributor then submits a translation for Russian, where the "sponsor" slug is changed to "спонсоры". This creates three problems:

  1. No way to opt-out of cyrillic in URLs per WordCamp in one locale
  2. All rewrite rules on previous WordCamps must be flushed, leading to
  3. All previous WordCamps that linked to the "sponsor" slug will now have a bunch of 404s

The other option I could think of is to provide a "sponsor base" option, much like "category base" in core, or the topics and forums slugs in bbPress.

#6 @gugaalves
5 years ago

So great solution @kovshenin.

It would be nice if, in addition, a warning after the first login saying that it must be configured, and if it's changed again later a 301 redirect could be done from the old URL to the new one, avoiding problems with by search engines showing a 404 url.

#7 @iandunn
2 years ago

  • Priority changed from normal to low
Note: See TracTickets for help on using tickets.