This is a migrated thread and some comments may be shown as answers.

Kendo UI React NumericTextBox set culture

4 Answers 240 Views
Integration with other JS libraries
This is a migrated thread and some comments may be shown as answers.
Vitali
Top achievements
Rank 1
Vitali asked on 09 Jan 2018, 02:06 PM

How does one set the culture of the numerictextbox component (or global for the entire react app for instance)?

I tried this:

<NumericTextBox culture='nl-NL' decimals={2} format='c2' min={0} round={false} spinners={false}/>

But this still shows the dollar sign and uses '.' as the decimal seperator instead of ','.

No errors, but doesn't work.

 

4 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Jan 2018, 06:58 AM
Hello, Vitali,

In order to change the culture, the corresponding culture file has to be loaded:

https://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-culture

I made an example of the React wrapper and the culture was successfully changed to "de-DE":

http://dojo.telerik.com/EtIVA

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vitali
Top achievements
Rank 1
answered on 11 Jan 2018, 09:03 AM

Thanks,

but how does one do this, when using imports/webpack.

When I add the extra script tag in the html file, it throws an error that kendo is not defined (which is 

logical, as those scripts are not yet loaded, because the bundle is not yet loaded).

 

Hope that makes sense ;-)

0
Stefan
Telerik team
answered on 12 Jan 2018, 11:44 AM
Hello, Vitali,

In a scenario where a loaded such as Webpack is used the culture can be imported from the NPM package:

import '@progress/kendo-ui/js/cultures/kendo.culture.de-DE.js';

Once I imported the package, the widget culture was changed as expected.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vitali
Top achievements
Rank 1
answered on 15 Jan 2018, 12:42 PM
Thanks, works now !
Tags
Integration with other JS libraries
Asked by
Vitali
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Vitali
Top achievements
Rank 1
Share this question
or