Skip to content

Namespace DiscreteFilter value translations by field_key #86

Description

@GoGoCarl

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions