You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 18, 2024. It is now read-only.
fbt.plural with showCount: 'no', other plurals will work
--react-native-mode enabled
Running yarn translate-fbts will throw with
yarn run v1.22.19
$ fbt-translate --translations translations/*.json --jenkins > src/translatedFbts.json
/Users/bumbu/Development/fbt/node_modules/nullthrows/nullthrows.js:9
throw error;
^
Error: Expect `token` to not be null as the metadata has variation mask.
at nullthrows (/Users/bumbu/Development/fbt/node_modules/nullthrows/nullthrows.js:7:15)
at new TranslationBuilder (/Users/bumbu/Development/fbt/packages/babel-plugin-fbt/dist/translate/TranslationBuilder.js:109:23)
at /Users/bumbu/Development/fbt/packages/babel-plugin-fbt/dist/bin/translateUtils.js:113:53
at Array.map (<anonymous>)
at processTranslations (/Users/bumbu/Development/fbt/packages/babel-plugin-fbt/dist/bin/translateUtils.js:113:38)
at /Users/bumbu/Development/fbt/packages/babel-plugin-fbt/dist/bin/translateUtils.js:46:12
at Array.map (<anonymous>)
at processFiles (/Users/bumbu/Development/fbt/packages/babel-plugin-fbt/dist/bin/translateUtils.js:44:45)
at Object.<anonymous> (/Users/bumbu/Development/fbt/packages/babel-plugin-fbt/dist/bin/translate.js:147:15)
at Module._compile (node:internal/modules/cjs/loader:1254:14) {
framesToPop: 1
}
Node.js v18.16.0
To Reproduce
Steps to reproduce the behavior:
In demo-app/package.json add --react-native-mode to collect-fbts script
In Example.react.js add fbt(fbt.plural('has', 1, {many: 'have',showCount: 'no'}),'example')
Run
yarn install in main folder
yarn collect-fbts in demo-app
yarn translate-fbts in demo-app
Expected behavior
Should work
Issue
Running yarn collect-fbts will output following json:
And then inside of TranslationBuilder we expect that if manifest has a type, is should also have the token. Imho in this case the type shouldn't be added at all , so the issue is in the yarn collect-fbts step.
🐛 Bug Report
Only reproes with:
fbt.pluralwithshowCount: 'no', other plurals will work--react-native-modeenabledRunning
yarn translate-fbtswill throw withTo Reproduce
Steps to reproduce the behavior:
--react-native-modetocollect-fbtsscriptfbt(fbt.plural('has', 1, {many: 'have',showCount: 'no'}),'example')yarn installin main folderyarn collect-fbtsin demo-appyarn translate-fbtsin demo-appExpected behavior
Should work
Issue
Running
yarn collect-fbtswill output following json:And then inside of
TranslationBuilderwe expect that if manifest has a type, is should also have the token. Imho in this case the type shouldn't be added at all , so the issue is in theyarn collect-fbtsstep.