From 1aaf099515de7b6420d6c674e0f081dc53615903 Mon Sep 17 00:00:00 2001 From: Phrase Date: Wed, 2 Oct 2024 12:17:44 +0000 Subject: [PATCH] Deploying from phrase/openapi@9c9c9598 --- docs/KeyCreateParameters.md | 2 +- docs/KeyUpdateParameters.md | 2 +- docs/LocalesApi.md | 4 ++++ docs/ProjectCreateParameters.md | 2 +- docs/ProjectUpdateParameters.md | 2 +- docs/ScreenshotUpdateParameters.md | 2 +- docs/UploadsApi.md | 4 +++- lib/phrase/api/locales_api.rb | 6 ++++++ lib/phrase/api/uploads_api.rb | 3 +++ 9 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/KeyCreateParameters.md b/docs/KeyCreateParameters.md index c17f5fa..493b78f 100644 --- a/docs/KeyCreateParameters.md +++ b/docs/KeyCreateParameters.md @@ -35,7 +35,7 @@ instance = Phrase::KeyCreateParameters.new(branch: my-feature-branch, data_type: number, tags: awesome-feature,needs-proofreading, max_characters_allowed: 140, - screenshot: [B@39876e1f, + screenshot: [B@210d1b45, remove_screenshot: null, unformatted: null, default_translation_content: Default translation content, diff --git a/docs/KeyUpdateParameters.md b/docs/KeyUpdateParameters.md index f14f3c4..4f6eb1c 100644 --- a/docs/KeyUpdateParameters.md +++ b/docs/KeyUpdateParameters.md @@ -34,7 +34,7 @@ instance = Phrase::KeyUpdateParameters.new(branch: my-feature-branch, data_type: number, tags: awesome-feature,needs-proofreading, max_characters_allowed: 140, - screenshot: [B@1c8ab147, + screenshot: [B@29862f60, remove_screenshot: null, unformatted: null, xml_space_preserve: null, diff --git a/docs/LocalesApi.md b/docs/LocalesApi.md index 6daec8e..94dd9ee 100644 --- a/docs/LocalesApi.md +++ b/docs/LocalesApi.md @@ -253,6 +253,8 @@ opts = { use_last_reviewed_version: true, # Boolean | If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project. fallback_locale_id: 'fallback_locale_id_example', # String | If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to true. source_locale_id: 'source_locale_id_example', # String | Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a tag parameter indicating a specific job. + translation_key_prefix: 'prefix_', # String | Download all translation keys, and remove the specified prefix where possible. Warning: this may create duplicate key names if other keys share the same name after the prefix is removed. + filter_by_prefix: true, # Boolean | Only download translation keys containing the specified prefix, and remove the prefix from the generated file. custom_metadata_filters: { key: 3.56} # Object | Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download. } @@ -291,6 +293,8 @@ Name | Type | Description | Notes **use_last_reviewed_version** | **Boolean**| If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project. | [optional] **fallback_locale_id** | **String**| If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>. | [optional] **source_locale_id** | **String**| Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a <code>tag</code> parameter indicating a specific job. | [optional] + **translation_key_prefix** | **String**| Download all translation keys, and remove the specified prefix where possible. Warning: this may create duplicate key names if other keys share the same name after the prefix is removed. | [optional] + **filter_by_prefix** | **Boolean**| Only download translation keys containing the specified prefix, and remove the prefix from the generated file. | [optional] **custom_metadata_filters** | [**Object**](.md)| Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download. | [optional] ### Return type diff --git a/docs/ProjectCreateParameters.md b/docs/ProjectCreateParameters.md index 3bb064a..e8d096f 100644 --- a/docs/ProjectCreateParameters.md +++ b/docs/ProjectCreateParameters.md @@ -37,7 +37,7 @@ instance = Phrase::ProjectCreateParameters.new(name: My Android Project, main_format: yml, media: Python, shares_translation_memory: true, - project_image: [B@9bd7c1, + project_image: [B@776609b, remove_project_image: null, account_id: abcd1234, point_of_contact: abcd1234, diff --git a/docs/ProjectUpdateParameters.md b/docs/ProjectUpdateParameters.md index 271051e..839edd5 100644 --- a/docs/ProjectUpdateParameters.md +++ b/docs/ProjectUpdateParameters.md @@ -38,7 +38,7 @@ instance = Phrase::ProjectUpdateParameters.new(account_id: abcd1234, main_format: yml, media: Python, shares_translation_memory: true, - project_image: [B@6028b018, + project_image: [B@58da1b27, remove_project_image: false, workflow: review, machine_translation_enabled: true, diff --git a/docs/ScreenshotUpdateParameters.md b/docs/ScreenshotUpdateParameters.md index 8b906ce..965be0e 100644 --- a/docs/ScreenshotUpdateParameters.md +++ b/docs/ScreenshotUpdateParameters.md @@ -17,7 +17,7 @@ require 'Phrase' instance = Phrase::ScreenshotUpdateParameters.new(branch: my-feature-branch, name: A screenshot name, description: A screenshot description, - filename: [B@67fc98fe) + filename: [B@154bc3cf) ``` diff --git a/docs/UploadsApi.md b/docs/UploadsApi.md index d4401c9..961fcdb 100644 --- a/docs/UploadsApi.md +++ b/docs/UploadsApi.md @@ -55,7 +55,8 @@ opts = { format_options: { ... }, # Object | Additional options available for specific formats. See our format guide for complete list. autotranslate: true, # Boolean | If set, translations for the uploaded language will be fetched automatically. mark_reviewed: true, # Boolean | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. - tag_only_affected_keys: true # Boolean | Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false` + tag_only_affected_keys: true, # Boolean | Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false` + translation_key_prefix: 'translation_key_prefix_example' # String | This prefix will be added to all uploaded translation key names to prevent collisions. Use a meaningful prefix related to your project or file to keep key names organized. } begin @@ -92,6 +93,7 @@ Name | Type | Description | Notes **autotranslate** | **Boolean**| If set, translations for the uploaded language will be fetched automatically. | [optional] **mark_reviewed** | **Boolean**| Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. | [optional] **tag_only_affected_keys** | **Boolean**| Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false` | [optional] [default to false] + **translation_key_prefix** | **String**| This prefix will be added to all uploaded translation key names to prevent collisions. Use a meaningful prefix related to your project or file to keep key names organized. | [optional] ### Return type diff --git a/lib/phrase/api/locales_api.rb b/lib/phrase/api/locales_api.rb index 17e7e84..62f2b73 100644 --- a/lib/phrase/api/locales_api.rb +++ b/lib/phrase/api/locales_api.rb @@ -250,6 +250,8 @@ def locale_delete_with_http_info(project_id, id, opts = {}) # @option opts [Boolean] :use_last_reviewed_version If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project. # @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>. # @option opts [String] :source_locale_id Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a <code>tag</code> parameter indicating a specific job. + # @option opts [String] :translation_key_prefix Download all translation keys, and remove the specified prefix where possible. Warning: this may create duplicate key names if other keys share the same name after the prefix is removed. + # @option opts [Boolean] :filter_by_prefix Only download translation keys containing the specified prefix, and remove the prefix from the generated file. # @option opts [Object] :custom_metadata_filters Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download. # @return [File] def locale_download(project_id, id, opts = {}) @@ -281,6 +283,8 @@ def locale_download(project_id, id, opts = {}) # @option opts [Boolean] :use_last_reviewed_version If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project. # @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>. # @option opts [String] :source_locale_id Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a <code>tag</code> parameter indicating a specific job. + # @option opts [String] :translation_key_prefix Download all translation keys, and remove the specified prefix where possible. Warning: this may create duplicate key names if other keys share the same name after the prefix is removed. + # @option opts [Boolean] :filter_by_prefix Only download translation keys containing the specified prefix, and remove the prefix from the generated file. # @option opts [Object] :custom_metadata_filters Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download. # @return [Array<(Response<(File)>, Integer, Hash)>] Response<(File)> data, response status code and response headers def locale_download_with_http_info(project_id, id, opts = {}) @@ -316,6 +320,8 @@ def locale_download_with_http_info(project_id, id, opts = {}) query_params[:'use_last_reviewed_version'] = opts[:'use_last_reviewed_version'] if !opts[:'use_last_reviewed_version'].nil? query_params[:'fallback_locale_id'] = opts[:'fallback_locale_id'] if !opts[:'fallback_locale_id'].nil? query_params[:'source_locale_id'] = opts[:'source_locale_id'] if !opts[:'source_locale_id'].nil? + query_params[:'translation_key_prefix'] = opts[:'translation_key_prefix'] if !opts[:'translation_key_prefix'].nil? + query_params[:'filter_by_prefix'] = opts[:'filter_by_prefix'] if !opts[:'filter_by_prefix'].nil? query_params[:'custom_metadata_filters'] = opts[:'custom_metadata_filters'] if !opts[:'custom_metadata_filters'].nil? # header parameters diff --git a/lib/phrase/api/uploads_api.rb b/lib/phrase/api/uploads_api.rb index 6eb7c74..126bbcd 100644 --- a/lib/phrase/api/uploads_api.rb +++ b/lib/phrase/api/uploads_api.rb @@ -30,6 +30,7 @@ def initialize(api_client = ApiClient.default) # @option opts [Boolean] :autotranslate If set, translations for the uploaded language will be fetched automatically. # @option opts [Boolean] :mark_reviewed Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. # @option opts [Boolean] :tag_only_affected_keys Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false` (default to false) + # @option opts [String] :translation_key_prefix This prefix will be added to all uploaded translation key names to prevent collisions. Use a meaningful prefix related to your project or file to keep key names organized. # @return [Upload] def upload_create(project_id, file, file_format, locale_id, opts = {}) data, _status_code, _headers = upload_create_with_http_info(project_id, file, file_format, locale_id, opts) @@ -59,6 +60,7 @@ def upload_create(project_id, file, file_format, locale_id, opts = {}) # @option opts [Boolean] :autotranslate If set, translations for the uploaded language will be fetched automatically. # @option opts [Boolean] :mark_reviewed Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. # @option opts [Boolean] :tag_only_affected_keys Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false` + # @option opts [String] :translation_key_prefix This prefix will be added to all uploaded translation key names to prevent collisions. Use a meaningful prefix related to your project or file to keep key names organized. # @return [Array<(Response<(Upload)>, Integer, Hash)>] Response<(Upload)> data, response status code and response headers def upload_create_with_http_info(project_id, file, file_format, locale_id, opts = {}) if @api_client.config.debugging @@ -114,6 +116,7 @@ def upload_create_with_http_info(project_id, file, file_format, locale_id, opts form_params['autotranslate'] = opts[:'autotranslate'] if !opts[:'autotranslate'].nil? form_params['mark_reviewed'] = opts[:'mark_reviewed'] if !opts[:'mark_reviewed'].nil? form_params['tag_only_affected_keys'] = opts[:'tag_only_affected_keys'] if !opts[:'tag_only_affected_keys'].nil? + form_params['translation_key_prefix'] = opts[:'translation_key_prefix'] if !opts[:'translation_key_prefix'].nil? # http body (model) post_body = opts[:body]