changeset 158:72e3837815d3

Fix mismatched regexes in build-time locale file discovery Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-August/024549.html
author Andrew Azores <aazores@redhat.com>
date Thu, 17 Aug 2017 10:38:25 -0400
parents bf297ee94d9d
children 2b1339f22184
files src/app/app.module.js
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/app.module.js	Wed Aug 16 12:47:29 2017 -0400
+++ b/src/app/app.module.js	Thu Aug 17 10:38:25 2017 -0400
@@ -79,9 +79,9 @@
       .fallbackLanguage('en')
       .determinePreferredLanguage();
 
-    let req = require.context('./', true, /\.locale\.yaml/);
+    let req = require.context('./', true, /\/([a-z]{2})\.locale\.yaml$/);
     req.keys().map(key => {
-      let lang = /([a-z]+)\.locale\.yaml/.exec(key)[1];
+      let lang = /\/([a-z]{2})\.locale\.yaml$/.exec(key)[1];
       let translations = req(key);
       $translateProvider.translations(lang, translations);
     });