Пример #1
0
function my_upload_and_shorten_add_page()
{
    // load custom text domain
    yourls_load_custom_textdomain('upload-and-shorten', dirname(__FILE__) . '/i18n/');
    // create entry in the admin's plugin menu
    yourls_register_plugin_page('upload-and-shorten', 'Upload & Shorten', 'my_upload_and_shorten_do_page');
    // parameters: page slug, page title, and function that will display the page itself
}
Пример #2
0
function isq_load_textdomain()
{
    yourls_load_custom_textdomain('isq_translation', $site . '/public/languages');
    $site = YOURLS_SITE;
}
Пример #3
0
<!DOCTYPE html>
<?php 
// Start YOURLS engine
require_once dirname(__FILE__) . '/includes/load-yourls.php';
// Ask for Infinity Squared settings
if (@(include dirname(__FILE__) . '/public/config.php')) {
    include dirname(__FILE__) . '/public/config.php';
} else {
    include dirname(__FILE__) . '/public/config-sample.php';
}
class ISQ
{
    public static $general = array(), $links = array(), $social = array(), $recaptcha = array();
}
// Load translations
yourls_load_custom_textdomain('isq_translation', '/public/languages');
?>

<html>
	<head>
		<title><?php 
echo ISQ::$general['name'];
?>
</title> <!-- Site title defined in theme settings -->
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
		<link rel="stylesheet" href="<?php 
echo YOURLS_SITE;
?>
/public/style.css" /><!-- Theme CSS -->
Пример #4
0
 /**
  * Yourls action plugins_loaded
  */
 public function action_plugins_loaded()
 {
     yourls_load_custom_textdomain(self::APP_NAMESPACE, realpath(dirname(__FILE__) . '/../translations'));
 }
 /**
  * Load textdomain for translations
  */
 public function loadTextdomain()
 {
     $file = YOURLS_PLUGINDIR . '/' . static::APP_NAMESPACE . '/translations';
     yourls_load_custom_textdomain(static::APP_NAMESPACE, $file);
 }