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

Namespace DiscreteFilter value translations by field_key #86

Open
GoGoCarl opened this issue Apr 30, 2018 · 2 comments
Open

Namespace DiscreteFilter value translations by field_key #86

GoGoCarl opened this issue Apr 30, 2018 · 2 comments

Comments

@GoGoCarl
Copy link

Referencing the line here:
https://github.com/digidem/react-mapfilter/blob/next/src/components/FilterPane/DiscreteFilter.js#L153

The formatted value for discrete filters is based on field_label.${value} where value is whatever the actual value of the filter is.

For translation purposes, it would be nice to have that translation key namespaced based on the current filter field, to avoid value collisions when two different filter fields have values with the same token name. So something like field_value.mining would become field_value.happening.mining.

This may or may not be the best solution, just making a suggestion based on the fact that with the current setup, it is not possible for, say, field_value.happening.other and field_value.people.other to display different values, as they would both key in on field_value.other.

@okdistribute
Copy link
Contributor

Thanks @GoGoCarl . Right now I think we're providing this by people overriding the translations object, like this: digidem/mapfilter-desktop@3e8b034

@GoGoCarl
Copy link
Author

GoGoCarl commented May 9, 2018

Hey @Karissa -- yes, the custom translations are now possible by overriding the translations object; however, I was referring to the actual translation id that being keyed in on for this value. I believe this change would need to happen in util/intl_helpers.

Again, not sure of the best approach, and non-critical, but wanted to bring it up.

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

2 participants