From bfd2a1f09821a958d88682467f311fe179373d26 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Wed, 24 Jun 2015 10:34:42 +0200 Subject: [PATCH] Loads all js locales --- frontend/app/openproject-xls_export-app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/app/openproject-xls_export-app.js b/frontend/app/openproject-xls_export-app.js index e21797821c..d880e0ad44 100644 --- a/frontend/app/openproject-xls_export-app.js +++ b/frontend/app/openproject-xls_export-app.js @@ -1,2 +1,6 @@ -I18n.addTranslations('en', require('../../config/locales/js-en.yml').en); -I18n.addTranslations('de', require('../../config/locales/js-de.yml').de); +// load all js locales +var localeFiles = require.context('../../config/locales', false, /js-[\w|-]{2,5}\.yml$/); +localeFiles.keys().forEach(function(localeFile) { + var locale = localeFile.match(/js-([\w|-]{2,5})\.yml/)[1]; + I18n.addTranslations(locale, localeFiles(localeFile)[locale]); +});