Details
-
New Feature
-
Resolution: Fixed
-
None
-
None
-
Empty show more show less
Description
For the structure and usage of the used task-template.xml see attached example file.
whitespace
All whitespace except a single space is always protected as tags. This can not be switched off. With several normal space characters directly after each other, the first one is left as space, and the others will be protected as one tag.
tag protection
CSV-import can be set to a mode that tags are recognized. This is done via a "task-template.xml"-file in the root of an import-zip-package of translate5.
If this mode is active, brackets have to be encoded as entities if they where meant as normal characters
">" should become >
The tagged text can be as complex as a normal xml-structure, e.g. it can consist of opening- and closing-paired-tags as well as empty self-closing-tags (single-tags). All tags are allowed as a tag that has the format it should have in regard to xml definition. However, the content of a CSV-cell does not have to be well-formed - it is allowed to only have opening or closing tags in it without the correspondig paired tag. In this case however all tags in the segment are transformed to placeholder tags - regardless if they have a potentially matching counterpart or not.
A sample csv-file with tagged text is attached.
REGEX-sensitive protection
A "task-template.xml"-file can pass a number of regular expression (PHP-PCRE-Syntax including modifiers). Everything matched with one of these REGEX will be converted to a single tag within translate5. Be carefull of possible security flaws like inserting php-code in the regular-expression passed in task-template.xml. It must be ensured, that nothing passed as REGEX will be evaluated as PHP-code. The simplest way might be to ensure, that no string identifiers (see http://php.net/manual/en/language.types.string.php) are used within the passed REGEX, unless they are not escaped by a backslash. In addition the REGEX should be checked against a REGEX to test, if it really is a REGEX, like described in the best voted answer here: http://stackoverflow.com/questions/172303/is-there-a-regular-expression-to-detect-a-valid-regular-expression
Attachments
Issue Links
- relates to
-
TRANSLATE-414 best interoperability for translate5: enhance API, export, import and support of standards
- Done