Translation loader now ignores system files
I was having an issue with habitrpg failing to load when OSX created a .DS_Store file in the locales directory. This code fixes that by ignoring all hidden files (files that start with “.”)
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ var loadTranslations = function(locale){
|
||||
loadTranslations('en');
|
||||
|
||||
fs.readdirSync(path.join(__dirname, "/../node_modules/habitrpg-shared/locales/")).forEach(function(file) {
|
||||
if(file === 'en' || file === 'README.md') return;
|
||||
if(file === 'en' || file === 'README.md' || file.indexOf('.') === 0) return;
|
||||
loadTranslations(file);
|
||||
// Merge missing strings from english
|
||||
_.defaults(translations[file], translations.en);
|
||||
|
||||
Reference in New Issue
Block a user