diff --git a/client/src/utils/gettext.test.js b/client/src/utils/gettext.test.js index f919c6f28b..14a677bd79 100644 --- a/client/src/utils/gettext.test.js +++ b/client/src/utils/gettext.test.js @@ -30,8 +30,9 @@ describe('gettext', () => { }); describe('ngettext', () => { - it('should return the first param if Django ngettext is not loaded', () => { - expect(ngettext('One bird', 'Many birds', 2)).toEqual('One bird'); + it('should emulate the Django ngettext function if it is not loaded', () => { + expect(ngettext('One bird', 'Many birds', 1)).toEqual('One bird'); + expect(ngettext('One bird', 'Many birds', 2)).toEqual('Many birds'); }); it('should call the global Django util if loaded', () => { diff --git a/client/src/utils/gettext.ts b/client/src/utils/gettext.ts index c5e5733a97..59f9635261 100644 --- a/client/src/utils/gettext.ts +++ b/client/src/utils/gettext.ts @@ -48,7 +48,7 @@ export function ngettext( return djangoNgettext(singular, plural, count); } - return singular; + return count === 1 ? singular : plural; } /**