Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Conversation

@jjeffryes
Copy link
Contributor

This PR changes the listing details view so the condition is translated in the render function, and unknown conditions are not translated. That allows it to handle listings with conditions that don't match our expected list. I think it's better for users to see the value directly from the data vs. "conditionTypes.SOMETHINGINCAPS".

Closes #1785

@jjeffryes jjeffryes requested a review from rmisio August 8, 2019 14:35
</div>
<% } else if (ob.metadata.contractType === 'PHYSICAL_GOOD') { %>
<div>
<%= ob.polyT('listingDetail.condition', { condition: `<b>${ob.polyT(`conditionTypes.${ob.item.condition.toUpperCase()}`)}</b>` }) %>
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be done natively using the polyglot function by passing in a _ option, e.g:

 <%= ob.polyT('listingDetail.condition', { condition: `<b>${ob.polyT(`conditionTypes.${ob.item.condition.toUpperCase()}`, { _: ob.item.condition })}</b>` }) %>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I completely forgot about the fallback parameter.

@rmisio rmisio merged commit a8ce004 into master Aug 9, 2019
@rmisio rmisio deleted the fixHavenUsedTerm branch August 9, 2019 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop loading Haven listing (Phsyical Good, Used) shows placeholder for Condition value

3 participants