def download_xliff(request, path_obj): if path_obj.translation_project.project.localfiletype == 'xlf': return text = _('Translate offline') tooltip = _('Download XLIFF file for offline translation') href = dispatch.export(path_obj.pootle_path, 'xlf') return { 'icon': 'icon-translate-download', 'href': href, 'text': text, 'tooltip': tooltip, }
def download_xliff(request, path_obj): if path_obj.translation_project.project.localfiletype == 'xlf': return if path_obj.name.startswith("pootle-terminology"): return text = _("Download XLIFF") tooltip = _('Download XLIFF file for offline translation') href = dispatch.export(path_obj.pootle_path, 'xlf') return { 'icon': 'icon-download', 'href': href, 'text': text, 'tooltip': tooltip, }
def download_source(request, path_obj, **kwargs): href = None if path_obj.name.startswith("pootle-terminology"): text = _("Download XLIFF") tooltip = _("Download file in XLIFF format") href = dispatch.export(path_obj.pootle_path, 'xlf') elif path_obj.translation_project.project.is_monolingual(): text = _('Export') tooltip = _('Export translations') else: text = _('Download') tooltip = _('Download file') return { 'icon': 'icon-download', 'href': href or l('/download%s' % path_obj.pootle_path), 'text': text, 'tooltip': tooltip, }