Skip to content

Commit

Permalink
Add support for developer.wordpress.com in localizeUrl (#96655)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlind1 authored Dec 11, 2024
1 parent 0244a1e commit 6470574
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/i18n-utils/src/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type Locale = string;
export const i18nDefaultLocaleSlug: Locale = 'en';
export const localesWithBlog: Locale[] = [ 'en', 'ja', 'es', 'pt', 'fr', 'pt-br' ];
export const localesWithGoBlog: Locale[] = [ 'en', 'pt-br', 'de', 'es', 'fr', 'it' ];
export const localesWithWpcomDeveloperSite: Locale[] = [ 'en', 'es' ];
export const localesWithPrivacyPolicy: Locale[] = [ 'en', 'fr', 'de', 'es' ];
export const localesWithCookiePolicy: Locale[] = [ 'en', 'fr', 'de', 'es' ];
export const localesWithLearn: Locale[] = [ 'en', 'es' ];
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n-utils/src/localize-url.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useLocale, getWpI18nLocaleSlug } from './locale-context';
import {
localesWithBlog,
localesWithGoBlog,
localesWithWpcomDeveloperSite,
localesWithPrivacyPolicy,
localesWithCookiePolicy,
localesToSubdomains,
Expand Down Expand Up @@ -135,6 +136,7 @@ export const urlLocalizationMapping: UrlLocalizationMapping = {
'en.support.wordpress.com': setLocalizedWpComPath( '/support', supportSiteLocales ),
'en.blog.wordpress.com': setLocalizedWpComPath( '/blog', localesWithBlog, /^\/$/ ),
'apps.wordpress.com': prefixLocalizedUrlPath( magnificentNonEnLocales ),
'developer.wordpress.com': prefixLocalizedUrlPath( localesWithWpcomDeveloperSite ),
'en.forums.wordpress.com': setLocalizedWpComPath( '/forums', forumLocales ),
'automattic.com/privacy/': prefixLocalizedUrlPath( localesWithPrivacyPolicy ),
'automattic.com/cookies/': prefixLocalizedUrlPath( localesWithCookiePolicy ),
Expand Down

0 comments on commit 6470574

Please sign in to comment.