Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const setSystemLocale = (dispatch, languages, translations) => {
return osLocale().then(locale => {
console.log(`System Locale: ${locale}`);
setActiveLanguageSafely(dispatch, locale, languages, translations);
});
};
templateOption,
themeSet,
type,
allowLocalFiles:
this.args.allowLocalFiles ?? this.conf.allowLocalFiles ?? false,
engine: this.engine.klass,
globalDirectives: {
description: this.args.description ?? this.conf.description,
image: this.args.ogImage ?? this.conf.ogImage,
theme: theme instanceof Theme ? theme.name : theme,
title: this.args.title ?? this.conf.title,
url: this.args.url ?? this.conf.url,
},
html: this.args.html ?? this.conf.html,
jpegQuality: this.args.jpegQuality ?? this.conf.jpegQuality ?? 85,
lang: this.conf.lang || (await osLocale()).replace(/@/g, '-'),
options: this.conf.options || {},
pages: !!(this.args.images || this.conf.images),
watch: (this.args.watch ?? this.conf.watch) || preview || server || false,
}
}
export function getLocale() {
const { RUNG_LOCALE } = process.env;
return resolve(RUNG_LOCALE ? RUNG_LOCALE : osLocale());
}