Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for capitalizing plurals #1564

Open
wants to merge 2 commits into
base: v8.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/unit/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ describe('basic', () => {
assert.strictEqual(i18n.t('message.linkCaseCapitalize'), 'Home Address')
})

it('should translate singular word with the first letter as upper-case', () => {
assert.strictEqual(i18n.tc('plurals.Car', 1), 'Car')
})

it('should translate plural word with the first letter as upper-case', () => {
assert.strictEqual(i18n.tc('plurals.Car', 2), 'Cars')
})

it('should translate link without formatting if modifier is not known.', () => {
assert.strictEqual(i18n.t('message.linkCaseUnknown'), 'home Address')
})
Expand Down
1 change: 1 addition & 0 deletions test/unit/fixture/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default {
underscore: '{helloMsg} world',
plurals: {
car: 'car | cars',
Car: '@.capitalize:car',
apple: 'no apples | one apple | {count} apples',
format: {
named: 'Hello {name}, how are you? | Hi {name}, you look fine',
Expand Down