Crowdin Query Language (CroQL) is a tool for Crowdin Editor and Crowdin Enterprise Editor and Crowdin and Crowdin Enterprise API that allows you to retrieve needed localization resources based on specific conditions. Using CroQL, you can filter source strings and their translations for a specific target language, as well as TM segments.
You can use CroQL with the following API methods:
CroQL-hovedoperatorer er anført nedenfor. Benyt og kombinér dem for at opsætte særlige betingelser for at hente indhold fra Crowdin. Elementerne fra tabellerne nedenfor kan bruges til at danne CroQL-forespørgslen.
De aritmetiske operatorer bruges til at udføre matematiske operationer med enhver numeriske datatype.
Navn | Symbol | Eksempel |
---|---|---|
Addition | + | 1 + 9 |
Subtraktion | - | 11 - 1 |
Division | / | 20 / 2 |
Multiplikation | * | 2 * 5 |
Negation | - | -10 |
Sammenligningsoperatorer bruges til at sammenligne værdier og returnere true
eller false
.
Navn | Symbol | Aliaser | Eksempel |
---|---|---|---|
Mellem | {{expression}} mellem {{expression}} og {{expression}} | 5 mellem 1 og 10 | |
Lig med | = | 10 = 10 | |
Ikke lig med | != | ≠ | 1 != 10; 1 ≠ 10 |
Større end | > | 10 > 1 | |
Større end eller lig med | >= | ≥ | 10 >= 1; 10 ≥ 1 |
Mindre end | < | 1 < 10 | |
Mindre end eller lig med | <= | ≤ | 1 <= 10; 1 ≤ 10; |
Contains | {{string}} contains {{string}} | "Hello World" contains "Hello"; "Hello World" contains text; text contains "Hello World"; context contains text; |
Logiske operatører bruges til at kombinere flere booleske udtryk/værdier og give et enkelt boolesk output.
Navn | Symbol | Eksempel |
---|---|---|
Og | og | 1 < 10 and 10 > 1 |
Eller | eller | 1 < 10 or 10 > 1 |
Xor | xor | 1 < 10 xor 10 > 1 |
Ikke | ikke | not 1 < 10 |
Filtreringsoperatorer anvendes til at filtrere objekter baseret på den angivne tilstand.
Navn | Symbol | Eksempel |
---|---|---|
Filter | {{collection}} where {{predicate}} | translations where (count of votes > 0) |
Match | {{object}} med {{predicate}} | bruger med (login = "crowdin") |
The ternary operator is used to check a condition specified in the first value, and if it’s true
it returns the second value, but if it’s false
it returns the third value.
Navn | Symbol | Eksempel |
---|---|---|
Ternær | If {{condition}} then {{expression}} else {{expression}} | If 1 < 10 then "less" else "greater" |
Hent-operatører bruges til at hente data fra objekterne.
Name | Symbol | Example |
---|---|---|
Nævn | @user:{{string}}; @language:{{string}} | @user:"crowdin"; @language:"en" |
Medlem | {{member}} of {{object}} | antal af oversættelser |
Identifikator | {{identifier}} | text; identifier |
Skalaroperatorer bruges til at erklære værdier til videre behandling.
Navn | Symbol | Eksempel |
---|---|---|
Integer | {{integer}} | 10 |
Flydende | {{float}} | 10.01 |
Streng | {{string}} | “crowdin" |
Datotid | {{datetime}} | 'i dag'; '2021-03-16 00:00:00' |
Gruppeoperatorer bruges til at fastlægge operatorers eksekveringssrækkefølge.
Navn | Symbol | Eksempel |
---|---|---|
Gruppér | ( ) | 1 < 10 and (20 > 10 or 10 > 5) |
In this section, you can find practical examples of CroQL queries that will help you understand and use the querying capabilities within Crowdin. These examples can help you learn how to create your own queries to retrieve specific sets of data based on various criteria, such as translation status, user activity, and string properties.
These queries are used to retrieve information about source strings.
count of translations where ( language = @language:"uk" and ( count of approvals > 0 or count of votes > 0 ) ) = 0
count of translations = 1
count of translations > 0 and count of translations = count of translations where (user = @user:"crowdin")
count of translations where (user != @user:"crowdin") > 0
count of translations > 0 and count of translations = count of translations where (user != @user:"crowdin")
identifier = "key" and id of file = 777
id of file = 777 and count of comments where (has unresolved issue) > 0
is hidden and not is duplicate and count of translations > 0
count of languages summary where (approvalsCount >= 1) > 0
crowdin
username:count of comments where (user = @user:"crowdin") > 0
text contains "ABC" and (count of translations where (text contains "ABC") = 0)
{projectId} | Type: Beskrivelse: Numerisk identifikator for Crowdin-projektet. |
{croql} | Type: Beskrivelse: CroQL-udtryk. |
These queries are used to retrieve information about translations.
crowdin
username or ones with ≥ 100 upvotes:user = @user:"crowdin" or count of votes where ( is up ) >= 100
{projectId} | Type: Beskrivelse: Numerisk identifikator for Crowdin-projektet. |
{croql} | Type: Beskrivelse: CroQL-udtryk. |
These queries are used to retrieve information about TM segments.
count of records where (usageCount > 0) > 0
crowdin
username:count of records where (createdBy = @user:"crowdin") > 0
{projectId} | Type: Description: Numeric identifier of your Crowdin project. |
{croql} | Type: Description: CroQL expression. |
count of languages summary where (language = @language:"uk" and is translated) > 0
) in your CroQL query. added between '2023-12-06 13:44:14' and '2023-12-07 13:44:14'
updated between '2023-12-06 13:44:14' and '2023-12-07 13:44:14'
count of languages summary where ( translation updated between '2023-12-06 13:44:14' and '2023-12-07 13:44:14') > 0
count of languages summary = 0
count of languages summary where (is partially translated) > 0
count of languages summary where (is translated) > 0
count of languages summary where (has translation as source) > 0
count of languages summary where (is source changed after translation) > 0
not is duplicate
is duplicate
is duplicate and count of languages summary where (has shared translation) > 0
is duplicate and count of languages summary where (not has shared translation and is translated) > 0
count of languages summary where (is translated and not is approved) > 0
count of languages summary where (is partially approved) > 0
count of languages summary where (is approved) > 0
count of languages summary where (has translation after approval) > 0
count of languages summary where (is translated by mt) > 0
count of languages summary where (is translated by tm) > 0
count of languages summary where (is auto translated) > 0
count of comments > 0
count of screenshots > 0
count of languages summary where (has qa issues) > 0
type is plain or type is icu
count of languages summary where (rating > 0) > 0
count of translations where (user = @user:"crowdin") > 0
count of translations where (user != @user:"crowdin") > 0
count of translations where (count of approvals where (user = @user:"crowdin") > 0) > 0
count of translations where (count of approvals where (user != @user:"crowdin") > 0) > 0
CroQL can be used in the following contexts: source string context, translation context, and translation memory (TM) segment context. Use the following examples as a basis for building your CroQL queries.
{
"type is plain": true,
"type is plural": false,
"type is icu": false,
"type is asset": false,
"text": "Quick Start",
"identifier": "quick_start",
"context": "quick_start",
"max length": 0,
"is visible": true,
"is hidden": false,
"is duplicate": false,
"isPassedWorkflow": true,
"file": {
"id": 32,
"name": "sample.csv",
"title": "Sample",
"type": "csv",
"context": "Some useful context information"
},
"comments": [
{
"has issue": false,
"has unresolved issue": false,
"user": 1
}
],
"screenshots": [],
"translations": [
{
"text": "Швидкий старт",
"plural form": "none",
"is pre translated": true,
"provider": "tm",
"language": "uk",
"user": 1,
"votes": [
{
"is up": true,
"is down": false,
"user": 2,
"added": "2021-04-09 13:44:14"
}
],
"approvals": [
{
"user": 2,
"added": "2021-04-09 13:44:14"
}
],
"updated": "2021-04-09 10:23:17"
}
],
"languages summary": [
{
"language": "en",
"is translated": false,
"is partially translated": false,
"is approved": false,
"is partially approved": false,
"translation updated": false,
"is auto translated": false,
"is translated by tm": false,
"is translated by mt": false,
"is source changed after translation": false,
"has translation as source": false,
"has translation after approval": false,
"has shared translation": false,
"has qa issues": false,
"has empty translation qa issues": false,
"has translation length qa issues": false,
"has tags mismatch qa issues": false,
"has spaces mismatch qa issues": false,
"has variables mismatch qa issues": false,
"has punctuation mismatch qa issues": false,
"has character case mismatch qa issues": false,
"has special characters mismatch qa issues": false,
"has incorrect translation qa issues": false,
"has spelling qa issues": false,
"has icu syntax qa issues": false,
"has terms qa issues": false,
"has duplicate translation qa issues": false,
"has ftl syntax qa issues": false,
"has android syntax qa issues": false,
"has custom qa issues": false,
"rating": 1,
"approvalsCount": 1
}
],
"labels": [
{
"id": 1,
"title": "label title",
"is system": false
}
],
"added": "2021-04-08 12:33:27",
"updated": "2021-04-08 12:33:27"
}
type is plain | Type: Beskrivelse: Kildestreng med almindelig tekst. |
type is plural | Type: Beskrivelse: Kildestreng med flertalsformer. |
type is icu | Type: Beskrivelse: Kildestreng med ICU. |
type is asset | Type: Beskrivelse: Kildestreng er et aktiv. |
text | Type: Beskrivelse: Kildestrengstekst. |
identifier | Type: Beskrivelse: Kildestrengidentifikator (nøgle). |
context | Type: Beskrivelse: Kildestrengskontekst. |
max length | Type: Description: The source string max.length. |
is visible | Type: Beskrivelse: Kildestreng er synlig. |
is hidden | Type: Beskrivelse: Kildestreng er skjult. |
is duplicate | Type: Description: The source string is duplicate. |
isPassedWorkflow | Type: Description: Crowdin Enterprise only. The source string passed through a project workflow. |
file | Type: Description: The source string file. |
comments | Type: Beskrivelse: Kildestrengskommentarer. |
has issue | Type: Beskrivelse: Kildestreng med en problematik. |
has unresolved issue | Type: Beskrivelse: Kildestreng med en uløst problematik. |
user | Type: Description: Numeric identifier of the user who added a comment. |
screenshots | Type: Beskrivelse: Kildestrengsskærmfotos. |
translations | Type: Oversættelse Kildestrengsoversættelse. |
text | Type: Beskrivelse: Oversættelsestekst. |
plural form | Type: Beskrivelse: Oversættelse i flertalsform. |
is pre translated | Type: Description: Translation added via pre-translation. |
provider | Type: Allowed values: Description: Translation provided via translation memory or machine translation engine. |
language | Type: Description: Language identifier specified as a string. Use the language codes, for example, |
user | Type: Description: Numeric identifier of the user who added a translation. |
votes | Type: Beskrivelse: Rækken af stemmerne tilføjet oversættelsen. |
is up | Type: Beskrivelse: Upvote. |
is down | Type: Beskrivelse: Downvote. |
user | Type: Description: Numeric identifier of the user who added a vote for translation. |
added | Type: Beskrivelse: Dato for, hvornår der blev stemt på en oversættelse. |
approvals | Type: Beskrivelse: Rækken af de tilføjede oversættelsesgodkendelser. |
user | Type: Description: Numeric identifier of the user who approved a translation. |
added | Type: Beskrivelse: Dato for, hvornår en oversættelse blev godkendt. |
updated | Type: Beskrivelse: Dato for, hvornår en oversættelse blev opdateret. |
languages summary | Type: Description: The source string top translations (the translations with the highest priority). |
language | Type: Description: Language identifier specified as a string. Use the language codes, for example, |
is translated | Type: Description: The source string is translated. |
is partially translated | Type: Description: The source string is partially translated. |
is approved | Type: Description: The source string is approved. |
is partially approved | Type: Description: The source string is partially approved. |
translation updated | Type: Description: The source string translation is updated. |
is auto translated | Type: Description: The source string is translated by TM or MT. |
is translated by tm | Type: Description: The source string is translated by TM. |
is translated by mt | Type: Description: The source string is translated by MT. |
is source changed after translation | Type: Description: The source string changed after translation. |
has translation as source | Type: Description: The source string has translation equal to source text. |
has translation after approval | Type: Description: The source string has translation after approval. |
has shared translation | Type: Description: The source string duplicate has shared translations from a master string. |
has qa issues | Type: Description: The source string has QA issues. |
has empty translation qa issues | Type: Description: The source string has empty translation QA issues. |
has translation length qa issues | Type: Description: The source string has translation length QA issues. |
has tags mismatch qa issues | Type: Description: The source string has tags mismatch QA issues. |
has spaces mismatch qa issues | Type: Description: The source string has spaces mismatch QA issues. |
has variables mismatch qa issues | Type: Description: The source string has variables mismatch QA issues. |
has punctuation mismatch qa issues | Type: Description: The source string has punctuation mismatch QA issues. |
has character case mismatch qa issues | Type: Description: The source string has character case mismatch QA issues. |
has special characters mismatch qa issues | Type: Description: The source string has special characters mismatch QA issues. |
has incorrect translation qa issues | Type: Description: The source string has incorrect translation QA issues. |
has spelling qa issues | Type: Description: The source string has spelling QA issues. |
has icu syntax qa issues | Type: Description: The source string has ICU syntax QA issues. |
has terms qa issues | Type: Description: The source string has terms QA issues. |
has duplicate translation qa issues | Type: Description: The source string has duplicate translation QA issues. |
has ftl syntax qa issues | Type: Description: The source string has FTL syntax QA issues. |
has android syntax qa issues | Type: Description: The source string has Android syntax QA issues. |
has custom qa issues | Type: Description: The source string has Custom QA issues. |
rating | Type: Description: The source string translation rating. |
approvalsCount | Type: Description: The number of translation approvals. |
labels | Type: Description: The source string labels. |
id | Type: Description: Numeric identifier of the label. |
title | Type: Description: Label title. |
is system | Type: Description: System label (label with source file name that is automatically added to strings in string-based projects). |
added | Type: Beskrivelse: Dato for, hvornår en kildestreng blev tilføjet. |
updated | Type: Beskrivelse: Dato for, hvornår en kildestreng blev opdateret. |
{
"text": "Швидкий старт",
"plural form": "none",
"is pre translated": true,
"provider": "tm",
"user": 1,
"votes": [
{
"is up": true,
"is down": false,
"user": 2,
"added": "2021-04-09 13:44:14"
}
],
"approvals": [
{
"user": 2,
"added": "2021-04-09 13:44:14"
}
],
"updated": "2021-04-09 10:23:17"
}
text | Type: Beskrivelse: Oversættelsestekst. |
plural form | Type: Beskrivelse: Oversættelse i flertalsform. |
is pre translated | Type: Description: Translation added via pre-translation. |
provider | Type: Allowed values: Description: Translation provided via translation memory or machine translation engine. |
user | Type: Description: Numeric identifier of the user who added a translation. |
votes | Type: Beskrivelse: Rækken af stemmerne tilføjet oversættelsen. |
is up | Type: Beskrivelse: Upvote. |
is down | Type: Beskrivelse: Downvote. |
user | Type: Description: Numeric identifier of the user who added a vote for translation. |
added | Type: Beskrivelse: Dato for, hvornår der blev stemt på en oversættelse. |
approvals | Type: Beskrivelse: Rækken af de tilføjede oversættelsesgodkendelser. |
user | Type: Description: Numeric identifier of the user who approved a translation. |
added | Type: Beskrivelse: Dato for, hvornår en oversættelse blev godkendt. |
updated | Type: Beskrivelse: Dato for, hvornår en oversættelse blev opdateret. |
{
"records": [
{
"id": 1,
"text": "Перекладений текст",
"usageCount": 77,
"createdBy": 1,
"updatedBy": 1,
"createdAt": "2027-09-16T13:48:04+00:00",
"updatedAt": "2027-09-16T13:48:04+00:00"
}
]
}
records | Type: Description: Array of translation memory segment records. |
id | Type: Description: Numeric identifier of a record. |
text | Type: Description: Translation text of a record. |
usageCount | Type: Description: The number of times a translation memory record has been used. |
createdBy | Type: Description: Numeric identifier of the user who created a translation memory record. |
updatedBy | Type: Description: Numeric identifier of the user who updated a translation memory record. |
createdAt | Type: Description: Date when a translation memory record was created. |
updatedAt | Type: Description: Date when a translation memory record was updated. |