PHP Developers Network
http://forums.devnetwork.net/

Where is general.phrase.overview-for coming from in bolt ?
http://forums.devnetwork.net/viewtopic.php?f=72&t=143031
Page 1 of 1

Author:  gautamz07 [ Mon Oct 10, 2016 11:34 pm ]
Post subject:  Where is general.phrase.overview-for coming from in bolt ?

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.

Syntax: [ Download ] [ Hide ]
{% 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:

Syntax: [ Download ] [ Hide ]
{{ __('general.phrase.overview-for') }}


The above line i believe outputs some content. But what exactly does
Syntax: [ Download ] [ Hide ]
general.phrase.overview-for
mean and where is it coming from ??

Author:  requinix [ Tue Oct 11, 2016 12:29 am ]
Post subject:  Re: Where is general.phrase.overview-for coming from in bolt

I don't know bolt, but functions named __ are typically for translations. Is there a place where those are defined?

Author:  gautamz07 [ Tue Oct 11, 2016 10:28 am ]
Post subject:  Re: Where is general.phrase.overview-for coming from in bolt

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:

Syntax: [ Download ] [ Hide ]
{{ __('general.phrase.overview-for') }}


what is general.phrase.overview-for ?

BTW , i think celauran uses bolt , so he might have a clue :D

Author:  requinix [ Tue Oct 11, 2016 11:32 am ]
Post subject:  Re: Where is general.phrase.overview-for coming from in bolt

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.

Author:  gautamz07 [ Tue Oct 11, 2016 11:36 am ]
Post subject:  Re: Where is general.phrase.overview-for coming from in bolt

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

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/