about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorcwm <chriswmartin@protonmail.com>2017-12-10 15:22:15 -0600
committercwm <chriswmartin@protonmail.com>2017-12-10 15:22:15 -0600
commit072ab191cc47692bad1145a26aa27912aeefb12f (patch)
treed217dc63f36554c7271b1c68a90d8d044640a732 /app/lib
parenteec5d350fdb94fa44c6938ca059166ff3e3e67b3 (diff)
parent26c9b9fa276fd629789fd06f65a5d698b182f67a (diff)
pulled master, moved locale entry to new location
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/themes.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/lib/themes.rb b/app/lib/themes.rb
index 863326e2d..49e9ebbc3 100644
--- a/app/lib/themes.rb
+++ b/app/lib/themes.rb
@@ -15,6 +15,14 @@ class Themes
     Dir.glob(Rails.root.join('app', 'javascript', 'flavours', '*', 'theme.yml')) do |path|
       data = YAML.load_file(path)
       name = File.basename(File.dirname(path))
+      if data['locales']
+        locales = []
+        Dir.glob(File.join(File.dirname(path), data['locales'], '*.{js,json}')) do |locale|
+          localeName = File.basename(locale, File.extname(locale))
+          locales.push(localeName) unless localeName.match(/defaultMessages|whitelist|index/)
+        end
+        data['locales'] = locales
+      end
       if data['pack']
         data['name'] = name
         data['skin'] = { 'default' => [] }