Skip to content

Commit

Permalink
Merge branch 'janlazo-translate-nothis'
Browse files Browse the repository at this point in the history
  • Loading branch information
kemar committed Jul 7, 2020
2 parents 5df121e + b5379ce commit 5bf9507
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let _config = {
}
let _translations = {}

export default {
const translate = {

/*
* Get the translated string from the translation.json file generated by easygettext.
Expand Down Expand Up @@ -118,7 +118,7 @@ export default {
* @return {String} The translated string
*/
'gettext': function (msgid) {
return this.getTranslation(msgid)
return translate.getTranslation(msgid)
},

/*
Expand All @@ -131,7 +131,7 @@ export default {
* @return {String} The translated string
*/
'pgettext': function (context, msgid) {
return this.getTranslation(msgid, 1, context)
return translate.getTranslation(msgid, 1, context)
},

/*
Expand All @@ -146,7 +146,7 @@ export default {
* @return {String} The translated string
*/
'ngettext': function (msgid, plural, n) {
return this.getTranslation(msgid, n, null, plural)
return translate.getTranslation(msgid, n, null, plural)
},

/*
Expand All @@ -162,7 +162,7 @@ export default {
* @return {String} The translated string
*/
'npgettext': function (context, msgid, plural, n) {
return this.getTranslation(msgid, n, context, plural)
return translate.getTranslation(msgid, n, context, plural)
},

/*
Expand All @@ -183,3 +183,5 @@ export default {
},

}

export default translate

0 comments on commit 5bf9507

Please sign in to comment.