Skip to content

Commit

Permalink
feat: Add pluralization to the qualification labels
Browse files Browse the repository at this point in the history
BREAKING CHANGE: getBoundT: With the arrival of pluralization, the return of this function has been updated
The second parameter, to indicate the country, is no longer of String type.

Before, we use this implementation:
```
const t  = getBoundT(lang)
t("translation.key", "fr" )
```

Now please follow the following example:
```
const t  = getBoundT(lang)
t("translation.key", { country: "fr" })
```

For pluralization, just add the `smart_count` option
```
t("translation.key", { country: "fr", smart_count: 2 })
```

The `Items.invoices` translation key has been removed,
its value has been added to the `Items.invoice` key in its plural version.
Please use this new implementation:
```
t("Items.invoice", { smart_count: 2 })
```

The following translation keys are no longer plural by default.
`Items.other_revenue`, `Items.unemployment_benefit`,
`Items.personal_sporting_licence`, `Items.tax_timetable`.
Please use this new implementation:
```
t("translation.key", { smart_count: 2 })
  • Loading branch information
Merkur39 committed Apr 13, 2023
1 parent 0bd7b4b commit 6c27cc3
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 181 deletions.
10 changes: 7 additions & 3 deletions docs/api/cozy-client/modules/models.document.locales.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### getBoundT

**getBoundT**(`lang`): (`label`: `string`, `country?`: `string`) => `string`
**getBoundT**(`lang`): (`label`: `string`, `opts?`: { `country?`: `string` ; `smart_count?`: `number` }) => `string`

*Parameters*

Expand All @@ -20,14 +20,18 @@

`fn`

▸ (`label`, `country?`): `string`
) => string}

▸ (`label`, `opts?`): `string`

*Parameters*

| Name | Type |
| :------ | :------ |
| `label` | `string` |
| `country?` | `string` |
| `opts?` | `Object` |
| `opts.country?` | `string` |
| `opts.smart_count?` | `number` |

*Returns*

Expand Down
169 changes: 84 additions & 85 deletions packages/cozy-client/src/models/document/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,98 +19,97 @@
"qualified_ok": "You just have successfully described your file! "
},
"items": {
"accommodation_proof": "Proof of accommodation",
"appliance_invoice": "Appliance invoice",
"accommodation_proof": "Proof of accommodation |||| Proof of accommodations",
"appliance_invoice": "Appliance invoice |||| Appliance invoices",
"bank_details": "IBAN",
"bank_statement": "Bank statement",
"birth_certificate": "Birth certificate",
"building_permit": "Building permit",
"caf": "Social benefit rate",
"car_insurance": "Car insurance certificate",
"citizen_registration_certificate": "Certificate of citizen registration",
"diploma": "Diploma",
"divorce": "Divorce",
"driver_license": "Driving license",
"electoral_card": "Electoral card",
"employment_center_certificate": "Employment center certificate",
"energy_contract": "Energy provider contract",
"energy_invoice": "Energy invoice",
"family_record_book": "Family record book",
"bank_statement": "Bank statement |||| Bank statements",
"birth_certificate": "Birth certificate |||| Birth certificates",
"building_permit": "Building permit |||| Building permits",
"caf": "Social benefit rate |||| Social benefit rates",
"car_insurance": "Car insurance certificate |||| Car insurance certificates",
"citizen_registration_certificate": "Certificate of citizen registration |||| Certificates of citizen registration",
"diploma": "Diploma |||| Diplomas",
"divorce": "Divorce |||| Divorces",
"driver_license": "Driving license |||| Driving licenses",
"electoral_card": "Electoral card |||| Electoral cards",
"employment_center_certificate": "Employment center certificate |||| Employment center certificates",
"energy_contract": "Energy provider contract |||| Energy provider contracts",
"energy_invoice": "Energy invoice |||| Energy invoices",
"family_record_book": "Family record book |||| Family record books",
"family": "Family",
"fidelity_card": "Fidelity card",
"gradebook": "Gradebook",
"grocery_invoice": "Grocery invoice",
"health_book": "Health book",
"health_certificate": "Health/Vaccination certificate",
"health_insurance_card": "Insurance card",
"health_invoice": "Health invoice",
"fidelity_card": "Fidelity card |||| Fidelity cards",
"gradebook": "Gradebook |||| Gradebooks",
"grocery_invoice": "Grocery invoice |||| Grocery invoices",
"health_book": "Health book |||| Health books",
"health_certificate": "Health/Vaccination certificate |||| Health/Vaccination certificates",
"health_insurance_card": "Insurance card |||| Insurance cards",
"health_invoice": "Health invoice |||| Health invoices",
"health": "Health",
"home": "Home",
"house_insurance": "Home insurance",
"house_sale_agreeement": "House sale agreement",
"identity_photo": "Identity photo",
"house_insurance": "Home insurance |||| Home insurances",
"house_sale_agreeement": "House sale agreement |||| House sale agreements",
"identity_photo": "Identity photo |||| Identity photos",
"identity": "Identity",
"invoice": "Invoice",
"invoices": "Invoices",
"isp_invoice": "ISP invoice",
"large_family_card": " Large Family Card",
"lease": "Lease",
"library_card": "library card",
"loan_agreement": "Loan agreement",
"mechanic_invoice": "Repair bill",
"motivation_letter": "Motivation letter",
"national_health_insurance_card": "National health insurance card",
"national_health_insurance_right_certificate": "National health insurance right certificate",
"national_id_card": "ID card",
"other_activity_document": "Other sports document",
"other_bank_document": "Other banking document",
"other_family_document": "Other family document",
"other_health_document": "Other health document",
"other_house_document": "Other house document",
"other_identity_document": "Other document of identity",
"other_invoice": "Other invoice",
"other_revenue": "Other revenues",
"other_tax_document": "Other tax document",
"other_transport_document": "Other transport document",
"other_work_document": "Other work document",
"invoice": "Invoice |||| Invoices",
"isp_invoice": "ISP invoice |||| ISP invoices",
"large_family_card": " Large Family Card |||| Large Family Cards",
"lease": "Lease |||| Leases",
"library_card": "library card |||| library cards",
"loan_agreement": "Loan agreement |||| Loan agreements",
"mechanic_invoice": "Repair bill |||| Repair bills",
"motivation_letter": "Motivation letter |||| Motivation letters",
"national_health_insurance_card": "National health insurance card |||| National health insurance cards",
"national_health_insurance_right_certificate": "National health insurance right certificate |||| National health insurance right certificates",
"national_id_card": "ID card |||| ID cards",
"other_activity_document": "Other sports document |||| Other sports documents",
"other_bank_document": "Other banking document |||| Other banking documents",
"other_family_document": "Other family document |||| Other family documents",
"other_health_document": "Other health document |||| Other health documents",
"other_house_document": "Other house document |||| Other house documents",
"other_identity_document": "Other document of identity |||| Other documents of identity",
"other_invoice": "Other invoice |||| Other invoices",
"other_revenue": "Other revenue |||| Other revenues",
"other_tax_document": "Other tax document |||| Other tax documents",
"other_transport_document": "Other transport document |||| Other transport documents",
"other_work_document": "Other work document |||| Other work documents",
"others": "Others",
"pacs": "Civil union",
"passport": "Passeport",
"pay_sheet": "Pay sheet",
"payment_proof_family_allowance": "family allowance payment proof",
"pension": "Pension",
"personal_sporting_licence": "Sporting licence",
"phone_invoice": "Phone invoice",
"pregnancy_medical_certificate": "Certificate of pregnancy",
"prescription": "Prescription",
"real_estate_tax": "Real estate tax",
"receipt": "Receipt",
"rent_receipt": "Rent receipt",
"residence_permit": "Residence permit",
"restaurant_invoice": "Restaurant invoice",
"resume": "Resume",
"school_attendance_certificate": "Certificate of school attendance",
"school_insurance_certificate": "Certificate of school insurance",
"single_parent_benefit": "Single parent benefit",
"student_card": "Student card",
"tax_notice": "Tax notice",
"tax_return": "Tax return",
"tax_timetable": "Payment Plans Installment Agreements",
"technical_diagnostic_record": "Technical diagnostic record",
"telecom_invoice": "Telecom invoice",
"transport_card": "Transport card",
"transport_invoice": "Transport invoice",
"pacs": "Civil union |||| Civil unions",
"passport": "Passeport |||| Passeports",
"pay_sheet": "Pay sheet |||| Pay sheets",
"payment_proof_family_allowance": "family allowance payment proof |||| family allowance payment proofs",
"pension": "Pension |||| Pensions",
"personal_sporting_licence": "Sporting licence |||| Sporting licences",
"phone_invoice": "Phone invoice |||| Phone invoices",
"pregnancy_medical_certificate": "Certificate of pregnancy |||| Certificates of pregnancy",
"prescription": "Prescription |||| Prescriptions",
"real_estate_tax": "Real estate tax |||| Real estate taxes",
"receipt": "Receipt |||| Receipts",
"rent_receipt": "Rent receipt |||| Rent receipts",
"residence_permit": "Residence permit |||| Residence permits",
"restaurant_invoice": "Restaurant invoice |||| Restaurant invoices",
"resume": "Resume |||| Resumes",
"school_attendance_certificate": "Certificate of school attendance |||| Certificates of school attendance",
"school_insurance_certificate": "Certificate of school insurance |||| Certificates of school insurance",
"single_parent_benefit": "Single parent benefit |||| Single parent benefits",
"student_card": "Student card |||| Student cards",
"tax_notice": "Tax notice |||| Tax notices",
"tax_return": "Tax return |||| Tax returns",
"tax_timetable": "Payment Plans Installment Agreement |||| Payment Plans Installment Agreements",
"technical_diagnostic_record": "Technical diagnostic record |||| Technical diagnostic records",
"telecom_invoice": "Telecom invoice |||| Telecom invoices",
"transport_card": "Transport card |||| Transport cards",
"transport_invoice": "Transport invoice |||| Transport invoices",
"transport": "Transport",
"unemployment_benefit": "Unemployment benefit",
"unfit_for_habitation_declaration": "Declaration of unfit for habitation",
"vehicle_registration": "Vehicle registration",
"water_invoice": "Water invoice",
"web_service_invoice": "Web service invoice",
"wedding": "Wedding contract",
"work_contract": "Work contract",
"work_disability_recognition": "Recognition of disability",
"work_invoice": "Work invoice",
"work_quote": "Work quote",
"unemployment_benefit": "Unemployment benefit |||| Unemployment benefits",
"unfit_for_habitation_declaration": "Declaration of unfit for habitation |||| Declarations of unfit for habitation",
"vehicle_registration": "Vehicle registration |||| Vehicle registrations",
"water_invoice": "Water invoice |||| Water invoices",
"web_service_invoice": "Web service invoice |||| Web service invoices",
"wedding": "Wedding contract |||| Wedding contracts",
"work_contract": "Work contract |||| Work contracts",
"work_disability_recognition": "Recognition of disability |||| Recognitions of disability",
"work_invoice": "Work invoice |||| Work invoices",
"work_quote": "Work quote |||| Work quotes",
"work_study": "Work & Study"
},
"attributes":{
Expand Down
Loading

0 comments on commit 6c27cc3

Please sign in to comment.