You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Via the filter the label strings are made translateable via your plugin. This means the library itself has no translations and that way is really "independent". Therefore the translations are only within your plugin, and with your plugin's textdomain. That way you can fullfill any requirements regarding textdomains and language packs for WordPress.org hosted plugins and still use the library.
/** Optionally add string translations for the library */
if ( ! function_exists( 'plir_custom_strings_plugin_installer' ) ) :
add_filter( 'ddwlib_plir/filter/strings/plugin_installer', 'plir_custom_strings_plugin_installer' );
/**
* Optionally, make strings translateable for included library "DDWlib Plugin
* Installer Recommendations".
* Strings:
* - "Newest" --> tab in plugin installer toolbar
* - "Version:" --> label in plugin installer plugin card
*
* @param array $strings Holds all filterable strings of the library.
* @return array Array of tweaked translateable strings.
*/
function plir_custom_strings_plugin_installer( $strings ) {
$strings[ 'newest' ] = _x(
'Newest',
'Plugin installer: Tab name in installer toolbar',
'my-custom-textdomain'
);
$strings[ 'version' ] = _x(
'Version:',
'Plugin card: plugin version',
'my-custom-textdomain'
);
return $strings;
} // end function
endif; // function check