Message-ID: <1179456988.3352.1485852793053.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3351_1934725923.1485852793053" ------=_Part_3351_1934725923.1485852793053 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html ez_trans_prop

ez_trans_prop

=20 =20

Description

ez_trans_prop() is a generic, low level Twig helper which c= orrects the translated value of a multi valued(translations) property. = ;

If the current language cannot be found as a translation for content, the m= ain language (see=20 further down for d= etails) will be used if this is supported by the provided=20 object. This behavior is identical when  forcing a language using  forcedLanguage.

Prototype and Arguments

ez_trans_prop( ValueObject obje= ct, string property[, string&nbs= p;forcedLanguage)

Argument name Type Description
object eZ\Publish\Core\Repository\V= alues\ValueObject ValueObject object property belongs to.
property string Property to get translated value f= rom, logic is using one of the following (in this order):
  • object method "get{property}" 
  • object property  "{property}s"
forcedLanguage string Optional language we want to force= (e.g. "eng-US"), otherwise takes prioritized languag= es from SiteAccess settings.

Main language use

Main language is attempted to be applied in the following way for V= alue objects that support this:

Usage

Example below shows how this function can be used to get the Content nam= e with exact same result as using ez_content_name(content)

=20
{{ ez_trans_prop( versionInfo, "name" ) }}
=20

Example for ContentType->names:

=20
{{ ez_trans_prop( contentType, "name" ) }}
=20

 

 

------=_Part_3351_1934725923.1485852793053--