Extension | .svg |
Smartling Identifier | svg |
Example | sample.svg |
Resources | Official SVG Standards |
SVG is an XML-based markup language for describing two-dimensional graphics applications and images, and a set of related graphics script interfaces.
File directives for inline and API Service configuration parameters are listed below.
Default Parsing
Each <text>
element is parsed as a string.
Preparing Content for Translation
Smartling recognizes text in SVG files that use the <text> element to signify text to be translated. Only content in the <text>
element will be ingested for translation.
Before uploading the SVG into Smartling, it's best to open the file in a Text Editor application to view exactly what content is within the <text>
element.
Unsupported Functions
- HTML Parsing
- Key/Variants
- Plurals
- Instructions
- Excluding content within the
<text>
element
Directives
File directives are supported, both inline and via our API. Directives are specified in comments within the files, in the following format:
Inline File Format
<!-- smartling.[directive_name] = [value] -->
API Parameter
smartling.[directive_name] = [value]
Here are examples of supported directives for SVG:
Translate Path
Directives | translate_paths |
Values | Comma-separated paths to source content for translation. |
Smartling Translate Supported | Yes |
Description | This directive is used to point to paths of tags or attributes with translatable content. |
Examples |
<!-- smartling.translate_paths = root/node.name, root/node2.name -->
<!-- smartling.translate_paths = root/node/subnode, root/node2.name --> |
Standard Placeholder Format
Directive |
placeholder_format |
Values | NONE; C; IOS; PYTHON; JAVA; YAML; QT, RESX |
Smartling Translate Supported | Yes |
Description | Used to specify a standard placeholder format. |
Examples | <!-- smartling.placeholder_format = IOS -->
Specifies iOS-style placeholders for the file. |
Custom Placeholder Format
Directive | placeholder_format_custom |
Values | 1) Custom Java regular expression. 2) NONE - disables any current custom placeholders |
Smartling Translate Supported | Yes |
Description | Specifies a custom placeholder format. Any text in your file matching the regular expression you provide will be captured as a placeholder. |
Examples |
<!-- smartling.placeholder_format_custom = REGEX--> <!-- smartling.placeholder_format_custom=\{([^}]+)\} --> Any characters surrounded by curly brackets, e.g., {first name}, will be treated as a placeholder. |
See Placeholders in Resource Files for more on placeholders.
Trim Whitespace
Directive |
whitespace_trim |
Values |
on|yes|true or off|no|false or leading|trailing The default value is on. |
Smartling Translate Supported | Yes |
Description |
A whitespace is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character is not a visible mark, but does occupy an area or space on a page. Although whitespaces are necessary within a string (typically to separate words), unnecessary whitespaces can be found at the start of a string (leading) and at the end of a string (trailing). With this directive, you can trim whitespaces, as it enables or disables whitespace trim management for the ingested strings. Whitespace is optionally trimmed from content then re-inserted on download for convenience so that translators do not have to manage the extra spaces. However, content owners may want to retain surrounding whitespace so that translators can By default, the leading and trailing whitespaces are trimmed. You can choose to disable trimming or specify trimming for leading or trailing whitespaces. The directive can only be used as the API request parameter. |
Examples |
<!-- smartling.whitespace_trim=on --> Smartling will trim leading and trailing whitespaces (default) <!-- smartling.whitespace_trim=off --> Smartling will not trim leading or trailing whitespaces <!-- smartling.whitespace_trim=leading --> Smartling will trim only leading whitespaces <!-- smartling.whitespace_trim=trailing --> Smartling will trim only trailing whitespaces |