File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,19 @@ function getPossibleUiStrings(possibleUiStringFilePaths) {
165165}
166166
167167function main ( ) {
168+ // We use a convention where a message's ID matches its value; a mismatch
169+ // is probably accidental.
170+ const mismatchedMessageEntries = Object . entries ( messages_en ) . filter (
171+ ( [ messageId , message ] ) => messageId !== message ,
172+ ) ;
173+ if ( mismatchedMessageEntries . length > 0 ) {
174+ console . error (
175+ 'Each message in static/translations/messages_en.json should match its ID, but some do not:' ,
176+ ) ;
177+ console . error ( mismatchedMessageEntries ) ;
178+ process . exit ( 1 ) ;
179+ }
180+
168181 // Mobile's style is to use curly quotes. They look nicer, but also: since
169182 // v3, react-intl uses the single straight quote as an escape character:
170183 // https://formatjs.io/docs/intl-messageformat/#features
You can’t perform that action at this time.
0 commit comments