Language not load

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
Trubs
Registered User
Posts: 6
Joined: Thu Oct 04, 2018 7:03 pm

Language not load

Post by Trubs » Sat Oct 06, 2018 2:55 pm

I have a language file:
ext/language/en/test.php:

Code: Select all

<?php
if (!defined('IN_PHPBB'))
{
    exit;
}

if (empty($lang) || !is_array($lang))
{
    $lang = array();
}

$lang = array_merge($lang, array(
    'TEST_LANG' => 'Test lang',
));
And template style:
ext/styles/all/tamplate/event/viewtopic_body_postrow_post_content_footer.html:

Code: Select all

Test: {L_TEST_LANG}
Why is the "{L_TEST_LANG}" not load from language file?

PS. If I add manualy {TEST_LANG} to language/en/viewtopic.php it works correct.
PS2. I have another langs in test.php and they load to ACP every time, just in this one case not.

User avatar
david63
Jr. Extension Validator
Posts: 14905
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Language not load

Post by david63 » Sat Oct 06, 2018 3:28 pm

Trubs wrote:
Sat Oct 06, 2018 2:55 pm
Why is the "{L_TEST_LANG}" not load from language file?
Are you actually loading that language file anywhere?

As templating is moving towards Twig sytax you would be better off creating your extension with that syntax.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Trubs
Registered User
Posts: 6
Joined: Thu Oct 04, 2018 7:03 pm

Re: Language not load

Post by Trubs » Sat Oct 06, 2018 3:30 pm

I found it and use Twig sytax. Now works correct. Maybe before I made some mistake.

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests