[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/common/ -> locale.php (source)

   1  <?php
   2  
   3  /**
   4   * bbPress Localization
   5   *
   6   * @package bbPress
   7   * @subpackage Localization
   8   */
   9  
  10  // Exit if accessed directly
  11  defined( 'ABSPATH' ) || exit;
  12  
  13  /**
  14   * Translates role name.
  15   *
  16   * Since the role names are in the database and not in the source there
  17   * are dummy gettext calls to get them into the POT file and this function
  18   * properly translates them back.
  19   *
  20   * The before_last_bar() call is needed, because older installs keep the roles
  21   * using the old context format: 'Role name|User role' and just skipping the
  22   * content after the last bar is easier than fixing them in the DB. New installs
  23   * won't suffer from that problem.
  24   *
  25   * @see translate_user_role()
  26   *
  27   * @since 2.6.0 bbPress
  28   *
  29   * @param string $name The role name.
  30   * @return string Translated role name on success, original name on failure.
  31   */
  32  function bbp_translate_user_role( $name ) {
  33      return translate_with_gettext_context( before_last_bar( $name ), 'User role', 'bbpress' );
  34  }
  35  
  36  /**
  37   * Dummy gettext calls to get strings in the catalog.
  38   *
  39   * @since 2.6.0 bbPress
  40   */
  41  function bbp_dummy_role_names() {
  42  
  43      /* translators: user role */
  44      _x( 'Keymaster', 'User role', 'bbpress' );
  45  
  46      /* translators: user role */
  47      _x( 'Moderator', 'User role', 'bbpress' );
  48  
  49      /* translators: user role */
  50      _x( 'Participant', 'User role', 'bbpress' );
  51  
  52      /* translators: user role */
  53      _x( 'Spectator', 'User role', 'bbpress' );
  54  
  55      /* translators: user role */
  56      _x( 'Blocked', 'User role', 'bbpress' );
  57  }


Generated: Fri Apr 26 01:01:04 2024 Cross-referenced by PHPXref 0.7.1