Custom QA Checks
The custom quality assurance (QA) checks is the feature that helps efficiently handle language-specific aspects such as punctuation, numbers, and regular expressions to ensure more accurate QA check results and high-quality translations in all languages. With custom QA checks, you can detect the exact mistakes you want. It helps customers avoid mistakes in the texts and translators to translate the content more proficiently.
Creating and Adding Custom QA Checks
You can manage Custom QA checks in the Organization Settings. There are two possible ways to add new Custom QA checks in your organization: create your own custom QA checks specifying a code snippet from scratch or add them from the Crowdin Store.
- Click on your profile picture in the upper-right corner and select Organization Settings.
- Switch to the Custom QA checks section on the left sidebar and click Create custom QA check.
- Provide the details of the custom QA check in the required fields:
- Name – provide a clear name for your custom QA check, so the translator can understand what should be corrected in translation
- Description – explain what custom QA check corrects or verifies
- Code Snippet – provide the Javascript-based code snippet to make the QA check work. It includes a
crowdin
object and several properties.
- Click Create.
Alternatively, to add existing custom QA checks from the Crowdin Store, follow these steps:
- Go to Organization Settings > Custom QA checks.
- Click Add from store.
- Click towards the needed custom QA check.
- Click Create.
Code Snippet
Code Snippet is a piece of code that helps to create custom QA checks and integrate them to Crowdin Enterprise.
Parameters
Code Snippet is Javascript-based. It Includes a crowdin
object and a number of properties. To create the code snippet, use this object template for code input:
Find the example of a custom QA check code snippet in Crowdin Script Editor. Use the link to see the structure of code snippet, edit it with your data and verify your code is correct.
Request
The code snippet request includes the keys listed below:
Property | Description |
---|---|
file.name | Source file name |
file.fullName | Full path to the source file in the project (excluding branch if any) |
file.branch | Branch name the source file is stored in |
file.type | Source file type |
sourceLanguage | Crowdin’s code for the project source language |
targetLanguage | Crowdin’s code for the project target language |
source | Source text |
translation | Translated string |
context.context | Source string context |
context.maxLength | Maximum length of the translated string |
context.pluralForm | PluralForm indicates which plural form is being translated right now |
context.identifier | Source string identifier (key) |
contentType | String can include one of the 3 types: text/plain , application/vnd.crowdin.text+plural , application/vnd.crowdin.text+icu |
See the example of code snippet request:
Response
After running the code snippet, it should return the response whether the custom QA checks have passed successfully or failed:
-
The response object should contain boolean
success
property indicating whether QA checks have passed. For instance: -
In case the QA checks failed, the property “message” will be displayed to the translator. For example:
-
Crowdin QA checks can also return the mistakes and automatic fix instructions to the editor. If possible, it is recommended to include
fixes
property (an array of objects) since it can save a lot of time and effort for translators.
The from_pos
is a character position in the translation
string where the replacement starts. The to_pos
is the end of character position. The replacement
property is the text that should be placed between from_pos
and to_pos
.
Limitations
Crowdin code snippet has the limitations listed below:
- The code is completely sandboxed. Neither browser context nor Node.js context is available
- Standard objects like
date
,math
, and similar ones are not available - Crowdin limits the time of running the custom QA check: a user’s code can run up to 100 ms. If the code snippet is too complex or has any mistakes, the custom QA check can be processed longer and will be stopped. In this case, correct the issues and run the check over.
Enabling Custom QA Checks
All custom QA checks will be available in the project’s Settings, along with QA checks provided by Crowdin. To enable custom QA checks, follow these steps:
- Open your project and go to Settings > Quality assurance.
- Select the needed custom QA checks.
Read more about Quality Assurance settings.