     console.log('Translating using Google ... ')
 
     if Meteor.settings.GOOGLE_TRANSLATE_API?
-        res = HTTP.call(
+        HTTP.call(
             "POST",
             googla_url,
             {


                headers:
                    'Authorization': 'Bearer ' + token
            }
        )

        console.log('Bing translate API response:')
        console.log(JSON.stringify(res, null, 2))

        # Data format:
        #  {
        #  ...
        #  "content":
        #  '<string xmlns=
        #      "http://schemas.microsoft.com/2003/10/Serialization/">
        #      Versuch das mal.
        #  </string>'
        #  }
        content = (new xmldom.DOMParser()).parseFromString(res.content)
        content.firstChild.firstChild.data
    else
        console.error('Could not locate BingAccessTokenManager')
        'No translate from Bing available'

_tryTranslation = (methodFunc, methodName, msg, sourceLang, targetLang, _id) ->
    modifier = {}

    try
        translatedMsg = methodFunc(msg, sourceLang, targetLang)
        modifier.translations =
            createMessage(targetLang , translatedMsg, methodName, false)

        ChanslateMessages.update({ _id: _id }, {
            $push: modifier
        })

    catch error
        console.error('Could not translate: ', error)
        modifier.translations =
            createMessage(
                targetLang,
                'Could not translate.',
                methodName,
                true
            )

        ChanslateMessages.update({ _id: _id }, {
            $push: modifier
        })



################################################################
### Exported methods and values
################################################################

@translateAndPopulate = (msg, sourceLang, targetLang, _id) ->
    # TODO (UU): These calls should be made in parallel
    # But doing that for some reason blows the stack.
    _tryTranslation(
        translateUsingGoogle,
        'google',

        _id
    )

@createChanslateMsgDoc = (userName, origMsg, origLang) ->
    {
        userName     : userName
