Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getTranslatable = (path) => {
const translatable = deep.getDeep(supportedLanguages[language], path);
if (translatable === undefined) {
const fallbackTranslatable = deep.getDeep(supportedLanguages[fallbackLanguage], path);
if (fallbackTranslatable === undefined) {
console.warn(`no translatable found for language path ${path}`);
return path;
}
return fallbackTranslatable;
}
return translatable;
};
const getTranslatable = (path) => {
const translatable = deep.getDeep(supportedLanguages[language], path);
if (translatable === undefined) {
const fallbackTranslatable = deep.getDeep(supportedLanguages[fallbackLanguage], path);
if (fallbackTranslatable === undefined) {
console.warn(`no translatable found for language path ${path}`);
return path;
}
return fallbackTranslatable;
}
return translatable;
};