Usage examples
Learn how to work more efficiently with Phrase Strings API v2 with these workflow-oriented examples.
Find excluded translations with a certain content
List excluded translations for the given project which start with the term PhraseApp
.
Parameters
Name | Type | Description |
---|---|---|
sort (optional) | string | Sort criteria. Can be one of: key_name , created_at , updated_at .Default: key_name |
order (optional) | string | Order direction. Can be one of: asc , desc .Default: asc |
q (optional) | string | Specify a query to find translations by content (including wildcards). Note: Search is limited to 10,000 results and may not include recently updated data (depending on the project size). Supported qualifiers: - id:translation_id,... – comma-separated list of IDs- tags:XYZ – tag on the translation- unverified:{true|false} – verification status- reviewed:{true|false} – reviewed status- excluded:{true|false} – exclusion status- updated_at:{>=|<=}2013-02-21T00:00:00Z – date range queries |
Example Request
Find unverified translations with a certain content
List unverified translations for the given project which start with the term PhraseApp
and are not verified.
Parameters
Name | Type | Description |
---|---|---|
sort (optional) | string | Sort criteria. Can be one of: key_name , created_at , updated_at .Default: key_name |
order (optional) | string | Order direction. Can be one of: asc , desc .Default: asc |
q (optional) | string | Specify a query to find translations by content (including wildcards). Note: Search is limited to 10,000 results and may not include recently updated data (depending on the project size). Supported qualifiers: - id:translation_id,... – comma-separated list of IDs- tags:XYZ – tag on the translation- unverified:{true|false} – verification status- reviewed:{true|false} – reviewed status- excluded:{true|false} – exclusion status- updated_at:{>=|<=}2013-02-21T00:00:00Z – date range queries |
Example Request
Verify translations selected by query
Verify all translations that are matching the query my dog
.
Parameters
Name | Type | Description |
---|---|---|
q (optional) | string | Specify a query to find translations by content (including wildcards). Note: Search is limited to 10,000 results and may not include recently updated data (depending on the project size). Supported qualifiers: - id:translation_id,... – comma-separated list of IDs- tags:XYZ – tag on the translation- unverified:{true|false} – verification status- reviewed:{true|false} – reviewed status- excluded:{true|false} – exclusion status- updated_at:{>=|<=}2013-02-21T00:00:00Z – date range queries |
sort (optional) | string | Sort criteria. Can be one of: key_name , created_at , updated_at .Default: key_name |
order (optional) | string | Order direction. Can be one of: asc , desc .Default: asc |
Example Request
Find recently updated keys
Find updated keys with with the updated_at
qualifier like updated_at:>=2013-02-21T00:00:00Z
. This example returns keys that have been updated on or after 2013-02-21.
Parameters
Name | Type | Description |
---|---|---|
sort (optional) | string | Sort by field. Can be one of: name , created_at , updated_at .Default: name |
order (optional) | string | Order direction. Can be one of: asc , desc .Default: asc |
q (optional) | string | Specify a query to do broad search for keys by name (including wildcards). Supported qualifiers: - ids:key_id,... – queries on a comma-separated list of IDs- name:key_name,... – exact key names (comma-separated, escape spaces/commas/colons with \\ )- tags:tag_name,... – filter for keys with certain tags- uploads:upload_id,... – filter for keys with certain uploads- job:{true|false} – filter for keys mentioned in a job- translated:{true|false} – requires locale_id - updated_at:{>=|<=}2013-02-21T00:00:00Z – date range filtering- unmentioned_in_upload:upload_id – keys not mentioned in given upload |
locale_id (optional) | string | Locale used to determine the translation state of a key when filtering for untranslated or translated keys. |
Example Request
Find keys with a certain tag
Keys with certain tags can be filtered with the qualifier tags:
.
Parameters
Name | Type | Description |
---|---|---|
q (optional) | string | Specify a query to do broad search for keys by name (including wildcards). Supported qualifiers: - ids:key_id,... – queries on a comma-separated list of IDs- name:key_name,... – exact key names (comma-separated, escape spaces/commas/colons with \\ )- tags:tag_name,... – filter for keys with certain tags- uploads:upload_id,... – filter for keys with certain uploads- job:{true|false} – filter for keys mentioned in an active job- translated:{true|false} – requires locale_id - updated_at:{>=|<=}2013-02-21T00:00:00Z – filter by date- unmentioned_in_upload:upload_id – filter keys unmentioned in a specific upload |
Example Request
Add tags to collection of keys
Add the tags landing-page
and release-1.2
to all keys that start with dog
and are translated in the locale abcd1234abcd1234abcd1234abcd1234
.
Parameters
Name | Type | Description |
---|---|---|
q (optional) | string | Specify a query to do broad search for keys by name (including wildcards). Supported qualifiers: - ids:key_id,... – queries on a comma-separated list of IDs- name:key_name,... – exact key names (comma-separated, escape spaces/commas/colons with \\ )- tags:tag_name,... – filter for keys with certain tags- uploads:upload_id,... – filter for keys with certain uploads- job:{true|false} – filter for keys mentioned in an active job- translated:{true|false} – requires locale_id - updated_at:{>=|<=}2013-02-21T00:00:00Z – filter by date- unmentioned_in_upload:upload_id – filter keys unmentioned in a specific upload |
tags | string | Tag or comma-separated list of tags to add to the matching collection of keys |
locale_id (optional) | id | Locale used to determine the translation state of a key when filtering for untranslated or translated keys. |
Example Request
Remove tags from collection of keys
Remove the tags landing-page
and release-1.2
from all keys that start with dog
and are translated in the locale abcd1234abcd1234abcd1234abcd1234
.
Parameters
Name | Type | Description |
---|---|---|
q (optional) | string | Specify a query to do broad search for keys by name (including wildcards). Supported qualifiers: - ids:key_id,... – queries on a comma-separated list of IDs- name:key_name,... – exact key names (comma-separated, escape spaces/commas/colons with \\ )- tags:tag_name,... – filter for keys with certain tags- uploads:upload_id,... – filter for keys with certain uploads- job:{true|false} – filter for keys mentioned in an active job- translated:{true|false} – requires locale_id - updated_at:{>=|<=}2013-02-21T00:00:00Z – filter by date- unmentioned_in_upload:upload_id – filter keys unmentioned in a specific upload |
tags | string | Tag or comma-separated list of tags to remove from the matching collection of keys |
locale_id (optional) | id | Locale used to determine the translation state of a key when filtering for untranslated or translated keys. |
Example Request
Find keys with broad text match
Example query my dog
.
Parameters
Name | Type | Description |
---|---|---|
q (optional) | string | Specify a query to do broad search for keys by name (including wildcards). Supported qualifiers: - ids:key_id,... – queries on a comma-separated list of IDs- name:key_name,... – exact key names (comma-separated, escape spaces/commas/colons with \\ )- tags:tag_name,... – filter for keys with certain tags- uploads:upload_id,... – filter for keys with certain uploads- job:{true|false} – filter for keys mentioned in an active job- translated:{true|false} – requires locale_id - updated_at:{>=|<=}2013-02-21T00:00:00Z – date range filter- unmentioned_in_upload:upload_id – keys not mentioned in specific upload |
Matches
My dog is lazy my dog is lazy angry dog in my house
Example Request
Find keys with exact text match
Example query "my dog is lazy"
(note backslashes before any whitespace character in the example query)
Parameters
Name | Type | Description |
---|---|---|
q (optional) | string | Specify a query to do broad search for keys by name (including wildcards). Supported qualifiers: - ids:key_id,... – queries on a comma-separated list of IDs- name:key_name,... – exact key names (comma-separated, escape spaces/commas/colons with \\ )- tags:tag_name,... – filter for keys with certain tags- uploads:upload_id,... – filter for keys with certain uploads- job:{true|false} – filter for keys mentioned in an active job- translated:{true|false} – requires locale_id to be specified- updated_at:{>=|<=}2013-02-21T00:00:00Z – date range queries- unmentioned_in_upload:upload_id – filter keys unmentioned within upload |
Matches
My dog is lazy my dog is lazy angry dog in my house
Example Request
Find keys with wildcard character matching
Example query *dog is*
Parameters
Name | Type | Description |
---|---|---|
q (optional) | string | Specify a query to do broad search for keys by name (including wildcards). The following qualifiers are supported in the search term: - ids:key_id,... – queries on a comma-separated list of IDs- name:key_name,... – exact key names (comma-separated; escape spaces, commas, and colons with \\ )- tags:tag_name,... – filter for keys with certain tags- uploads:upload_id,... – filter for keys with certain uploads- job:{true|false} – filter for keys mentioned in an active job- translated:{true|false} – filter by translation status (requires locale_id )- updated_at:{>=|<=}2013-02-21T00:00:00Z – filter by date range- unmentioned_in_upload:upload_id – filter keys unmentioned within specific upload |
Matches
My dog is lazy my dog is lazy angry dog in my house
Example Request
Upload an Excel file with several translations
Suppose you have an excel file where the ‘A’ column contains the key names, the ‘B’ column contains English translations, the ‘C’ column contains German translations and the ‘D’ column contains comments. Furthermore, the actual content starts in the second row, since the first row is reserved for a header. You can upload this file and import all translations at once!
Parameters
Name | Type | Description |
---|---|---|
file | file | File to be imported |
file_format | string | File format. Auto-detected when possible and not specified. |
locale_mapping[en] | string | Name of the column containing translations for locale en . |
locale_mapping[de] | string | Name of the column containing translations for locale de . |
format_options[comment_column] | string | Name of the column containing descriptions for keys. |
format_options[tag_column] | string | Name of the column containing tags for keys. |
format_options[key_name_column] | string | Name of the column containing the names of the keys. |
format_options[first_content_row] | string | Name of the first row containing actual translations. |