The |language modifier was added to allow the piping of the phrase through other functions. This has some unwanted side effects when used with plain strings that should not support variable interpolation. Another difference to {lang} is the evaluation on runtime rather than at compile time, allowing the phrase to be taken from a variable instead.
In general it is often used in places where a proper method exists, such as {$obj->title|language} instead of {$obj->getTitle()} and is more of a legacy leftover rather than an intentional use. However, we cannot change the semantics of the |language modifier without breaking compatibility, therefore we will introduce a new modifier and phase out the old one.
Related to #2976, #4107
The
|languagemodifier was added to allow the piping of the phrase through other functions. This has some unwanted side effects when used with plain strings that should not support variable interpolation. Another difference to{lang}is the evaluation on runtime rather than at compile time, allowing the phrase to be taken from a variable instead.In general it is often used in places where a proper method exists, such as
{$obj->title|language}instead of{$obj->getTitle()}and is more of a legacy leftover rather than an intentional use. However, we cannot change the semantics of the|languagemodifier without breaking compatibility, therefore we will introduce a new modifier and phase out the old one.|phraseas a thin wrapper around\wcf\system::WCF::getLanguage()->get().|languagemodifier and remove it in 6.0.|languagewith the proper method calls instead, for example, the aforementioned{$obj->getTitle()}.Related to #2976, #4107