Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/webapp/src/components/Crop/CropHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function CropHeader({ variety, onBackClick }) {
<div className={styles.headerTitleContainer} onClick={onBackClick}>
<Back style={{ verticalAlign: 'text-bottom' }} />
<Title className={clsx(styles.headerTitle, styles.textOverFlowBehaviour)}>
{t(`crop:${crop_translation_key}`)}
{t(`crop:${crop_variety_name}`)}
Copy link
Collaborator

@kathyavini kathyavini Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely works to implement the Jira-described solution! 👍

However, it's just slightly misleading. What it is doing, is calling the translation function t() and saying "look for the translation in the crop file that corresponds to the key {{crop_variety_name}}". Crop variety name is going to be a user-input string (or by default, a translated string corresponding to the crop key) so it definitely doesn't exist as a key in that file.

Instead, I recommend using here {crop_variety_name} directly, without the call to i18n.

Since i18n will anyway default to displaying the key if it doesn't exist, the end result in the UI will be the same, but it's clearer because it's not suggesting that we have a translation for crop:${crop_variety_name} when we don't.

</Title>
</div>
<div className={styles.headerAttributesContainer}>
Expand Down
Loading