about summary refs log tree commit diff
path: root/app/lib/themes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/themes.rb')
-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' => [] }