xrutayisire / react-js-cron

A React cron editor built with antd
https://xrutayisire.github.io/react-js-cron/?path=/docs/reactjs-cron--demo
MIT License
238 stars 105 forks source link

German Locale addition #65

Closed janBock closed 6 months ago

janBock commented 6 months ago

Describe / Is your feature request related to a problem? Please describe. My request is regarding extending the Locale option to include German, similar to how French exists

I have both English and German in my i18n translations, and am keen to have this built into the dropdowns and built-in texts in German, similar to the implementation that exists for French.

xrutayisire commented 6 months ago

Hey,

French locale don't really exist. I made this library so you can integrate with any locale you want.

There is only the DEFAULT_LOCALE_EN that is used internally, but the API is made to extend with every locale. The Storybook give an example because I'm French, but it's not an integrated locale.

You can just do as in the Storybook:

const GERMAN_LOCALE: Locale = {
  <write here your germal locale>
}

<Cron
  locale={GERMAN_LOCALE}
  value={value}
  setValue={setValue}
/>

Storybook example: https://github.com/xrutayisire/react-js-cron/blob/3666e663b5f2b5a37d2907d672493f6a601808dd/src/stories/index.stories.tsx#L1603

janBock commented 6 months ago

Righttt, okay thanks for clarifying. So the translated values would need to be defined like youve done for the french locale in src/stories/constants.stories.ts