geostyler / geostyler

Generic Styler for geodata
http://geostyler.org
BSD 2-Clause "Simplified" License
264 stars 59 forks source link

FilterEditor locale translations #1834

Closed fperucic closed 1 year ago

fperucic commented 2 years ago

Bug

Describe the bug FilterEditor strings are not translated, they are hardcoded in english

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Geostyler Demo'
  2. Click on 'Edit filter'
  3. See error

Expected behavior User should see the translated strings

Screenshots image

jansule commented 2 years ago

Thanks for the info @fperucic. Are you planning on providing a fix for this?

fperucic commented 2 years ago

Hi, tried to fix this, but with no luck, due to lack of experience with TypeSript/React.

Fixes to the FilterTree.tsx seem easy for my level, since the locale is already there, but I do not where to start with TextFilterField.tsx and AttributeCombo.tsx

jansule commented 2 years ago

Alright, no problem. The general approach for adding locales is as follows:

  1. import needed files (example)
  2. add locale as default prop (example)
  3. set default value to english locale (example)
  4. add new locales to locales type (example)
  5. add new locales to i18n files (example)
  6. wrap component into localize hoc (example)
  7. use locales where needed (example)

It might help to take a look at ColorField, as this component is very lightweight.

jansule commented 2 years ago

The different filters themselves will now be translated (kudos to @mholthausen #1866).

image

What's still missing is a translation for the Change Filter text, as well as translations for the input placeholders and error texts.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 180 days with no activity. Feel free to unstale it at any time by adding a comment.

jansule commented 1 year ago

This is still relevant.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 180 days with no activity. Feel free to unstale it at any time by adding a comment.

KaiVolland commented 1 year ago

This is solved with #1866