fix: support German translations for S.Int field validation #605
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Added proper type detection and validation handling for S.Int schema fields to support German localized error messages. When users enter decimal values (e.g., 59.5) in integer fields, they now see the German translation ("Es wird eine ganze Zahl erwartet, tatsächlich: 59.5") instead of the English default.
Why
S.Int fields were losing their type information during metadata creation, causing them to be treated as regular numbers. This prevented:
The fix ensures consistent validation error messaging across different field types and respects the application's language configuration.
How
OmegaFormStuff.ts -
createMetafunction:type: "int"in metadata to distinguish from regular numbersOmegaFormStuff.ts -
generateInputStandardSchemaFromFieldMetafunction:case "int"handler for integer field validationS.Number.annotations({...}).pipe(S.int({...}))OmegaInputVuetify.vue:
inputProps.type === 'int'to v-if condition for number inputstests/IntegerValidation.test.ts (new):
stories/OmegaForm/IntegerValidationGerman.vue:
valuepropertyFiles Changed
packages/vue-components/src/components/OmegaForm/OmegaFormStuff.tspackages/vue-components/src/components/OmegaForm/OmegaInputVuetify.vuepackages/vue-components/__tests__/IntegerValidation.test.ts(new)packages/vue-components/stories/OmegaForm/IntegerValidationGerman.vue