Call Client api in discourse

Is it possible to call client API in the discourse on page load? Basically, I want to localize the header and footer based upon client language in our platform. So I am thinking to call API in discourse to get client language and I should be able to localize content. Can this be achieved in discourse?