@@ -72,7 +72,7 @@ const parseVars = (pluralForm) => {
72
72
class PluralForms {
73
73
static empty ( length ) { return new PluralForms ( new Array ( length ) . fill ( '' ) ) ; }
74
74
75
- static fromVueI18n ( path , message ) {
75
+ static fromVueI18n ( key , message ) {
76
76
const forms = message . split ( ' | ' ) ;
77
77
if ( forms . length > 2 )
78
78
logThenThrow ( message , 'a pluralized message must have exactly two forms' ) ;
@@ -83,10 +83,10 @@ class PluralForms {
83
83
const badWhitespace = form . match ( / ^ \s + | \s + $ | \s \s + / ) ;
84
84
if ( badWhitespace ) {
85
85
const badLength = badWhitespace [ 0 ] . length ;
86
- console . error ( `unexpected white space in translation string '${ path } ':` ) ; // eslint-disable-line no-console
86
+ console . error ( `unexpected white space in translation string '${ key } ':` ) ; // eslint-disable-line no-console
87
87
console . error ( ` [${ message } ]` ) ; // eslint-disable-line no-console
88
88
console . error ( ` [${ '' . padStart ( badLength , '^' ) . padStart ( badWhitespace . index + badLength , ' ' ) . padEnd ( message . length , ' ' ) } ]` ) ; // eslint-disable-line no-console
89
- throw new Error ( `unexpected whitespace in message '${ path } ' at index ${ badWhitespace . index } ("${ message } ")` ) ;
89
+ throw new Error ( `unexpected whitespace in message '${ key } ' at index ${ badWhitespace . index } ("${ message } ")` ) ;
90
90
}
91
91
}
92
92
@@ -670,8 +670,8 @@ const rekeyTranslations = (source, translated, transifexPaths) => {
670
670
// Returns the Vue I18n messages for the source locale after converting them to
671
671
// PluralForms objects.
672
672
const readSourceMessages = ( localesDir , filenamesByComponent ) => {
673
- const reviver = ( path , value ) =>
674
- ( typeof value === 'string' ? PluralForms . fromVueI18n ( path , value ) : value ) ;
673
+ const reviver = ( key , value ) =>
674
+ ( typeof value === 'string' ? PluralForms . fromVueI18n ( key , value ) : value ) ;
675
675
676
676
// Read the root messages.
677
677
const messages = parse (
0 commit comments