diff --git a/app/javascript/helpers/formUtils.ts b/app/javascript/helpers/formUtils.ts index 99534774..fe4eade6 100644 --- a/app/javascript/helpers/formUtils.ts +++ b/app/javascript/helpers/formUtils.ts @@ -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 = ( diff --git a/app/javascript/translations/index.js.erb b/app/javascript/translations/index.js.erb index 8e918221..24d457bc 100644 --- a/app/javascript/translations/index.js.erb +++ b/app/javascript/translations/index.js.erb @@ -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 \ No newline at end of file diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index 90ec896e..988f9289 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -3,4 +3,9 @@ I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.yml')] I18n.available_locales = [:en, :it, :de, :fr, :ru, :es, :vi] -I18n.default_locale = :en \ No newline at end of file +I18n.default_locale = :en + +# Custom pluralization rules +# Those must be mirrored in app/javascript/translations/index.js.erb +I18n::Backend::Simple.include(I18n::Backend::Pluralization) +I18n.backend.store_translations :vi, i18n: { plural: { rule: lambda { |n| :other } } } # Vietnamese \ No newline at end of file diff --git a/config/locales/backend/backend.vi.yml b/config/locales/backend/backend.vi.yml index 9d1ce71d..e6d6ad0e 100644 --- a/config/locales/backend/backend.vi.yml +++ b/config/locales/backend/backend.vi.yml @@ -49,26 +49,19 @@ vi: activerecord: models: board: - one: 'Bảng' - other: 'Các bảng' + other: 'Bảng' comment: - one: 'Bình luận' - other: 'Các bình luận' + other: 'Bình luận' like: - one: 'Phiếu bầu' - other: 'Các phiếu bầu' + other: 'Phiếu bầu' o_auth: - one: 'Xác thực OAuth' - other: 'Các xác thực OAuth' + other: 'Xác thực OAuth' post_status: - one: 'Trạng thái' - other: 'Các trạng thái' + other: 'Trạng thái' post: - one: 'Bài viết' - other: 'Các bài viết' + other: 'Bài viết' user: - one: 'Người dùng' - other: 'Các người dùng' + other: 'Người dùng' attributes: board: name: 'Tên' @@ -121,7 +114,7 @@ vi: root_board_id: 'Trang gốc' show_roadmap_in_header: 'Hiển thị liên kết lộ trình trên tiêu đề' collapse_boards_in_header: 'Thu gọn các bảng trong tiêu đề' - custom_css: 'Custom CSS' + custom_css: 'Tùy chỉnh CSS' user: email: 'Email' full_name: 'Họ và tên' @@ -136,4 +129,4 @@ vi: blank: 'không thể để trống' taken: 'đã tồn tại' too_short: 'quá ngắn (ít nhất %{count} ký tự)' - too_long: 'quá dài (tối đa %{count} ký tự)' \ No newline at end of file + too_long: 'quá dài (tối đa %{count} ký tự)' diff --git a/config/locales/de.yml b/config/locales/de.yml index 028485e6..f31e240f 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -69,7 +69,7 @@ de: page_title: 'Deinen Feedback-Bereich erstellen' step1: title: '1. Benutzerkonto erstellen' - email_auth: 'Sign up with email' + email_auth: 'Mit E-Mail registrieren' step2: title: '2. Feedbackbereich erstellen' create_button: 'Feedbackbereich erstellen' diff --git a/config/locales/devise/devise.vi.yml b/config/locales/devise/devise.vi.yml index 0b7a8de0..1e3ca4f9 100644 --- a/config/locales/devise/devise.vi.yml +++ b/config/locales/devise/devise.vi.yml @@ -59,5 +59,4 @@ vi: not_found: "không tìm thấy" not_locked: "không bị khóa" not_saved: - one: "1 lỗi đã ngăn %{resource} này khỏi việc lưu:" - other: "%{count} lỗi đã ngăn %{resource} này khỏi việc lưu:" \ No newline at end of file + other: "%{count} lỗi đã ngăn %{resource} này khỏi việc lưu:" diff --git a/config/locales/es.yml b/config/locales/es.yml index 91426419..100546f1 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -69,7 +69,7 @@ es: page_title: 'Create your feedback space' step1: title: '1. Create user account' - email_auth: 'Sign up with email' + email_auth: 'Registrar con e-mail' step2: title: '2. Create feedback space' create_button: 'Create feedback space' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 0c478642..8c99d646 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -69,7 +69,7 @@ fr: page_title: 'Créez votre espace de feedback' step1: title: '1. Créer un compte utilisateur' - email_auth: 'S''inscrire par e-mail' + email_auth: 'S´inscrire avec une adresse e-mail' step2: title: '2. Créer un espace de feedback' create_button: 'Créer un espace de feedback' diff --git a/config/locales/it.yml b/config/locales/it.yml index dda4c84d..3824bf38 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -69,7 +69,7 @@ it: page_title: 'Crea il tuo spazio di feedback' step1: title: '1. Crea account utente' - email_auth: 'Sign up with email' + email_auth: 'Registrati con indirizzo email' step2: title: '2. Crea spazio di feedback' create_button: 'Crea spazio feedback' diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 9cf51d97..507325af 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -65,7 +65,7 @@ ja: page_title: 'Create your feedback space' step1: title: '1. Create user account' - email_auth: 'Sign up with email' + email_auth: 'Register with email' step2: title: '2. Create feedback space' create_button: 'Create feedback space' diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 31858560..d8fe2b39 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -65,7 +65,7 @@ ko: page_title: 'Create your feedback space' step1: title: '1. Create user account' - email_auth: 'Sign up with email' + email_auth: 'Register with email' step2: title: '2. Create feedback space' create_button: 'Create feedback space' diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 946b27a9..5a5a41ec 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -69,7 +69,7 @@ nl: page_title: 'Create your feedback space' step1: title: '1. Create user account' - email_auth: 'Sign up with email' + email_auth: 'Register with email' step2: title: '2. Create feedback space' create_button: 'Create feedback space' diff --git a/config/locales/pt.yml b/config/locales/pt.yml index f69b8712..baf03c52 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -69,7 +69,7 @@ pt: page_title: 'Crie seu espaço de comentário' step1: title: 'Criar conta de usuário' - email_auth: 'Sign up with email' + email_auth: 'Cadastrar com e-mail' step2: title: '2. Criar espaço de feedback' create_button: 'Criar espaço de feedback' diff --git a/config/locales/ru.yml b/config/locales/ru.yml index a1a72762..ae96eaf9 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -77,7 +77,7 @@ ru: page_title: 'Создайте область обратной связи' step1: title: '1. Создание учетной записи пользователя' - email_auth: 'Sign up with email' + email_auth: 'Регистрация по электронной почте' step2: title: '2. Создать область обратной связи' create_button: 'Создать область обратной связи' diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 71048171..80eea7af 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -34,7 +34,6 @@ vi: change_password: 'Đổi mật khẩu' password_help: 'Ít nhất %{count} ký từ' comments_number: - one: '1 bình luận' other: '%{count} bình luận' no_status: 'Không có trạng thái' loading: 'Đang tải...' @@ -57,13 +56,10 @@ vi: datetime: now: 'Vừa xong' minutes: - one: '1 phút trước' other: '%{count} phút trước' hours: - one: '1 giờ trước' other: '%{count} giờ trước' days: - one: '1 ngày trước' other: '%{count} ngày trước' signup: page_title: 'Tạo không gian phản hồi của bạn' @@ -222,4 +218,4 @@ vi: title_edit: 'Chỉnh sửa OAuth Provider' subtitle_oauth_config: 'Cấu hình OAuth' subtitle_user_profile_config: 'Cấu hình Thông tin người dùng' - client_secret_help: 'đã ẩn vì mục đích bảo mật' \ No newline at end of file + client_secret_help: 'đã ẩn vì mục đích bảo mật' diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8cccf7ef..6222db2c 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -65,7 +65,7 @@ zh-CN: page_title: 'Create your feedback space' step1: title: '1. Create user account' - email_auth: 'Sign up with email' + email_auth: 'Register with email' step2: title: '2. Create feedback space' create_button: 'Create feedback space'