Re-key all |zero-pluralised translations for Localazy compatibility (#11417)

* Re-key all |zero-pluralised translations for Localazy compatibility

* Add missing interpolation variable

* i18n

* Add test coverage

* Improve coverage
This commit is contained in:
Michael Telatynski 2023-08-16 16:26:21 +01:00 committed by GitHub
parent a5107518b5
commit 6b14ecfdf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 270 additions and 158 deletions

View file

@ -107,11 +107,18 @@ export default class UploadBar extends React.PureComponent<IProps, IState> {
return null;
}
// MUST use var name 'count' for pluralization to kick in
const uploadText = _t("Uploading %(filename)s and %(count)s others", {
filename: this.state.currentFile,
count: this.state.countFiles - 1,
});
let uploadText: string;
if (this.state.countFiles > 1) {
// MUST use var name 'count' for pluralization to kick in
uploadText = _t("Uploading %(filename)s and %(count)s others", {
filename: this.state.currentFile,
count: this.state.countFiles - 1,
});
} else {
uploadText = _t("Uploading %(filename)s", {
filename: this.state.currentFile,
});
}
const uploadSize = fileSize(this.state.currentTotal!);
return (