Skip to content

Commit

Permalink
Fix title case transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Nov 17, 2023
1 parent ccd8d2b commit 9ca364d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ const titleCasePostProcessor: PostProcessorModule = {
type: 'postProcessor',
name: 'titleCase',
process: (value: string) => {
return value.charAt(0).toLocaleUpperCase() + value.slice(1).toLowerCase();
return value.replace(/\S\S*/g, (txt) => {
return txt.charAt(0).toLocaleUpperCase() + txt.slice(1).toLowerCase();
});
},
};

Expand Down

1 comment on commit 9ca364d

@vercel
Copy link

@vercel vercel bot commented on 9ca364d Nov 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

feishin – ./

feishin.vercel.app
feishin-jeffvli.vercel.app
feishin-git-development-jeffvli.vercel.app

Please sign in to comment.