The EllisLab documentation on search results includes an interesting code snippet:

<table border="0" cellpadding="6" cellspacing="1" width="100%">
    <tr>
        <th>{lang:title}</th>
        <th>{lang:excerpt}</th>
        <th>{lang:author}</th>
        <th>{lang:date}</th>
        <th>{lang:total_comments}</th>
        <th>{lang:recent_comments}</th>
    </tr>
 (...)

Source: http://ellislab.com/expressionengine/user-guide/modules/search/results.html

I'm trying to find documentation on how to use {lang:...} and where the values come from. Taking recent_comments as an example, I'm not finding it in any of the lang files. My attempt to take one from the English core_lang.php (system_off_msg) didn't work either.

Any thoughts? Was this just a placeholder in the documentation?

up vote 1 down vote accepted

These special variables are only used in the Member module and Search module on the front-end - they won't be parsed anywhere else. Why, I do not know.

To see what they correspond with, take a look at this snippet from the Search module code:

// Parse lang variables
        $swap = array(
            'lang:total_search_results' =>  lang('search_total_results'),
            'lang:search_engine'        =>  lang('search_engine'),
            'lang:search_results'       =>  lang('search_results'),
            'lang:search'               =>  lang('search'),
            'lang:title'                =>  lang('search_title'),
            'lang:channel'              =>  lang('search_channel'),
            'lang:excerpt'              =>  lang('search_excerpt'),
            'lang:author'               =>  lang('search_author'),
            'lang:date'                 =>  lang('search_date'),
            'lang:total_comments'       =>  lang('search_total_comments'),
            'lang:recent_comments'      =>  lang('search_recent_comment_date'),
            'lang:keywords'             =>  lang('search_keywords')
        );

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.