Skip to content

Commit

Permalink
Fix languages customization
Browse files Browse the repository at this point in the history
  • Loading branch information
tohosaku committed Apr 6, 2020
1 parent 5d6c41c commit bd8fde6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ function upload (type, file, cbs) {

/* String translate function */
function translate (key, variables) {
const lang = languages[language]
if (!lang) throw new Error(`Unknown language ${language}`)
const lang = defaults.languages[defaults.language]
if (!lang) throw new Error(`Unknown language ${defaults.language}`)

let string = lang[key] || languages[default_language][key]
let string = lang[key] || defaults.languages[default_language][key]

if (typeof string === 'undefined') throw new Error(`Unknown translate string ${key}`)

Expand Down

0 comments on commit bd8fde6

Please sign in to comment.