Updates from April, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • Paul Gibbs 8:27 pm on April 8, 2010 Permalink | Reply
    Tags: ,   

    Hijacking WordPress Internationalisation 

    As part of a new feature I am developing for the next release of my Welcome Pack plugin for BuddyPress, I needed a really smart way of dynamically adding my own translations for strings at page-load time; creating a stand-alone .mo file to load the strings wasn’t a great solution, for reasons of requiring people to know how to configure file permissions on the server, having to figure out how to write a .mo file (I wish they were as easy as XML, but they aren’t), and — honestly — doing it that way feels like such a hack.

    (More …)

     
    • Ray 6:18 am on May 14, 2010 Permalink | Reply

      Hey Paul,

      Was meaning to reply to this the other day, but got sidetracked!
      Just tried it and it does what I want it to do, except for one instance.

      I’m trying to override a string that BP uses on an AJAX request (in my case, when a private message is sent, BP outputs a message).

      I’ve tried overriding the string by hooking into the “init” action, but not sure if this is the correct action I should be hooking into.

      Here’s the full function:


      function ray_override_l10n() {
      global $l10n;

      $mo = new MO();

      $l10n['buddypress'] = &$mo;

      if ( isset( $l10n['buddypress'] ) ) {
      $l10n['buddypress']->entries['There was an error sending that message, please try again']->translations[0] = 'You are not friends with the person(s) you are attempting to send a message to. Your message has not been sent.';

      $l10n['buddypress']->entries['There was a problem sending that reply. Please try again.']->translations[0] = 'You are not friends with the person(s) you are attempting to send a message to. Your message has not been sent.';
      }
      }
      add_action( 'init', 'ray_override_l10n' );

      Any ideas?

      • Paul Gibbs 7:18 am on May 14, 2010 Permalink | Reply

        For Welcome Pack’s email feature, I use the above technique and have it hooked in like so:

        add_action( 'init', 'dpw_load_dynamic_i18n', 9 );

        Have a look dpw_load_dynamic_i18n() in Welcome Pack’s core.php. It is a bit hard to read as there’s a pair of nested FOR loops, but would suggest you use MO->add_entry() etc rather than write directly to the arrays. I think I switched to doing that after I wrote the above post.

    • Ray 8:10 am on May 14, 2010 Permalink | Reply

      Paul, thanks for the moment of clarity!
      Of course it has to do with setting the priority for the init action! *slaps head*

      Thanks also for the add_entry() tidbit, I’ll look into that!

  • Paul Gibbs 3:39 pm on February 7, 2010 Permalink | Reply  

    How to get a list of BuddyPress' actions. 

    As part of research for a new version of my Achievements plugin for BuddyPress, I need a list of all the BuddyPress action names.

    For non-developers, actions are the hooks that WordPress & BuddyPress launches at specific points during execution, or when specific events occur. This allows plugin developers to hook into these events and do whatever they want.
    (More …)

     
    • Edward de Leau 9:06 pm on February 18, 2010 Permalink | Reply

      When I activated your plugin none of the “javascript” option in the admin area worked anymore e.g. dragging of widgets, the “screen” button at the top and so on. I took me some to figure out what it exactly was. So I just wanted to share this with you.

      • DJPaul 10:09 pm on February 18, 2010 Permalink | Reply

        Hi Edward
        Do you mean Welcome Pack? If so are you able to try version 1.63 and see if problem still exists?

    • Tom 9:02 pm on March 1, 2010 Permalink | Reply

      Will you update the Achievements plugin for Buddypress 1.2?

      • DJPaul 9:20 pm on March 1, 2010 Permalink | Reply

        Hi Tom

        Yes, I am working a new version currently. I’m rewriting big chunks of functionality rather than just updating for BP 1.2, so it looks like it will be a few weeks until I have a beta ready.

        • Tom 9:07 pm on March 3, 2010 Permalink

          Appreciate the reply! Very good to hear it, can’t wait!

    • AD7six 1:20 pm on April 20, 2010 Permalink | Reply

      Hi Paul,

      Is your achievements plugin source in a svn/git repo somewhere? I’ve been writing something very similar – well, almost identical – and I’ll probably merge the two. I’ve already been looking at fixing the reference to deprecated/removed buddy press functions.

      Cheers,

      AD

    • AD7six 10:23 am on April 26, 2010 Permalink | Reply

      Paul,

      Cool – do you have an eta or a todo list or whatever? I can lend a hand if I know what direction you’re going in.

      AD

      • Paul Gibbs 12:23 pm on April 26, 2010 Permalink | Reply

        Sounds great — as soon as I finish up my current client projects, i’m going to dive in and focus only on Achievements, so I’ll do a post when that happens to update.

  • Paul Gibbs 9:05 am on September 8, 2009 Permalink | Reply
    Tags:   

    Six Little Habits: The Bad Ones. 

    Over at sixuntilme, Kerri’s listed six of her diabetes “bad habits.” I thought I’d share mine; I can’t do six, but here’s four:

    Not changing finger-stabber needle

    I’m not quite leaving these until they are rusty, but not far from it! I have recently switch to using the Accu-Chek Multiclix, which has a drum of stabbers in which you rotate around after use. I’m not changing the drum daily – more like twice a week – but I’m working on it.

    Autopilot basal rates

    Since starting the pump about a year or so ago, it’s changed my life; it’s wonderful. However, there are times when I know I need to do a period of intensive testing so I can assess and make changes to basal rates. In fact, I need to do that right now, but it feels too much like work so I keep putting it off. Maybe later this week!

    Selective memory for glucose trends

    It has been known that when I visit my diabetes care team, I get very guilty and start making up all sorts of crazy excuses when they point out the very obvious which I’ve somehow missed. Probably linked to point 2 above. I ought to put some time aside every couple of weeks to adjust the basals.

    Bolus-Stacking

    Same as Kerri. For an explanation for those not in the know, see this post of Kerri’s from 2005.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel
Follow

Get every new post delivered to your Inbox.