/** * Utility function for use in React frontmatter * This function creates a string that will be processed by the frontmatter loader * to convert it into a translation key object */ export const frontmatterTranslate = (key: string, defaultValue: string): string => { const escapedDefaultValue = defaultValue.replace(/'/g, "\\'"); return `frontmatterTranslate('${key}', '${escapedDefaultValue}')`; };