[PATCH] [Wok] Fix for filter break for numbers formatted for locale fr-FR

From: Pooja Kulkarni <pkulkark@linux.vnet.ibm.com> This patch fixes the filter breaking issue on numbers formatted as per fr-FR locale, by replacing the non-breaking spaces introduced by the formatting, with breaking spaces. Signed-off-by: Pooja Kulkarni <pkulkark@linux.vnet.ibm.com> --- ui/js/src/wok.utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js index 1fb3c9b..76477fd 100644 --- a/ui/js/src/wok.utils.js +++ b/ui/js/src/wok.utils.js @@ -263,7 +263,11 @@ wok.localeConverters = { }, "number-locale-converter":{ to: function(number){ - return wok.numberLocaleConverter(number, wok.lang.get_locale()); + if (number == null) { + return 'Unknown'; + } + format_value = wok.numberLocaleConverter(number, wok.lang.get_locale()); + return format_value.toString().replace(/\s/g,' '); //replace non-breaking space with breaking space } } } -- 2.1.0

Reviewed-By: Ramon Medeiros <ramonn@br.ibm.com> On 05/26/2016 05:19 AM, pkulkark@linux.vnet.ibm.com wrote:
From: Pooja Kulkarni <pkulkark@linux.vnet.ibm.com>
This patch fixes the filter breaking issue on numbers formatted as per fr-FR locale, by replacing the non-breaking spaces introduced by the formatting, with breaking spaces.
Signed-off-by: Pooja Kulkarni <pkulkark@linux.vnet.ibm.com> --- ui/js/src/wok.utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js index 1fb3c9b..76477fd 100644 --- a/ui/js/src/wok.utils.js +++ b/ui/js/src/wok.utils.js @@ -263,7 +263,11 @@ wok.localeConverters = { }, "number-locale-converter":{ to: function(number){ - return wok.numberLocaleConverter(number, wok.lang.get_locale()); + if (number == null) { + return 'Unknown'; + } + format_value = wok.numberLocaleConverter(number, wok.lang.get_locale()); + return format_value.toString().replace(/\s/g,' '); //replace non-breaking space with breaking space } } }
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com

Reviewed-By: Archana Singh <archus@linux.vent.ibm.com> On 5/26/2016 1:49 PM, pkulkark@linux.vnet.ibm.com wrote:
From: Pooja Kulkarni <pkulkark@linux.vnet.ibm.com>
This patch fixes the filter breaking issue on numbers formatted as per fr-FR locale, by replacing the non-breaking spaces introduced by the formatting, with breaking spaces.
Signed-off-by: Pooja Kulkarni <pkulkark@linux.vnet.ibm.com> --- ui/js/src/wok.utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js index 1fb3c9b..76477fd 100644 --- a/ui/js/src/wok.utils.js +++ b/ui/js/src/wok.utils.js @@ -263,7 +263,11 @@ wok.localeConverters = { }, "number-locale-converter":{ to: function(number){ - return wok.numberLocaleConverter(number, wok.lang.get_locale()); + if (number == null) { + return 'Unknown'; + } + format_value = wok.numberLocaleConverter(number, wok.lang.get_locale()); + return format_value.toString().replace(/\s/g,' '); //replace non-breaking space with breaking space } } }
participants (4)
-
Aline Manera
-
Archana Singh
-
pkulkark@linux.vnet.ibm.com
-
Ramon Medeiros