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

Translations Not Working For validation messages from ValidationMessages module #3360

Open
aaronskiba opened this issue Dec 5, 2023 · 1 comment
Assignees

Comments

@aaronskiba
Copy link
Contributor

aaronskiba commented Dec 5, 2023

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

  • v4.1.1

Expected behaviour:

  • Validation messages should render in the same language that is selected within the app.

Actual behaviour:

  • Validation messages where a message: argument is provided (e.g. validates :text, presence: { message: QUESTION_TEXT_PRESENCE_MESSAGE } only appear to render in the default language.
  • When an attribute name is included in a validation message, its name is always in the default language.

Steps to reproduce:

  1. Select a non-default language
  2. Perform any action that triggers a validation messages where a message: argument is provided
  3. Observe the rendered validation message.

Screenshots of some rendered validation messages when the 'Français (CA)' language is selected:

Screenshot 2023-12-05 at 11 18 08 AM
Screenshot 2023-12-05 at 11 19 53 AM
Screenshot 2023-12-05 at 11 27 11 AM

@aaronskiba
Copy link
Contributor Author

aaronskiba commented Dec 5, 2023

Translations of attribute names can be enabled in config/locales/en.yml 4.5 Translations for Active Record Models.

Our validation message translations could be handled in config/locales/en.yml as well: 4.5.1 Error Message Scopes

@aaronskiba aaronskiba self-assigned this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant