Hi,
We have a project for which we use two locales (translations): English and Romanian
In Romanian, the decimal separator is comma (1.234,10). Our user’s keyboards are set to English, so entering a dot on the numberpad results in a dot, not a comma.
When our users edit a table, entering 1.20 results in 12 rather than 1.2.
I would see two solutions to this problem:
-
Modify the text entered by the user in the cell, replacing “,” with “.” – don’t know how to do this as I receive a float, not a string.
-
Setting the locale for the column to Romanian. So far I have tried this:
import java.util.Locale
en_locale = java.util.Locale("en")
ro_locale = java.util.Locale("ro")
col_index = 2
comp = event.source.parent.getComponent('tbl_sen')
current_locale = comp.columnAttributesData.getValueAt(2,"locale")
if current_locale != en_locale:
updated_ds = system.dataset.setValue(comp.columnAttributesData, col_index, "locale", en_locale)
comp.columnAttributesData = updated_ds
Doesn’t seem to work. Is the column “locale” read-only? Do you have any suggestions?
Thanks