Skip to content

Commit

Permalink
use keyWithNamespace instead of key in warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
janpaepke authored Nov 28, 2024
1 parent 69a25da commit 808a1be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class i18nTransform extends Transform {
key = key.replace(/\\t/g, '\t')
key = key.replace(/\\\\/g, '\\')
entry.key = key
entry.keyWithNamespace = entry.namespace + this.options.keySeparator + key
entry.keyWithNamespace = entry.namespace + this.options.namespaceSeparator + key
// Add the filename so that we can use it in customValueTemplate
this.keyToFilePaths[key] = this.keyToFilePaths[key] || []
if (!this.keyToFilePaths[key].includes(file.path)) {
Expand Down Expand Up @@ -186,10 +186,10 @@ export default class i18nTransform extends Transform {
if (conflict === 'key') {
this.warn(
`Found translation key already mapped to a map or parent of ` +
`new key already mapped to a string: ${entry.key}`
`new key already mapped to a string: ${entry.keyWithNamespace}`
)
} else if (conflict === 'value') {
this.warn(`Found same keys with different values: ${entry.key}`)
this.warn(`Found same keys with different values: ${entry.keyWithNamespace}`)
}
} else {
uniqueCount[entry.namespace] += 1
Expand Down

0 comments on commit 808a1be

Please sign in to comment.