mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 20:12:19 +00:00
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:
parent
29be5d6e3e
commit
49772bb571
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue