Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-27428

As a developer I want to get translated API properties in the language I requested

    XMLWordPrintable

Details

    Description

      As a developer, if I specify which language to load from the API, when working with the returned API objects I expect these value objects to also take the language argument into account.

      Example

      Instead of this:

      $content = $this->contentService->loadContent(
          42,
          $this->configResolver->getParameter('languages')
      );
      
      
      $name = $content->getVersionInfo()->getName(
          $this->configResolver->getParameter('languages')[0]
      );
      // OR rather to take care of all languages: $this->translationHelper->getTranslatedContentName($content);
      
      $field = $this->translationHelper->getTranslatedField($content, 'body');
      $value = $field->value;
      

      I would prefer this:

      $content = $this->contentService->loadContent(
          42,
          $this->configResolver->getParameter('languages')
      );
      
      
      $name = $content->getVersionInfo()->getName();
      $value = $content->getFieldValue('body')
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            andre.romcke-obsolete@ez.no André Rømcke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: