Use ICU number/plural formatting

This commit is contained in:
Jamie Kyle
2023-04-03 12:03:00 -07:00
committed by GitHub
parent aba8882d0a
commit da24cc5e95
30 changed files with 254 additions and 222 deletions

View File

@@ -38,13 +38,11 @@ describe('setupI18n', () => {
);
});
it('returns a modern icu message formatted', () => {
const actual = i18n('icu:ProfileEditor--info', {
learnMore: 'LEARN MORE',
});
assert.equal(
actual,
'Your profile is encrypted. Your profile and changes to it will be visible to your contacts and when you start or accept new chats. LEARN MORE'
const actual = i18n(
'icu:AddUserToAnotherGroupModal__toast--adding-user-to-group',
{ contact: 'CONTACT' }
);
assert.equal(actual, 'Adding CONTACT...');
});
});
@@ -72,7 +70,11 @@ describe('setupI18n', () => {
describe('isLegacyFormat', () => {
it('returns false for new format', () => {
assert.isFalse(i18n.isLegacyFormat('icu:ProfileEditor--info'));
assert.isFalse(
i18n.isLegacyFormat(
'icu:AddUserToAnotherGroupModal__toast--adding-user-to-group'
)
);
assert.isTrue(i18n.isLegacyFormat('softwareAcknowledgments'));
});
});