original_string: public function getTranslatableData(LocaleEntity $locale, TranslatableEntity $translatable, PackageVersionEntity $packageVersion = null, $initial = false)
      {
          $result = [
              'id' => $translatable->getID(),
              'translations' => $this->getTranslations($locale, $translatable),
          ];
          if ($initial) {
              $place = ($packageVersion === null) ? null : $this->app->make(TranslatablePlaceRepository::class)->findOneBy(['packageVersion' => $packageVersion, 'translatable' => $translatable]);
              if ($place !== null) {
                  $extractedComments = $place->getComments();
                  $references = $this->expandReferences($place->getLocations(), $packageVersion);
              } else {
                  $extractedComments = [];
                  $references = [];
              }
              $result['extractedComments'] = $extractedComments;
              $result['references'] = $references;
              $result['extractedComments'] = ($place === null) ? [] : $place->getComments();
              $result['comments'] = $this->getComments($locale, $translatable);
              $result['suggestions'] = $this->getSuggestions($locale, $translatable);
              $result['glossary'] = $this->getGlossaryTerms($locale, $translatable);
          }
  
          return $result;
      }
code: public function getTranslatableData(LocaleEntity $locale, TranslatableEntity $translatable, PackageVersionEntity $packageVersion = null, $initial = false)
      {
          $result = [
              'id' => $translatable->getID(),
              'translations' => $this->getTranslations($locale, $translatable),
          ];
          if ($initial) {
              $place = ($packageVersion === null) ? null : $this->app->make(TranslatablePlaceRepository::class)->findOneBy(['packageVersion' => $packageVersion, 'translatable' => $translatable]);
              if ($place !== null) {
                  $extractedComments = $place->getComments();
                  $references = $this->expandReferences($place->getLocations(), $packageVersion);
              } else {
                  $extractedComments = [];
                  $references = [];
              }
              $result['extractedComments'] = $extractedComments;
              $result['references'] = $references;
              $result['extractedComments'] = ($place === null) ? [] : $place->getComments();
              $result['comments'] = $this->getComments($locale, $translatable);
              $result['suggestions'] = $this->getSuggestions($locale, $translatable);
              $result['glossary'] = $this->getGlossaryTerms($locale, $translatable);
          }
  
          return $result;
      }
code_tokens: public function getTranslatableData ( LocaleEntity $ locale , TranslatableEntity $ translatable , PackageVersionEntity $ packageVersion = null , $ initial = false ) { $ result = [ 'id' => $ translatable -> getID ( ) , 'translations' => $ this -> getTranslations ( $ locale , $ translatable ) , ] ; if ( $ initial ) { $ place = ( $ packageVersion === null ) ? null : $ this -> app -> make ( TranslatablePlaceRepository :: class ) -> findOneBy ( [ 'packageVersion' => $ packageVersion , 'translatable' => $ translatable ] ) ; if ( $ place !== null ) { $ extractedComments = $ place -> getComments ( ) ; $ references = $ this -> expandReferences ( $ place -> getLocations ( ) , $ packageVersion ) ; } else { $ extractedComments = [ ] ; $ references = [ ] ; } $ result [ 'extractedComments' ] = $ extractedComments ; $ result [ 'references' ] = $ references ; $ result [ 'extractedComments' ] = ( $ place === null ) ? [ ] : $ place -> getComments ( ) ; $ result [ 'comments' ] = $ this -> getComments ( $ locale , $ translatable ) ; $ result [ 'suggestions' ] = $ this -> getSuggestions ( $ locale , $ translatable ) ; $ result [ 'glossary' ] = $ this -> getGlossaryTerms ( $ locale , $ translatable ) ; } return $ result ; }
docstring: Returns the data to be used in the editor when editing a string.
  
  @param LocaleEntity $locale the current editor locale
  @param TranslatableEntity $translatable the source string that's being translated
  @param PackageVersionEntity $packageVersion the package version where this string is used
  @param bool $initial set to true when a string is first loaded, false after it has been saved
  
  @return array
docstring_tokens: Returns the data to be used in the editor when editing a string .