Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/24/2024 02:05:55 AM (11 months ago)
Author:
imath
Message:

i18n: bring back custom locations for translation files

Prior to WordPress 4.6, it was possible to completely override the translation file with a custom one from one of the 'buddypress_locale_locations' filterable list items.

With WordPress 6.5 latest improvements about l10n, we are now able to bring these back. Making it easier for users to customize every BuddyPress strings should help them build match their community needs (e.g.: using sport/school/working/any other wording).

3 functions has been introduced:

  • bp_get_custom_translation_file() is looking for a file name into 'buddypress_locale_locations' filterable list items.
  • bp_load_custom_translation_file() is the 'load_translation_file' filter callback for regular translation files.
  • bp_load_custom_script_translation_file() is the 'load_script_translation_file' filter callback for JavaScript translation files.

The bp_core_load_buddypress_textdomain() function has been deprecated as it was pretty useless since WordPress 4.6.

Props espellcaste

Fixes #9187
Closes https://github.com/buddypress/buddypress/pull/316

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/14.0.php

    r13877 r13936  
    8585    );
    8686}
     87
     88/**
     89 * Load the buddypress translation file for current language.
     90 *
     91 * @since 1.0.2
     92 * @deprecated 14.0.0
     93 *
     94 * @return bool
     95 */
     96function bp_core_load_buddypress_textdomain() {
     97    _deprecated_function( __FUNCTION__, '14.0.0' );
     98
     99    return false;
     100}
Note: See TracChangeset for help on using the changeset viewer.