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

Consistent translation for BelongsTo Fields across pages #2590

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

lubieniebieski
Copy link
Contributor

This PR addresses an inconsistency in the display of translated labels for BelongsTo fields across different pages in the application.

Currently, if a model (e.g., Customer) has a translation (e.g., Client), the translated label is correctly displayed on the Show page. However, on the Edit and New pages, the original label (e.g., Customer) is displayed instead of the translated one.

This PR ensures that the translated label for BelongsTo fields is consistently displayed across all pages. Specifically, it modifies the belongs_to/_form partial to display the translated label (if available) instead of the original one.

This change enhances the user experience by providing consistent and localized labels across the application.

Currently, if a model (e.g., `Customer`) has a translation (e.g., `Client`),
the translated label is correctly displayed on the Show page. However,
on the Edit and New pages, the original label (e.g., `Customer`) is
displayed instead of the translated one.

This commit ensures that the translated label for `BelongsTo` fields is
consistently displayed across all pages. Specifically, it modifies the
`belongs_to`/`_form` partial to display the translated label (if available)
instead of the original one.

Fixes thoughtbot#625.
@nickcharlton
Copy link
Member

Wonderful, thanks! I just rebased to reword the commit message (and add a reference to the original issue). I'll merge it once the suite passes.

@nickcharlton nickcharlton merged commit a4556b6 into thoughtbot:main Sep 23, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants