This article is for Account Owners and Project Managers using the Global Delivery Network.
Similarly to placeholders in resource files, pattern matching rules can be used to help reduce the cost of translating repetitive text on your website that contains dynamic variables.
For example, an order confirmation page may display a message after a customer completes an order:
Thank you, your order number is 56783
In this example application, each time a new order is placed, the same text string appears, but with a different order number. You need to translate the text, but not the order number.
By default, the Global Delivery Network will recognize each of these confirmation messages as unique due to the different order numbers. By creating a pattern rule for the order number sequence in this message, you can allow the repetitive text to be translated once in Smartling, and pass through the dynamic order number unchanged. This will reduce your translation costs.
After creating a pattern matching rule, the static messages would be capture in Smartling once with the order number masked:
Thank you, your order number is {0}
Other examples of repetitive text with dynamic variables could be:
Hello Susan
37 Comments
Page 3 out of 10
You have 4 items in your cart
This article describes how to create and manage Patterns in the Smartling Dashboard. You can also create patterns for dynamic content using the No Translate class in your source code.
Create a Pattern (Classic)
- After you have captured content in the Authorization Queue of a Global Delivery Network project type, select any instance of a string you want to create a pattern for by using the checkbox next to the string.
- Click Actions > Create Pattern.
- Your string text will be displayed in the gray text box at the top of the pattern rule prompt.
- Double click or highlight text in the string you want to mask
- Click the +Placeholder from selection button
- Configure the parameters to match in the What to Match prompt
- Click outside of the What to Match prompt
- Once you have created all desired parameters, click the Apply Pattern button to save or Reset Pattern to start over
Each time you click out of the What to Match prompt, the white textbox below will dynamically update to show you all strings in the Authorization Queue that match your current pattern parameters, and that will be deleted if the pattern is created. You can prevent certain strings from being deleted by clicking Keep String.
Create a Pattern (New Experience)
- After you have captured content in a Global Delivery Network project to to the Project's Strings View ("Strings") and select any one instance of a string you want to create a pattern for by using the checkbox next to the string.
- Click Actions > Create Pattern.
- Your string text will be displayed in the gray text box at the top of the pattern rule prompt.
- Double click or highlight text in the string you want to mask
- Click the +Placeholder from selection button
- Configure the parameters to match in the What to Match prompt
- Click outside of the What to Match prompt
- Once you have created all desired parameters, click the Apply Pattern button to save or Reset Pattern to start over
Each time you click out of the What to Match prompt, the white textbox below will dynamically update to show you all strings in the Authorization Queue that match your current pattern parameters, and that will be deleted if the pattern is created. You can prevent certain strings from being deleted by clicking Keep String.
Pattern matching parameters
Range Type
- At least: Sets a minimum quantity of matching text
- Exactly: Sets an exact quantity of matching text
- Between: Sets a range for matching text
Quantity: sets quantity for range type
Character Type
- Characters: Matching text can be any characters, including digits and spaces
- Digits: Matching text can only contain digits
Match Partial String: allow
Delete or Deactivate a Pattern (Classic)
After a pattern rule is created, it will be displayed in Content > Patterns. To Delete or Deactivate:
- Click on Content > Patterns
- Click Delete to permanently delete a pattern rule. Click Deactivate to deactivate a rule. Deactivated rules will remain in your Patterns tab, and can be re-activated at any time.
You can only delete patterns from the Patterns tab that were created in the List View. If a pattern was created by tagging your source code, contact your technical team to remove the pattern markup. If a pattern was created by Smartling using custom integration, contact your Customer Success Manager to have the rule removed.
Pattern rules are automatically deactivates if no new content has matched a given rule in the past 6 months. If you still want the pattern rule to be active, you'll need to reactivate the rule within the Smartling Platform by clicking on Content > Patterns > Activate.
Delete or Deactivate a Pattern (New Experience)
This screen is not yet available in the New Experience. Please contact support for assistance should you need to delete, deactivate or update the label of a pattern that has been created.
Tips
Create patterns on content that is Awaiting Authorization
The system will automatically remove all strings matching a newly created pattern from the authorization queue, saving you the time. Patterns can be created on content that is in Progress, however you will have to manually un-authorize and delete any matching strings from your project.
Patterns can also be used to systematically exclude content
If you don't have developer resources available to add No Translate Class to elements in your source code that should not be translated, you can use pattern rules to identify a set of repetitive strings and exclude matches from translation.
To do this, create a pattern as described above. After the masked version of the string is re-captured in Smartling, exclude the string. Any strings matching this pattern will appear in your source language on your translated sites.
Be mindful of greedy pattern rules
If a pattern is too greedy, you may mask more content than you intended. Limit patterns to a certain number of characters, range of characters, or digits to make rules more specific.
Example:
You've captured email address strings from a contact page on your website that you don't want to translate:
susan@yourcompany.com
john@yourcompany.com
tom@yourcompany.com
You create a pattern matching rule for 1+characters@1+characters
This pattern will match the email addresses above, but also any text on your website that contains an @ character, such as:
Contact sales@yourcompany.com for a free demo
which you may want translated.
You can choose to "keep" the variations you want translated if they were already captured at the time you create the pattern. If you discover a variation you want translated after the pattern is created you might need to take extra steps such as deleting the pattern or adding the string manually. Contact support for assistance.
Label masked text to provide additional information to translators
After a pattern rule has been created, you can label rule parameters that mask dynamic text to provide information to translators that can help improve translation accuracy.
Example:
The pattern Welcome, {0} could be updated to display as Welcome, {First Name} in the CAT tool by labeling the masking parameter. The translator now has insight about what type of data is being masked in this string, which may influence their translation.
To label a rule parameter:
- Click on Content > Patterns from within a Global Delivery Network project.
- Click on the yellow parameter token you want to label.
- Enter a label in the Placeholder Label field.
- Click the x to save your change and exit the prompt.