Skip to content

Commit

Permalink
Merge 0aa0b0d into dcdd959
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaniak committed May 15, 2023
2 parents dcdd959 + 0aa0b0d commit 40fa041
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-block-scoped-functions": "^7.16.7",
"@babel/plugin-transform-block-scoping": "^7.18.4",
"@fitbit-sdk/companion-gettext": "^3.2.0",
"@fitbit-sdk/companion-gettext": "~3.3.0",
"@fitbit/bison-i18n": "^1.1.0",
"@fitbit/image-codec-txi": "^1.1.6",
"@fitbit/pngjs": "^3.3.3-fitbit.4",
Expand Down
4 changes: 2 additions & 2 deletions src/ProjectConfiguration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ it('validationErrors() validates all fields', () => {
expect.objectContaining({
category: DiagnosticCategory.Error,
messageText:
'Default language is an invalid language tag: _invalid_. Must be en-US, de-DE, es-ES, fr-FR, it-IT, ja-JP, ko-KR, nl-NL, sv-SE, zh-CN, zh-TW, pt-BR, id-ID, ro-RO, ru-RU, pl-PL, cs-CZ or nb-NO.',
'Default language is an invalid language tag: _invalid_. Must be en-US, de-DE, es-ES, fr-FR, it-IT, ja-JP, ko-KR, nl-NL, sv-SE, zh-CN, zh-TW, pt-BR, id-ID, ro-RO, ru-RU, pl-PL, cs-CZ, nb-NO, da-DK or hi-IN.',
}),
expect.objectContaining({
category: DiagnosticCategory.Error,
Expand Down Expand Up @@ -656,7 +656,7 @@ it('validates the default language is a valid language tag', () => {
expect.objectContaining({
category: DiagnosticCategory.Error,
messageText:
'Default language is an invalid language tag: _really_not_bcp_47_. Must be en-US, de-DE, es-ES, fr-FR, it-IT, ja-JP, ko-KR, nl-NL, sv-SE, zh-CN, zh-TW, pt-BR, id-ID, ro-RO, ru-RU, pl-PL, cs-CZ or nb-NO.',
'Default language is an invalid language tag: _really_not_bcp_47_. Must be en-US, de-DE, es-ES, fr-FR, it-IT, ja-JP, ko-KR, nl-NL, sv-SE, zh-CN, zh-TW, pt-BR, id-ID, ro-RO, ru-RU, pl-PL, cs-CZ, nb-NO, da-DK or hi-IN.',
}),
);
});
Expand Down
2 changes: 2 additions & 0 deletions src/ProjectConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export enum Locales {
'pl-PL' = 'Polish',
'cs-CZ' = 'Czech',
'nb-NO' = 'Norwegian (Bokmål)',
'da-DK' = 'Danish (Denmark)',
'hi-IN' = 'Hindi (India)',
}

const languageTags = Object.keys(Locales);
Expand Down
6 changes: 3 additions & 3 deletions src/__snapshots__/compileTranslations.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PluginError {
exports[`rejects .po files whose names are not acceptable language tags e.po 1`] = `
PluginError {
"fileName": "e.po",
"message": "Translation file e.po has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po or nb-NO.po.",
"message": "Translation file e.po has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po, nb-NO.po, da-DK.po or hi-IN.po.",
"name": "Error",
"plugin": "compileTranslations",
}
Expand All @@ -47,7 +47,7 @@ PluginError {
exports[`rejects .po files whose names are not acceptable language tags en-USA.po 1`] = `
PluginError {
"fileName": "en-USA.po",
"message": "Translation file en-USA.po has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po or nb-NO.po.",
"message": "Translation file en-USA.po has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po, nb-NO.po, da-DK.po or hi-IN.po.",
"name": "Error",
"plugin": "compileTranslations",
}
Expand All @@ -56,7 +56,7 @@ PluginError {
exports[`rejects .po files whose names are not acceptable language tags sl-IT-nedis.po 1`] = `
PluginError {
"fileName": "sl-IT-nedis.po",
"message": "Translation file sl-IT-nedis.po has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po or nb-NO.po.",
"message": "Translation file sl-IT-nedis.po has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po, nb-NO.po, da-DK.po or hi-IN.po.",
"name": "Error",
"plugin": "compileTranslations",
}
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/__snapshots__/companionTranslations.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ exports[`throws if the default language is not found 1`] = `[Error: No translati

exports[`throws when a translation file has multiple msgstr values for the same msgid 1`] = `[Error: msgid "foo" in file "<base>/multiple-msgstr/en-US.po" has multiple msgstr values. This is not supported.]`;
exports[`throws when encountering the badly named file ".po" 1`] = `[Error: Translation file "<base>/bad-name/.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po or nb-NO.po.]`;
exports[`throws when encountering the badly named file ".po" 1`] = `[Error: Translation file "<base>/bad-name/.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po, nb-NO.po, da-DK.po or hi-IN.po.]`;
exports[`throws when encountering the badly named file "a.po" 1`] = `[Error: Translation file "<base>/bad-name/a.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po or nb-NO.po.]`;
exports[`throws when encountering the badly named file "a.po" 1`] = `[Error: Translation file "<base>/bad-name/a.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po, nb-NO.po, da-DK.po or hi-IN.po.]`;
exports[`throws when encountering the badly named file "english.po" 1`] = `[Error: Translation file "<base>/bad-name/english.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po or nb-NO.po.]`;
exports[`throws when encountering the badly named file "english.po" 1`] = `[Error: Translation file "<base>/bad-name/english.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po, nb-NO.po, da-DK.po or hi-IN.po.]`;
exports[`throws when encountering the badly named file "enus.po" 1`] = `[Error: Translation file "<base>/bad-name/enus.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po or nb-NO.po.]`;
exports[`throws when encountering the badly named file "enus.po" 1`] = `[Error: Translation file "<base>/bad-name/enus.po" has a bad name. Translation files must be named en-US.po, de-DE.po, es-ES.po, fr-FR.po, it-IT.po, ja-JP.po, ko-KR.po, nl-NL.po, sv-SE.po, zh-CN.po, zh-TW.po, pt-BR.po, id-ID.po, ro-RO.po, ru-RU.po, pl-PL.po, cs-CZ.po, nb-NO.po, da-DK.po or hi-IN.po.]`;
exports[`throws when multiple files map to the same language 1`] = `[Error: More than one translation file found for language en-US. Found "<base>/language-collision/en-US.po" and "<base>/language-collision/lang/en-US.po".]`;
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,10 @@ __metadata:
languageName: node
linkType: hard

"@fitbit-sdk/companion-gettext@npm:^3.2.0":
version: 3.2.0
resolution: "@fitbit-sdk/companion-gettext@npm:3.2.0"
checksum: 201f45c3593f9f5a34bb93ad499379cbc1e923ab42cfe1a4e6cb6ba7c6a74b1d36e6fc2b94da7ac7c421e55d2d9715b271d0d5ca5ae649a00ec74e1aac6116d7
"@fitbit-sdk/companion-gettext@npm:~3.3.0":
version: 3.3.0
resolution: "@fitbit-sdk/companion-gettext@npm:3.3.0"
checksum: b959924625d3cd855a7b14b7634117db7de7b162440b30fc07f1255c72eba604ec7941b8b36093f8c26809dad3f5c48900548469e2f61d19f2d92fb413d1507e
languageName: node
linkType: hard

Expand Down Expand Up @@ -629,7 +629,7 @@ __metadata:
"@babel/plugin-syntax-dynamic-import": ^7.8.3
"@babel/plugin-transform-block-scoped-functions": ^7.16.7
"@babel/plugin-transform-block-scoping": ^7.18.4
"@fitbit-sdk/companion-gettext": ^3.2.0
"@fitbit-sdk/companion-gettext": ~3.3.0
"@fitbit/bison-i18n": ^1.1.0
"@fitbit/image-codec-txi": ^1.1.6
"@fitbit/pngjs": ^3.3.3-fitbit.4
Expand Down

0 comments on commit 40fa041

Please sign in to comment.