(self, path_to_pofile, resource_slug, resource_name, hq_lang_code)
return requests.put(
            url, data=json.dumps(data), auth=self._auth, headers=headers,
        )
Upload translated files

        :param path_to_pofile: path to pofile
        :param resource_slug: resource slug
        :param resource_name: resource name, mostly same as resource slug itself
        :param hq_lang_code: lang code on hq
Upload translated files
Upload translated files
def upload_translation(self, path_to_pofile, resource_slug, resource_name, hq_lang_code):
        """
        Upload translated files

        :param path_to_pofile: path to pofile
        :param resource_slug: resource slug
        :param resource_name: resource name, mostly same as resource slug itself
        :param hq_lang_code: lang code on hq
        """
        target_lang_code = self.transifex_lang_code(hq_lang_code)
        url = "https://www.transifex.com/api/2/project/{}/resource/{}/translation/{}".format(
            self.project, resource_slug, target_lang_code)
        content = open(path_to_pofile, 'r', encoding="utf-8").read()
        headers = {'content-type': 'application/json'}
        data = {
            'name': resource_name, 'slug': resource_slug, 'content': content,
            'i18n_type': 'PO'
        }
        return requests.put(
            url, data=json.dumps(data), auth=self._auth, headers=headers,
        )
def upload_translation ( self , path_to_pofile , resource_slug , resource_name , hq_lang_code ) : target_lang_code = self . transifex_lang_code ( hq_lang_code ) url = "https://www.transifex.com/api/2/project/{}/resource/{}/translation/{}" . format ( self . project , resource_slug , target_lang_code ) content = open ( path_to_pofile , 'r' , encoding = "utf-8" ) . read ( ) headers = { 'content-type' : 'application/json' } data = { 'name' : resource_name , 'slug' : resource_slug , 'content' : content , 'i18n_type' : 'PO' } return requests . put ( url , data = json . dumps ( data ) , auth = self . _auth , headers = headers , )