Skip to content

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
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