Passed
Push — master ( 61dd3f...482d1b )
by greg
01:51
created

src/cli/cms/templates/handlebars/translate-front.js   A

Complexity

Total Complexity 5
Complexity/F 5

Size

Lines of Code 8
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 5
c 1
b 0
f 0
nc 1
mnd 1
bc 2
fnc 1
dl 0
loc 8
rs 10
bpm 2
cpm 5
noi 1
1
export default function translate(lang, str) {
2
  var trad = Locales
0 ignored issues
show
Bug introduced by
The variable Locales seems to be never declared. If this is a global, consider adding a /** global: Locales */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
3
  if(typeof trad[lang] !== 'undefined' && trad[lang] !== null
4
    && typeof trad[lang][str] !== 'undefined' && trad[lang][str] !== null) {
5
    return trad[lang][str]
6
  }
7
  return str
8
}