Add custom pluralization rule for Vietnamese (#279)

This commit is contained in:
Riccardo Graziosi
2024-02-14 11:07:23 +01:00
committed by GitHub
parent 3910c85898
commit 1d5df21301
16 changed files with 30 additions and 35 deletions

View File

@@ -8,7 +8,7 @@ export const getLabel = (
attribute ?
I18n.t(`activerecord.attributes.${entity}.${attribute}`)
:
I18n.t(`activerecord.models.${entity}.one`)
I18n.t(`activerecord.models.${entity}`, { count: 1 })
);
export const getValidationMessage = (

View File

@@ -3,4 +3,6 @@ import I18n from "i18n-js"
I18n.translations = <%= I18n::JS.filtered_translations.to_json %>
I18n.locale = LOCALE
I18n.pluralization["vi"] = function(count) { return ["other"] }
export default I18n