0

Possible Duplicate:
Double underscore in PHP

In a PHP application that I am inheriting, there exist these code snippets which I have trouble comprehending:

$foo = bar(array(
    'format' => '',
    'prev_text' => __('«'),
    'next_text' => __('»'),
));

And another example:

$some_text = sprintf( '<span>' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    number_format_i18n( ( $current_page - 1 ) * $per_page + 1 ),
    number_format_i18n( min( $current_page * $per_page, $total ) ),
    number_format_i18n( $total ),
    $page_links
);

What are those double underscores? I tried looking for a method whose name is just a double underscore but found none. What might that be, then?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
dotancohen
  • 30,064
  • 36
  • 138
  • 197

2 Answers2

4

A single underscore is an alias to gettext(). I would assume a double underscore would be a function used for a similar purpose.

Jani Hartikainen
  • 42,745
  • 10
  • 68
  • 86
3

It looks like WordPress's localization mechanism: Translator’s Handbook – Translate WordPress

(A decent IDE, such as PhpStorm or NetBeans, can lead you straight to a function declaration.)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
DCoder
  • 12,962
  • 4
  • 40
  • 62