Translation Quality

Custom Quality Checks

Quality Checks are critical to ensuring translations reach the Published step, as you expect them to. Smartling offers a range of Quality Checks that cover industry-standard checks, however you may want to create a custom quality check to target a specific element in a translation.

Custom Quality Checks allow you to apply specific logic to check translations for a desired result, using Regular Expression, or regex. Regex is a powerful function that allows you to search for a pattern of characters, which facilitates greater flexibility to customize quality checks.

The following are some good resources to learn more about using regex:

  • This walks through exercises of regex examples
  • This allows you to test and validate your regex

How Custom Quality Checks Work

Here is a broad overview of how Custom Quality Checks work:

  • A Check type is set.
  • Source regex is set to evaluate the source string for pattern matches. 
  • Target regex is set to evaluate the target string for pattern matches.
  • Once the Quality Check has been created, you can configure its severity from low, medium or high.
  • The results of the source and translation pattern matches under the specified Quality Check type is used to evaluate whether the translations saved by linguists in the CAT Tool failed or passed the Quality Check. If the severity level is set to high, linguists will be unable to submit a translation that failed the Quality Check.

If a source regex pattern is not found in the source string, the Quality Check stops, regardless if a target pattern is found in the translation. In some cases, your Quality Check might not require a source string evaluation; in this case, you can set the Quality Check to match "anything" in the source string by inserting .*? as the source regex. This pattern could also be understood as "check all translations". 

Example Custom Quality Check

Custom Quality Checks are custom to individual use cases and requirements. Most, if not all, Quality Checks are already covered in Smartling's standard offering, however there may be something specific to your localization process that you need evaluated and monitored - this check will be custom to you.

As a result, the examples provided are mostly already covered in Smartling's standard range of Quality Checks; however, they are provided to guide and to help you understand how Custom Quality Checks work. Here’s an example of a Custom Quality Check that is the same as the Blocklist Quality Check.

Check Type: Forbidden in translation

Source Regex: .*?

Target Regex: fou

This says that no translation should have the phrase/pattern fou. If a translation is saved in the CAT Tool with fou, a Quality Check warning is flagged. This example is just for context, it is still recommended that you use the Blocklist Quality Check instead. 

Example String Resulting in a Quality Check warning

Source

Translation

Explanation 

It’s crazy out there.

C'est fou là-bas.

The target regex pattern was found in the translation and, under this Quality Check type, it should be forbidden.

Check Types

There are three types of checks that can be customized:

  1. Count mismatch in translation
  2. Forbidden in translation
  3. Missing in translation

Count mismatch in translation

The source string is evaluated against regex and the number of times that the match occurs is summed. The translation is evaluated against the translation regex and the number of times that the match occurs is summed.  If these counts are not the same, the check fails and the warning is produced. In other words, count the number of times the source regex pattern appears in the source string, and compare that to the number of times the target pattern appears in the translation, they should be the same.

It is possible to have different patterns for both source and target.

Example Custom Quality Check

Description: Check for copyright characters

Source Regex: ©

Target Regex:©

This evaluates the number of times that source has © character, and checks that the translation must contain the same numbers of  © characters. In other words, both the source and the target must have the same number of copyright symbols. If not, a Quality Check warning is flagged.

Example String Resulting in a Quality Check warning

Source

Translation

Explanation

Copyright © 2021 Smartling, Inc. All rights reserved.

Copyright © 2021 Smartling, Inc. ©
All rights reserved

The source regex checked that the source string contained "©", and counted the number of times it appeared. The target regex pattern checked that the translation contained "©", and counted the number of times it appeared. Because there was a mismatch in the number of times "©" was found in the translation, under this Quality Check type, that is not acceptable and a Quality Check warning was flagged.

Forbidden in translation

This Check type evaluates if the source string has a match for the regex, then the translation must not match with the target regex. If it does, the check fails and the warning is produced. In other words, if the specified target pattern is present, flag a Quality Check warning.

Forbidden in translation checks are most useful to ensure language-specific formatting rules are followed, especially if the Smartling standard Quality Checks do not already cover the case.

Example #1 Custom Quality Check

Description: French punctuation spacing

Language-specific setting: fr-FR

Source Regex: .*?

Target Regex: (\w)(\?|\!)

This says that for fr-FR language, if the source string contains anything .*?, check all translations to make sure any word character (equivalent to [a-zA-Z0-9_]) (\w), does not come directly before the question or exclamation mark (\?|\!). In other words, there must be a space before  a  question or exclamation mark in French translations. If not, a Quality Check warning is flagged.

The target pattern must be found in the translation to trigger the "forbidden" check. The idea is, the target regex contains a pattern that we don't want in our translations. If it does match, Smartling will warn.

Example String Resulting in a Quality Check warning

Source

Translation

Explanation

What day is it?

Quel jour est-il?

The source regex checked that the source string contained "anything". The target regex pattern, together with the language-specific setting, checked for a French word immediately before a question or exclamation mark. Because there was no space between the last word and the question mark, under this Quality Check type, that is not acceptable and a Quality Check warning was flagged.

Example #2 Custom Quality Check

Description: Proper Chinese Punctuation

Language-specific setting: zh-TW, zh-CN

Source Regex: .*?

Target Regex: [\p{Lo}][\.\!\?]

This says that for zh-TW and zh-CN languages, if the source string contains anything, check all translations to see if roman character punctuation (period, exclamation, question) [\.\!\?], immediately follows any ideographic character [\p{Lo}]. If any one of those 3 roman character punctuation marks is found immediately after an ideographic character, a Quality Check warning is flagged.

Example String Resulting in a Quality Check warning

Source

Translation

Explanation

What day is it?

今天是什麼日子?

The source regex checked that the source string contained "anything".

The target regex pattern checked for a word immediately before a roman character punctuation. Because there is a roman ? , under this Quality Check type, that is not acceptable and a Quality Check warning was flagged. The translator can correct this by using the ideographic (full-width) question mark character.

Missing in translation

The source string is evaluated against the source regex pattern. The source string must contain at least one occurrence of the specified source regex pattern. As previously noted, if there isn’t at least one match in the source, the Quality Check stops. 

When there is a match in the source, the translation is then evaluated against the target regex. There must be at least one match. If not, the check fails and the warning is produced.

Missing in translation is similar to Count mismatch in translation, except here, the source/target pattern only needs to appear once to pass the evaluation. 

Example Custom Quality Check

Description: Check for copyright characters

Source Regex: ©

Target Regex:©

This evaluates the number of times that source has © character, and checks that the translation must contain at least one  © character. In other words, if the source has any/at least one ©, then the target must also have at least one ©. If not, a Quality Check warning is flagged.

Example String Resulting in a Quality Check warning

Source

Translation

Explanation

Copyright © 2021Smartling, Inc. All rights reserved.

Copyright ® 2021Smartling, Inc. All rights reserved.?

The source regex checked that the source string contained "©". The target regex pattern checked that the translation contained at least one "©". Because "© was not found even once in the translation, under this Quality Check type, that is not acceptable and a Quality Check warning was flagged.

 

Was this article helpful?