This article is for Account Owners Project Managers using the Global Delivery Network.
Smartling's Debug mode, ?smartling_editmode=3
, is an edit mode that can be used on Global Delivery Network (GDN) sites to allow users to preview information about content capture, translation, and link rewriting behavior on a page. This mode is most readable when applied to the source code view of a translated page or response, but can also be applied to the front-end page.
This article covers how to use Debug mode to troubleshoot the following common issues:
Content Capture and Translation
There are two ways in which debug mode can help you understand how content is being captured and translated: at the page level and string level.
Page Level
The first line in the source code will be a comment indicating the capture ("parsing") and translation status of the page:
<!-- HTML PARSING BEGIN -->
- Content is being captured, and translations are being served for HTML content on the page.
<!-- NO INGESTION BEGIN -->
- New content will not be captured for translation on this page. Existing translations will continue to be served.
<!-- NOTRANSLATE MODE BEGIN -->
- Content will not be captured, and translations will not be served on this page.
If you see an unexpected capture mode or translation status, check your page level capture rules defined in Settings > Rules.
String Level
If the first line displays <!-- HTML PARSING BEGIN -->,
debug mode will apply comments to individual strings within a page with their capture and translation status. Search for a particular string within a page to see the status:
<!-- STRING TRANSLATE BEGIN HASH:XXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
- The string has been ingested and is in one of the translation workflow steps.
- Try checking the Awaiting Authorization and Excluded queues first. If the string isn't there, it's possible the string is currently in translation (In progress queue) or completed without a translation (Completed).
- The string has been ingested and is in one of the translation workflow steps.
<!-- STRING TRANSLATE BEGIN[NO INGESTION] -->
- The string will display translated, but will not ingest or translate if there are any edits.
<!-- NOTRANSLATE MODE BEGIN -->
- This will appear before a string that will not be ingested or translated by Smartling. Check your source code for any "notranslate" classes that may appear.
<!--[ string translated|excluded|total : 290|0|290]-->
- Found at the bottom of the page source, this shows the number of strings in different status:
translated strings count | excluded strings count | total strings of the HTML source of the page
- Found at the bottom of the page source, this shows the number of strings in different status:
Patterns
If a pattern is being applied to content on a page, debug mode will display the pattern and ID.
<!-- STRING TRANSLATE BEGIN HASH:XXXXXXXXXXXXXXXXXXXXXXXXXXXX PATTERN[ID:########]:~^{pattern}$ -->
In some cases, a pattern may be too general ("greedy"), and prevent you from capturing content you want translated. If this happens, locate the pattern in Content > Patterns, and try making your pattern more specific by using additional parameters.
Removing a pattern will cause the original patterned version of the string to revert to English. Re-capture that string and apply a new pattern.
Link Rewriting
In most cases, the GDN will automatically rewrite both relative and absolute links of the source domain on translated sites. You can see this behavior in more detail in debug mode, which can be helpful when you observe a link that is not rewriting on a translated site as expected:
<!-- NOREWRITE MODE BEGIN -->
- Links will not be rewritten, so all links will stay on your source domain. Check for the presence of any "Do Not Localize URLs" rules or your source code of the sl_opaque/notranslate class.
<!-- ABSOLUTIZE URI BEGIN -->
- The relative link will be rewritten.
<!-- LINK SUBSTITUTION BEGIN -->
- The absolute link will be rewritten.
Javascript and JSON Parsing
Javascript and JSON strings are not captured by default, and require integration in order to be captured. In the absence of the Smartling markup, the debug mode will not display comments in front of the string, which is a sign that the content is not being detected by the GDN parser.
<!-- JS PARSING BEGIN -->
- Indication that Javascript is being recognized by the GDN parser and will ingest any applicable content for translation.
<!-- JSON PARSING BEGIN -->
- Content, specified by keys, is being parsed as JSON for translation.
- If this comment does not appear, Smartling markup will have to be added for the JSON strings.