Support ⇒ Dragonfly CMS v10 ⇒ Language file for custom block ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexDragonfly CMS v10

Language file for custom block Reply to topic


Where is the best place to define language for a custom block?
Is there a common file, or is there somewhere to create a file for each block?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


This should work:

/includes/l10n/en/blocks/custom_name.php
<?php $LNG = array( 'Hello' => 'Hello translated', 'World' => 'World translated', );

/blocks/block-Custom_name.php
<?php if (!defined('CPG_NUKE')) { exit; } $L10N->load('blocks/custom_name'); $content = $L10N['Hello'] . $L10N['world'];
Result should be: Hello translated world translated

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial

Last edited by DJ Maze on Tue May 08, 2018 2:53 am; edited 3 times in total


Great, thankyou.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are UTC


Jump to: