Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-12-24 14:23:29

jeroen
Member
From: brussels.be
Registered: 2012-06-15
Posts: 16

[solved] my bad... // strings don't get enumerated by MLP

Hello,

I’ve been staring at this for too long. Maybe your fresh set of eyes can spot what’s broken?

I’m writing a site specific plugin where I would like to add MLP support.
I’m following the guidelines set forth in the “Making your plugin MLP compatible.txt” file.

I'm currently working in my plugins folder, with the plugin split over a few files. I don't use any include or requires to load these files as I noticed they all get loaded anyhow.

Apart from that I think I’m doing everything by the book.
Still no strings added to my MLP snippets.

My gTxt function works with the default language (loaded from the global variable).

Any ideas?


define( 'TIN_CMCAL_PREFIX' , 'tin_cmcal' );
global $tin_cmcal_strings;
$tin_cmcal_strings = array(
    'month_1'  => 'January',
    'month_2'  => 'February',
    'day_1' => 'monday',
    'day_2' => 'tuesday',
    'available'   => 'available',
    'last-minute' => 'last-minute',
    'option'      => 'in option',
    'rented'      => 'rented' 
);
# Here's a callback routine used to register the above strings with
# the MLP Pack (if installed).
function tin_cmcal_enumerate_strings($event , $step='' , $pre=0)
  {
  global $tin_cmcal_strings;
  $r = array  (
        'owner'   => 'tin_cmcal', # Change to your plugin's name
        'prefix'  => TIN_CMCAL_PREFIX,      # Its unique string prefix
        'lang'    => 'en-gb',           # The language of the initial strings.
        'event'   => 'public',          # public/admin/common = which interface the strings will be loaded into
        'strings' => $tin_cmcal_strings,    # The strings themselves.
        );
  return $r;
  }
# Register the callback for the enumerate string event.
# If the MLP pack is not present and active this will NOT get called.
register_callback( 'tin_cmcal_enumerate_strings' , 'l10n.enumerate_strings' );

Above lines (and the gTxt function) live in a php file in my plugins folder: tin_cmcal_mlp.php

I’m using
Txp version: 4.5.4
MLP version: 4.5.2
PHP version: 5.3.6

Any and all help more than welcome!

Cheers,
Jeroen

EDIT: Changed title

Last edited by jeroen (2012-12-27 01:46:17)

Offline

#2 2012-12-27 01:45:24

jeroen
Member
From: brussels.be
Registered: 2012-06-15
Posts: 16

Re: [solved] my bad... // strings don't get enumerated by MLP

They’re there!

My bad, I was looking in the general Snippets tab, while I should have been looking at the plugins tab within MLP.

I’ve moved the support php files in to their own directory and @iclude them in the main file, if anybody’s interested :).

Cheers,
Jeroen

Offline

Board footer

Powered by FluxBB