Skip to content

Commit

Permalink
i18n: Fix passing the locale when fetching alphabetic tags on /tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jornp committed Aug 29, 2024
1 parent ffa0ca1 commit f56c3c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/reader/tags/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ export const fetchAlphabeticTags = ( context: PageJSContext, next: ( e?: Error )
}
performanceMark( context as PartialContext, 'fetchAlphabeticTags' );

const currentUserLocale = getCurrentUserLocale( context.store.getState() );
const currentUserLocale = getCurrentUserLocale( context.store.getState() ) || context.lang;

context.queryClient
.fetchQuery( {
queryKey: [ 'alphabetic-tags', currentUserLocale ],
queryFn: () => {
return wpcom.req.get( '/read/tags/alphabetic', {
apiVersion: '1.2',
lang: currentUserLocale, // Note: undefined will be omitted by the query string builder.
locale: currentUserLocale, // Note: undefined will be omitted by the query string builder.
} );
},
staleTime: 86400000, // 24 hours
Expand Down

0 comments on commit f56c3c5

Please sign in to comment.