-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): Added support for ConcordanceSearch of TMs - partial completion of #122 #202
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DE-dylan-lauzon thanks for the contribution!
* [string] $params[expressions] | ||
* @return TranslationMemory | ||
*/ | ||
public function concordanceSearchTM(int $projectId, array $params = []): ?TranslationMemory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong return type. It should be Array of objects (TmConcordanceResultResource)
Thanks for the feedback!
I’m away for a couple weeks for the holidays but can fix that up when I’m
back.
Re the return value:
I chose TranslationMemory because I saw that value in Ray when I logged it
but I must be mistaken!
Sorry about the ru/uk thing, stupid auto-complete!
…On Mon, Dec 23, 2024 at 3:16 AM Andrii Bodnar ***@***.***> wrote:
***@***.**** commented on this pull request.
@DE-dylan-lauzon <https://github.com/DE-dylan-lauzon> thanks for the
contribution!
------------------------------
In src/CrowdinApiClient/Api/TranslationMemoryApi.php
<#202 (comment)>
:
> +
+ /**
+ * Concordance Search in TMs
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Translation-Memory/operation/api.projects.tms.concordance.post API Documentation
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Translation-Memory/operation/api.projects.tms.concordance.post API Documentation Enterprise
+ *
+ * @param int $projectId
+ * @param array $params
+ * string $params[sourceLanguageId]<br>
+ * integer $params[targetLanguageId]<br>
+ * boolean $params[autoSubstitution]<br>
+ * integer $params[minRelevant]: 40-100<br>
+ * [string] $params[expressions]
+ * @return TranslationMemory
+ */
+ public function concordanceSearchTM(int $projectId, array $params = []): ?TranslationMemory
⬇️ Suggested change
- public function concordanceSearchTM(int $projectId, array $params = []): ?TranslationMemory
+ public function concordanceSearch(int $projectId, array $params = []): ?TranslationMemory
------------------------------
In src/CrowdinApiClient/Api/TranslationMemoryApi.php
<#202 (comment)>
:
> +
+ /**
+ * Concordance Search in TMs
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Translation-Memory/operation/api.projects.tms.concordance.post API Documentation
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Translation-Memory/operation/api.projects.tms.concordance.post API Documentation Enterprise
+ *
+ * @param int $projectId
+ * @param array $params
+ * string $params[sourceLanguageId]<br>
+ * integer $params[targetLanguageId]<br>
+ * boolean $params[autoSubstitution]<br>
+ * integer $params[minRelevant]: 40-100<br>
+ * [string] $params[expressions]
+ * @return TranslationMemory
+ */
+ public function concordanceSearchTM(int $projectId, array $params = []): ?TranslationMemory
Wrong return type. It should be Array
of objects (TmConcordanceResultResource)
------------------------------
In tests/CrowdinApiClient/Api/TranslationMemoryApiTest.php
<#202 (comment)>
:
> @@ -303,4 +303,48 @@ public function testClear()
$this->mockRequestDelete('/tms/4/segments');
$this->crowdin->translationMemory->clear(4);
}
+
+ public function testConcordanceSearch()
+ {
+ $params = [
+ 'sourceLanguageId' => 'en',
+ 'targetLanguageId' => 'ru',
should be uk according to the response sample
—
Reply to this email directly, view it on GitHub
<#202 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLE35TG4UPQMYBRZIWHQX6T2G7BGPAVCNFSM6AAAAABT7S3IG6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMRQGA4DAMBWGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Co-authored-by: Andrii Bodnar <[email protected]>
…pi-client-php into feat-api/concordanceSearch
@DE-dylan-lauzon the |
Added support for ConcordanceSearch endpoint of TMs - partial completion of issue #122