Hello everyone,
We are facing an issue with Arabic numbers in the UI. Essentially Arabic numbers are being rendered when the user’s locale is set to Arabic and that’s creating an issue in some places when the text-line is expecting a number, please check attached screenshot below
This is preventing users from updating records until they manually type the number again in English (even if what they are updating in the record is something else not the number field). So is there a way to override this globally so that numbers still show in English everywhere even when the locale is set to Arabic? This is to standardize English numbers everywhere
I have investigated different macros and L10nFacadeImpl and came to realize that format()
from l10n is being called at the root and there only the user’s locale is being passed (Same is happening with formatCurrency() where the user’s locale is being passed to it) code below
@Override
public String format(Object value, String format) {
return this.format(value, format, getLocale(), getTimeZone());
}
@Override
public String format(Object value, String format, Locale locale, TimeZone tz) {
if (value == null) return "";
if (locale == null) locale = getLocale();
if (tz == null) tz = getTimeZone();
Class<?> valueClass = value.getClass();
if (valueClass == String.class) return (String) value;
if (valueClass == Timestamp.class) return formatTimestamp((Timestamp) value, format, locale, tz);
if (valueClass == java.util.Date.class) return formatTimestamp((java.util.Date) value, format, locale, tz);
if (valueClass == java.sql.Date.class) return formatDate((Date) value, format, locale, tz);
if (valueClass == Time.class) return formatTime((Time) value, format, locale, tz);
// this one needs to be instanceof to include the many sub-classes of Number
if (value instanceof Number) return formatNumber((Number) value, format, locale);
// Calendar is an abstract class, so must use instanceof here as well
if (value instanceof Calendar) return formatDateTime((Calendar) value, format, locale, tz);
// support formatting of Map and Collection using JSON
if (value instanceof Map || value instanceof Collection) {
String json = JsonOutput.toJson(value);
return (json.length() > 128) ? JsonOutput.prettyPrint(json) : json;
}
return value.toString();
}
I appreciate your help!