Disclaimer: The Advance GDN Rule editor is designed for developers who have in-depth knowledge of your source code, site design, and the Global Delivery Network. Changes made using this tool can break functions of your translated sites, and in some cases prevent the translated sites from functioning in entirety. We recommend that you instead mark up your source code using our GDN integration tags or configuration rules.
If there are cases where this is not possible, contact your Customer Success Manager to discuss if this tool is right for you.
To Create an Advanced Rule
- From your GDN project, click the gear icon > Project Settings > Advanced GDN Rules
- Click the + New Rule button
- Choose your rule type from the dropdown menu
- Choose the domain and languages this should apply to
- Insert a rule condition, if applicable
- In the Rule text field, enter your rule parameter
- URL rules: Enter full URL path of the page to apply the rule. NOTE: Rules will execute on partial matches. For example, if you enter rule text "/products", your rule will apply to any page that contains /products in its URL.
- HTML Class or ID rules: Enter an HTML class or ID to apply the rule against. NOTE: If the HTML class or ID is not unique, your rule will be applied to every instance of the HTML element on your site.
- Add a comment
- Click Save to create your rule or Cancel to start over
View Rule History
You can view the history of each rule by clicking the ellipses under Actions > View History. This shows the complete change history for a rule, including who made the changes and when. The history also shows the differences between the current and previous versions of the same rule.
Click the downward arrow of each history item to view the rule details.
Restore Rule
For each previous version of a rule, there is now a "Restore" button that allows you to bring back that iteration of the rule configuration. To restore an older rule, click the downward arrow > Restore
Advance Rule Library
Custom Rules
All rules listed are custom rules. Select either 'CUSTOM_RULE_LOCATION' from the Rule Type dropdown menu. Custom rules should always be terminated with a semicolon (;).
Regex
All regex for Smartling advanced rules should follow standard Java Regex format.
URIs
All URIs used as a parameter are exact matches by default. To enable regex pattern processing, prefix the URL with a tilde (~).
JavaScript
Rule | Description | Default | Syntax / Example |
Include JavaScript | Forces processing of a given URL as JavaScript |
rps_include_js_url '[uri]';
|
|
Autoinclude JavaScript | Declares content types to be automatically included for translation as JavaScript | application/x-javascript, application/javascript, text/x-javascript, text/javascript |
rps_autoinclude_js_types '[string]';
|
Include Content Types | Declares content types that should be treated as JavaScript, including custom or non-standard types. Multiple content types can be defined by including space separated parameters. | application/x-javascript |
rpsjs_types '[string]';
|
Auto-detect HTML | Automatically detect HTML embedded in JS/JSON | Off |
rps_auto_detect_embedded_html [on/off];
|
Parse JS as HTML | Declares script types that should be parsed as HTML |
rps_parse_script_type_as_html '[string]';
|
|
Parse HTML with angle brackets | Declares parsing of JS templates containing angle brackets such as: <% variable name %> | Off |
rps_parse_js_template_with_angle_bracket '[on/off]';
|
Escape HTML | Automatically escapes embedded HTML in JS/JSON. First argument is a regex URL parameter, second argument is the escaper. | Off |
rps_escape_embedded_html '[uri]' '[string]';
|
Unescape HTML | Automatically unescapes embedded HTML in JS/JSON (if no rps_escape_embedded_html rule is defined for current request) | Off |
rps_auto_unescape_embedded_html [on/off];
|
JSON
Rule | Description | Default | Syntax / Example |
Include JSON | Forces processing of a given URL as JSON. You must explicitly specify which keys to include for ingestion. |
rps_include_json_url '[uri]' '[keys]';
|
|
Include Generic JSON | Forces processing of a given URL as JSON. Unlike rps_include_json_url, this rule will process both valid JSON and JSON-like data (JSON keys without quotes). |
rps_include_generic_json_url '[uri]' '[keys]';
|
|
Autoinclude JSON | Declares content types to be automatically included for translation as JSON | application/json, text/x-json, text/json |
rps_autoinclude_json_types '[string]';
|
JSON path | Declares JSON paths that should be included for translation |
rps_json_path_url '[uri]' '[string]';
|
|
Translate lists | Process values stored in lists within JSON | off |
rps_json_translate_lists [on/off];
|
JSON delimiter | Declares a space separated list of delimiters to be used for tokenizing plain text in JSON | off |
rps_json_delimiter '[string]' '[uri(optional)]';
|
Parse JSON as HTML | Used to parse JSON values as HTML. You must first include JSON (rps_include_json_url) before applying this rule. |
rps_json_html_keys '[uri]' '[keys]';
|
XML
Rule | Description | Syntax / Example |
Include XML | Forces processing of a given URL as XML |
rps_include_xml_url '[uri]';
|
Include all XML tags | Includes all XML tags for translation by default. (Default: On) |
rps_xml_extract_all [on/off];
|
Parse escaped HTML | Enables parsing of escaped HTML within XML for a given URL |
rps_parse_escaped_html_in_xml_url '[uri]';
|
Pseudo-Translation
Rule | Description | Default | Syntax /Example | Input | Output |
---|---|---|---|---|---|
Enable | Enables pseudo-translation | Off |
rps_pseudo_translate_enabled [on/off];
|
Hello World | [H~élló Wó~rld~] |
Prefix | Changes the prefix used in pseudo-translation | [ |
rps_pseudo_translate_part_prefix '[character]';
|
[H~élló Wó~rld~] | ?H~élló Wó~rld~] |
Suffix | Changes the suffix used in pseudo-translation | ] |
rps_pseudo_translate_part_suffix '[character]';
|
[H~élló Wó~rld~] | [H~élló Wó~rld~? |
Inflation Character | Changes the character used to inflate pseudo-translation | ~ |
rps_pseudo_translate_inflater_str '[character]';
|
[H~élló Wó~rld~] | [H?élló Wó?rld?] |
Inflation Rate | Changes the rate of string inflation as a percentage | 25% |
rps_pseudo_translate_inflate_percents [integer];
|
[H~élló Wó~rld~] | [H~é~l~l~ó~ ~W~ó~r~l~d~] |
Inflation Limit | Limits the amount inflation (as a percentage) that can occur for any single string | 200% |
rps_pseudo_translate_max_inflatable [integer];
|
[H~é~l~l~ó~ ~W~ó~r~l~d~] | [H~élló Wó~rld~] |
Metadata
Rule | Description | Syntax / Example |
Include name | A comma seperated list of meta tags to be included for translation |
rps_include_meta_name '[string]' '[url(optional)]';
|
Include attribute | A comma seperated list of meta attributes to be included for translation |
rps_include_meta_attr '[string]' '[url(optional)]';
|
Split keywords | Separates multiple keywords within a single meta tag description so they can be translated individually |
rps_split_meta_keywords '[character]';
|
Split content | Splits content of specified meta names in to separate strings |
rps_split_meta_content '[string]' '[character]';
|
Open Graph Tags | A comma separated list of Facebook Open Graph meta tags to be included for translation |
rps_translate_meta_og_property '[string]';
|