Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Introduction

This product adds a boolean ‘autoTranslateFlashUploadedFiles’ on all BaseFolder based folders, which enables files uploaded with PloneFlashUpload to be automatically translated.

The language the file will be translated into, is determined form the file’s name. The file name must be prefixed or suffixed with a language code, followed (or preceded) with an underscore.

The following are valid file names:

de_factsheet.pdf factsheet_de.pdf

How To Use (Doc Tests):

Lets begin by creating a folder, in which we will upload our files.

>>> folder = self.folder

First, we must set the ‘autoTranslateFlashUploadedFiles’ field on the parent folder

>>> folder.Schema().get('autoTranslateFlashUploadedFiles', True).set(folder, True)

Next, we create a file and call the FlashUploadEvent.

>>> fid = folder.invokeFactory('File', 'file.txt')
>>> file = getattr(folder, fid)
>>> f = open('src/slc.autotranslate/slc/autotranslate/de_file.txt')
>>> file.setFile(f)
>>> from z3c.widget.flashupload.interfaces import FlashUploadedEvent
>>> from zope import event
>>> event.notify(FlashUploadedEvent(file))

Check that translated file exists

>>> hasattr(folder, 'file.txt-de')
True

Check that the original has been deleted

>>> hasattr(folder, 'file.txt')
False

Changelog

1.0 - Unreleased

  • Initial release

Release files for slc.autotranslate 1.0Beta1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slc.autotranslate 1.0Beta1
File Size Uploaded
slc.autotranslate-1.0Beta1.tar.gz 5.0 kB Details

Release files / slc.autotranslate-1.0Beta1.tar.gz

Download URL slc.autotranslate-1.0Beta1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f6c462ea78c1c978d50addaaa103e102139e3b988985775a3436f18a9b825f26
BLAKE2b-256 checksum
How to use checksums
40eeaa029f8ee44b6166e11451dce1a7cab514b7b54341e9791c423d85809547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

This release

1.0Beta1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page