Translate command label on top command dropdown menu (#1792)

* collect i18n with playwright

* Add command label translation

* Normalize i18n object key
This commit is contained in:
Chenlei Hu
2024-12-04 10:19:53 -08:00
committed by GitHub
parent 2caa87d35d
commit 7986aebf27
12 changed files with 317 additions and 24 deletions

View File

@@ -127,3 +127,11 @@ export function getPathDetails(path: string) {
const fullFilename = path.split('/').pop() ?? path
return { directory, fullFilename, ...getFilenameDetails(fullFilename) }
}
/**
* Normalizes a string to be used as an i18n key.
* Replaces dots with underscores.
*/
export function normalizeI18nKey(key: string) {
return key.replace(/\./g, '_')
}