crowdin-api-client-php icon indicating copy to clipboard operation
crowdin-api-client-php copied to clipboard

SourceString fails on pluralized string

Open glushkovds opened this issue 4 years ago • 3 comments

   TypeError 

  Return value of CrowdinApiClient\Model\SourceString::getText() must be of the type string, array returned

  at vendor/crowdin/crowdin-api-client/src/CrowdinApiClient/Model/SourceString.php:175
    171▕      * @return string
    172▕      */
    173▕     public function getText(): string
    174▕     {
  ➜ 175▕         return $this->text;
    176▕     }
    177▕ 
    178▕     /**
    179▕      * @param string $text

glushkovds avatar Nov 19 '21 09:11 glushkovds

Could you please supply some steps on how to recreate this error so that I can have a look

phillipsb22 avatar Oct 13 '22 19:10 phillipsb22

@phillipsb22 probably, you need to upload to your Crowdin project some file with plural strings (for example, android XML)

Then, call the List Strings or Get String API method

andrii-bodnar avatar Oct 13 '22 19:10 andrii-bodnar

Hi guys. You can reproduce this by adding pluralized string and then downloading it by SourceStringApi::list.

Here is api documentation: image

https://developer.crowdin.com/api/v2/#operation/api.projects.strings.post

glushkovds avatar Oct 14 '22 09:10 glushkovds