Skip to content

Commit

Permalink
changeCase should not affect prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
zotune committed Jan 9, 2024
1 parent 66313b9 commit 8fc510f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/Extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ export function generateKeyFromText(text: string, filepath?: string, reuseExisti

const keyPrefix = Config.keyPrefix
if (keyPrefix && keygenStrategy !== 'empty' && keygenStrategy !== 'source')
key = keyPrefix + key
key = changeCase(key, Config.keygenStyle).trim()

key = keyPrefix + key

if (filepath && key.includes('fileName')) {
key = key
.replace('{fileName}', basename(filepath))
.replace('{fileNameWithoutExt}', basename(filepath, extname(filepath)))
}

key = changeCase(key, Config.keygenStyle).trim()

// some symbol can't convert to alphabet correctly, apply a default key to it
if (!key)
key = 'key'
Expand Down

0 comments on commit 8fc510f

Please sign in to comment.