Where is general.phrase.overview-for coming from in bolt ?

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Where is general.phrase.overview-for coming from in bolt ?

Post by gautamz07 »

I was just going through the default twig theme files in bolt CMS and came across the following lines of code , in the listing.twig file.

Code: Select all

{% if taxonomytype is defined %}
            <h1>
                {{ __('general.phrase.overview-for') }}
                {% if taxonomy.options[slug] is defined %}
                    {{ taxonomy.options[slug] }}
                {% else %}
                    {{ slug }}
                {% endif %}
            </h1>
            {# Taxonomies are fetched unordered by design except if 'has_sortorder'
               is set to true. This way we keep 'grouping' intact in the listing. #}
            {% if not taxonomy.has_sortorder %}
                {# If we specified an order in config.yml, sort them here, accordingly: #}
                {% set records = records|order(app.config.get('general/listing_sort')) %}
            {% endif %}
        {% endif %}
My doubt is about the below line of code:

Code: Select all

{{ __('general.phrase.overview-for') }}
The above line i believe outputs some content. But what exactly does

Code: Select all

general.phrase.overview-for
mean and where is it coming from ??
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Where is general.phrase.overview-for coming from in bolt

Post by requinix »

I don't know bolt, but functions named __ are typically for translations. Is there a place where those are defined?
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: Where is general.phrase.overview-for coming from in bolt

Post by gautamz07 »

requinix ,somebody actually answered that question on SO here : http://stackoverflow.com/a/39970060/4381665,

I still dont understand what it is being used for.

Also in the below line of code:

Code: Select all

{{ __('general.phrase.overview-for') }}
what is general.phrase.overview-for ?

BTW , i think celauran uses bolt , so he might have a clue :D
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Where is general.phrase.overview-for coming from in bolt

Post by requinix »

If you know the answer to "what is __" then you should know what the answer to "what is it being used for". Hint: it's the same answer.

"general.phrase.overview-for" is the identifier for the string.

Or wait for Celauran. Whatever.
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: Where is general.phrase.overview-for coming from in bolt

Post by gautamz07 »

actually i did't quite understand the usage of __ too :(
Post Reply