| Total Complexity | 5 |
| Complexity/F | 5 |
| Lines of Code | 10 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import {Locales} from '../../../' |
||
| 2 | |||
| 3 | export default function translate(lang, str) { |
||
| 4 | var trad = Locales.instance.i18n |
||
| 5 | if(typeof trad[lang] !== 'undefined' && trad[lang] !== null |
||
| 6 | && typeof trad[lang][str] !== 'undefined' && trad[lang][str] !== null) { |
||
| 7 | return trad[lang][str] |
||
| 8 | } |
||
| 9 | return str |
||
| 10 | } |
||
| 11 | |||
| 12 |