aboutsummaryrefslogtreecommitdiffstats
path: root/i18n/src/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'i18n/src/util.js')
-rw-r--r--i18n/src/util.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/i18n/src/util.js b/i18n/src/util.js
new file mode 100644
index 00000000..82e2a7e4
--- /dev/null
+++ b/i18n/src/util.js
@@ -0,0 +1,7 @@
+exports.findLocaleId = function findLocaleId(str, type) {
+ if (type === 'num') {
+ return (str.match(/^NumberFormatSymbols_(.+)$/) || [])[1];
+ } else if (type == 'datetime') {
+ return (str.match(/^DateTimeSymbols_(.+)$/) || [])[1];
+ }
+}