diff --git a/_content/10/index.php b/_content/10/index.php index 1cb0f3d5..5d4a2eca 100644 --- a/_content/10/index.php +++ b/_content/10/index.php @@ -49,7 +49,7 @@

What's New in Keyman Desktop 10 for Windows?

@@ -58,7 +58,7 @@ supports Unicode 11.0 and BCP 47 language identifiers. Desktop 10 also includes additional user interface for Turkish.

What's New in Keyman 10 for macOS?

@@ -68,7 +68,7 @@ and easily install keyboard packages by double-clicking the kmp file.

Keyman for Android is also available on the Play Store.

@@ -92,7 +92,7 @@ Swift 4.0 app.

What's New in KeymanWeb 10?

@@ -104,7 +104,7 @@

Developer Software

Keyman Developer 10 allows you to create diff --git a/_content/11/index.php b/_content/11/index.php index 311ee8e3..1482d7ac 100644 --- a/_content/11/index.php +++ b/_content/11/index.php @@ -52,7 +52,7 @@

Keyman Desktop 11

Stable


@@ -66,7 +66,7 @@

What's New in Keyman 11 for macOS?

@@ -92,7 +92,7 @@
  • Keyman for Android is available on the Play Store.
  • @@ -122,7 +122,7 @@ @@ -131,7 +131,7 @@

    Developer Software

    What's new in Keyman Developer 11?

    diff --git a/_content/14/index.php b/_content/14/index.php index 29c70214..23f75d30 100644 --- a/_content/14/index.php +++ b/_content/14/index.php @@ -72,7 +72,7 @@

    User Software

    What's New in Keyman 14 for Windows?

    @@ -98,7 +98,7 @@

    What's New in Keyman 14 for macOS?

    @@ -144,7 +144,7 @@ @@ -188,7 +188,7 @@

    What's New in KeymanWeb 14?

    @@ -208,7 +208,7 @@

    Developer Software

    What's new in Keyman Developer 14?

    diff --git a/_content/15/index.php b/_content/15/index.php index d891b24d..79fc5237 100644 --- a/_content/15/index.php +++ b/_content/15/index.php @@ -99,7 +99,7 @@

    User Software

    What's New in Keyman 15 for Windows?

    @@ -111,7 +111,7 @@

    What's New in Keyman 15 for macOS?

    @@ -146,7 +146,7 @@ @@ -184,7 +184,7 @@

    What's New in KeymanWeb 15?

    @@ -201,7 +201,7 @@

    Developer Software

    What's new in Keyman Developer 15?

    diff --git a/_content/downloads/index.php b/_content/downloads/index.php index 21917a9f..c8f96deb 100644 --- a/_content/downloads/index.php +++ b/_content/downloads/index.php @@ -7,8 +7,6 @@ use Keyman\Site\com\keyman\Locale; Locale::definePageScope('LOCALE_DOWNLOADS', 'downloads'); - $_m_Downloads = function($id, ...$args) { return Locale::m(LOCALE_DOWNLOADS, $id, ...$args); }; - function _m_Downloads($id, ...$args) { return Locale::m(LOCALE_DOWNLOADS, $id, ...$args); } // Required head([ @@ -23,13 +21,13 @@ function _m_Downloads($id, ...$args) { return Locale::m(LOCALE_DOWNLOADS, $id

    - %s', _m_Downloads('downloads_pre_release_page')), sprintf('%s', _m_Downloads('downloads_old_versions_page')) ) ?>

    - +

    diff --git a/_content/downloads/pre-release/index.php b/_content/downloads/pre-release/index.php index 12a0ba2f..9151024e 100644 --- a/_content/downloads/pre-release/index.php +++ b/_content/downloads/pre-release/index.php @@ -6,8 +6,6 @@ use Keyman\Site\com\keyman\Locale; Locale::definePageScope('LOCALE_DOWNLOADS', 'downloads'); - $_m_Downloads = function($id, ...$args) { return Locale::m(LOCALE_DOWNLOADS, $id, ...$args); }; - function _m_Downloads($id, ...$args) { return Locale::m(LOCALE_DOWNLOADS, $id, ...$args); } // Required head([ diff --git a/_content/downloads/releases/_version_downloads.php b/_content/downloads/releases/_version_downloads.php index b2ab39de..a6b56f1d 100644 --- a/_content/downloads/releases/_version_downloads.php +++ b/_content/downloads/releases/_version_downloads.php @@ -7,8 +7,6 @@ use Keyman\Site\com\keyman\Locale; Locale::definePageScope('LOCALE_DOWNLOADS', 'downloads'); - $_m_Downloads = function($id, ...$args) { return Locale::m(LOCALE_DOWNLOADS, $id, ...$args); }; - function _m_Downloads($id, ...$args) { return Locale::m(LOCALE_DOWNLOADS, $id, ...$args); } if(!isset($_REQUEST['version'])) { echo "version parameter is required."; diff --git a/_content/keyboards/index.php b/_content/keyboards/index.php index 3f3675f2..f5c37eb2 100644 --- a/_content/keyboards/index.php +++ b/_content/keyboards/index.php @@ -10,12 +10,10 @@ use Keyman\Site\com\keyman\Locale; Locale::definePageScope('LOCALE_KEYBOARDS', 'keyboards'); - $_m = function($id, ...$args) { return Locale::m(LOCALE_KEYBOARDS, $id, ...$args); }; - function _m($id, ...$args) { return Locale::m(LOCALE_KEYBOARDS, $id, ...$args); } $head_options = [ - 'title' => _m('page_title'), - 'description' => _m('page_description'), + 'title' => _m_Keyboards('page_title'), + 'description' => _m_Keyboards('page_description'), 'css' => [Util::cdn('css/template.css'), Util::cdn('keyboard-search/search.css')], 'js' => [ Util::cdn('keyboard-search/jquery.mark.js'), @@ -62,14 +60,14 @@ function _m($id, ...$args) { return Locale::m(LOCALE_KEYBOARDS, $id, ...$args
    '> -

    +

    END; @@ -152,7 +146,7 @@ protected static function WriteWindowsBoxes() { } protected static function WritemacOSBoxes() { - global $_m; + global $_m_Keyboards_Install; $keyboard = self::$keyboard; $tier = self::$tier; @@ -187,17 +181,17 @@ protected static function WritemacOSBoxes() { $result = <<
    -

    {$_m('platform_not_installed', 'Keyman for macOS')}

    +

    {$_m_Keyboards_Install('platform_not_installed', 'Keyman for macOS')}

      -
    1. {$_m('install_keyman', 'Keyman for macOS')}
    2. +
    3. {$_m_Keyboards_Install('install_keyman', 'Keyman for macOS')}
    4. - {$_m('install_keyboard')} -
      {$_m('downloads_keyboard_for_platform', $h['name'], 'macOS')}
      + {$_m_Keyboards_Install('install_keyboard')} +
      {$_m_Keyboards_Install('downloads_keyboard_for_platform', $h['name'], 'macOS')}
    @@ -206,7 +200,7 @@ protected static function WritemacOSBoxes() { } protected static function WriteLinuxBoxes() { - global $_m; + global $_m_Keyboards_Install; $keyboard = self::$keyboard; $tier = self::$tier; @@ -244,19 +238,19 @@ protected static function WriteLinuxBoxes() { startAfterPageLoad_Linux(document.currentScript.dataset);
    -

    {$_m('platform_not_installed', 'Keyman for Linux')}

    +

    {$_m_Keyboards_Install('platform_not_installed', 'Keyman for Linux')}

      -
    1. {$_m('install_keyman', 'Keyman for Linux')}
    2. +
    3. {$_m_Keyboards_Install('install_keyman', 'Keyman for Linux')}
    4. - {$_m('install_keyboard')} -
      {$_m('downloads_keyboard_for_platform', $h['name'], 'Linux')}
      + {$_m_Keyboards_Install('install_keyboard')} +
      {$_m_Keyboards_Install('downloads_keyboard_for_platform', $h['name'], 'Linux')}

    @@ -265,7 +259,7 @@ protected static function WriteLinuxBoxes() { } protected static function WriteAndroidBoxes() { - global $_m; + global $_m_Keyboards_Install; $keyboard = self::$keyboard; $tier = self::$tier; @@ -306,14 +300,14 @@ protected static function WriteAndroidBoxes() {

    -

    {$_m('with_play_store', $h['name'])}

    - {$_m('install_from_play_store')} -
    {$_m('keyman_and_keyboard_for_platform', $h['name'], 'Android')}
    +

    {$_m_Keyboards_Install('with_play_store', $h['name'])}

    + {$_m_Keyboards_Install('install_from_play_store')} +
    {$_m_Keyboards_Install('keyman_and_keyboard_for_platform', $h['name'], 'Android')}

    -

    {$_m('already_installed')} {$_m('download_just_keyboard')} {$_m('and_then_install_in_the_app')}

    +

    {$_m_Keyboards_Install('already_installed')} {$_m_Keyboards_Install('download_just_keyboard')} {$_m_Keyboards_Install('and_then_install_in_the_app')}

    @@ -322,7 +316,7 @@ protected static function WriteAndroidBoxes() { } protected static function WriteiOSBoxes() { - global $_m; + global $_m_Keyboards_Install; $keyboard = self::$keyboard; $tier = self::$tier; @@ -357,17 +351,17 @@ protected static function WriteiOSBoxes() { $result = <<
    -

    {$_m('platform_not_installed', 'Keyman for iPhone and iPad')}

    +

    {$_m_Keyboards_Install('platform_not_installed', 'Keyman for iPhone and iPad')}

      -
    1. {$_m('install_keyman', 'Keyman for iPhone and iPad')}
    2. +
    3. {$_m_Keyboards_Install('install_keyman', 'Keyman for iPhone and iPad')}
    4. - {$_m('install_keyboard')} -
      {$_m('downloads_keyboard_for_platform', $h['name'], 'iPhone and iPad')}
      + {$_m_Keyboards_Install('install_keyboard')} +
      {$_m_Keyboards_Install('downloads_keyboard_for_platform', $h['name'], 'iPhone and iPad')}
    @@ -377,7 +371,7 @@ protected static function WriteiOSBoxes() { protected static function LoadData() { self::$error = ""; - global $_m; + global $_m_Keyboards_Install; // Get Keyboard Metadata @@ -392,7 +386,7 @@ protected static function LoadData() { if(is_object($s)) { self::$keyboard = $s; self::$title = htmlentities(self::$keyboard->name); - if (!preg_match('/keyboard$/i', self::$title)) self::$title = $_m('install_page_title', self::$title); + if (!preg_match('/keyboard$/i', self::$title)) self::$title = $_m_Keyboards_Install('install_page_title', self::$title); } else { self::$error .= "Error returned from ".KeymanHosts::Instance()->api_keyman_com.": $s\n"; self::$title = 'Failed to load keyboard ' . self::$id; @@ -416,7 +410,7 @@ protected static function LoadData() { } protected static function WriteTitle() { - global $_m; + global $_m_Keyboards_Install; $head_options = [ 'title' => self::$title, 'js' => [Util::cdn('keyboard-search/keyboard-details.js'), Util::cdn('keyboard-search/install.js')], @@ -430,7 +424,7 @@ protected static function WriteTitle() { // If parameters are missing ... ?>

    -

    +

    Tier() == KeymanHosts::TIER_DEVELOPMENT && (ini_get('display_errors') !== '0')) { diff --git a/_content/keyboards/share.php b/_content/keyboards/share.php index 37d2d6a0..4c1dd394 100644 --- a/_content/keyboards/share.php +++ b/_content/keyboards/share.php @@ -7,12 +7,6 @@ use Keyman\Site\com\keyman\Locale; Locale::definePageScope('LOCALE_KEYBOARDS_SHARE', 'keyboards/share'); - $_m = function($id, ...$args) { - return Locale::m(LOCALE_KEYBOARDS_SHARE, $id, ...$args); - }; - function _m($id, ...$args) { - return Locale::m(LOCALE_KEYBOARDS_SHARE, $id, ...$args); - } if(!isset($_REQUEST['id'])) { header('Location: /keyboards'); @@ -47,19 +41,19 @@ function find_keyboard($id) { // Keyboard not found, so let's explain. $head_options = [ - 'title' => $_m('head_title', $id) + 'title' => $_m_Keyboards_Share('head_title', $id) ]; head($head_options); ?> -

    +

    -

    ,

    +

    ,

    -

    +

    -

    +

    -

    -

    \ No newline at end of file +

    +

    \ No newline at end of file diff --git a/_includes/includes/ui/downloads.php b/_includes/includes/ui/downloads.php index aaed54cf..b572c71b 100644 --- a/_includes/includes/ui/downloads.php +++ b/_includes/includes/ui/downloads.php @@ -2,6 +2,8 @@ require_once _KEYMANCOM_INCLUDES . '/autoload.php'; use Keyman\Site\Common\KeymanHosts; + use Keyman\Site\com\keyman\Locale; + Locale::definePageScope('LOCALE_DOWNLOADS', 'downloads'); $versions = @json_decode(file_get_contents(KeymanHosts::Instance()->SERVER_downloads_keyman_com . '/api/version/2.0')); //if($versions === NULL || $versions === FALSE) { @@ -29,7 +31,7 @@ function formatSizeUnits($bytes) { function downloadSection($product, $platform, $filepattern, $tiers = '', $target = '') { if($target == '') $target = $platform; - echo sprintf("

    %s

    \n\n", + echo sprintf("

    %s

    \n\n", $target, _m_Downloads($product)); $tiers = explode(' ',$tiers); foreach($tiers as $tier) { diff --git a/_includes/includes/ui/keyboard-details.php b/_includes/includes/ui/keyboard-details.php index dd6f94ad..8468a3b8 100644 --- a/_includes/includes/ui/keyboard-details.php +++ b/_includes/includes/ui/keyboard-details.php @@ -13,12 +13,6 @@ use \Keyman\Site\com\keyman; Locale::definePageScope('LOCALE_KEYBOARDS_DETAILS', 'keyboards/details'); - $_m_KeyboardDetails = function($id, ...$args) { - return Locale::m(LOCALE_KEYBOARDS_DETAILS, $id, ...$args); - }; - function _m_KeyboardDetails($id, ...$args) { - return Locale::m(LOCALE_KEYBOARDS_DETAILS, $id, ...$args); - } define('GITHUB_ROOT', 'https://github.com/keymanapp/keyboards/tree/master/'); define('DOCUMENTATION_ROOT', KeymanHosts::Instance()->help_keyman_com . '/keyboard/'); @@ -109,21 +103,21 @@ protected static function map_license($s) { } protected static function WriteDeveloperCloneBox() { - global $_m_KeyboardDetails; + global $_m_Keyboards_Details; $filename = self::$id . ".kpj"; $installLink = 'keyman:keyboard/install/' . rawurlencode(self::$id); if(!empty(self::$bcp47)) $installLink .= "?bcp47=" . rawurlencode(self::$bcp47); return << -
    {$_m_KeyboardDetails('new_project_details', htmlspecialchars($filename))}
    +
    {$_m_Keyboards_Details('new_project_details', htmlspecialchars($filename))}
    END; // } protected static function download_box($platform) { - global $_m_KeyboardDetails; + global $_m_Keyboards_Details; if(!empty(self::$deprecatedBy)) { return ""; @@ -133,14 +127,14 @@ protected static function download_box($platform) { if(!empty(self::$bcp47)) $installLink .= "?bcp47=" . rawurlencode(self::$bcp47); return << - {$_m_KeyboardDetails('install_keyboard')} -
    {$_m_KeyboardDetails('install_keyboard_button_description', htmlspecialchars($filename), self::platformTitles[$platform])}
    + {$_m_Keyboards_Details('install_keyboard')} +
    {$_m_Keyboards_Details('install_keyboard_button_description', htmlspecialchars($filename), self::platformTitles[$platform])}
    END; } else { return << - {$_m_KeyboardDetails('keyboard_not_supported')} + {$_m_Keyboards_Details('keyboard_not_supported')} END; } @@ -148,7 +142,7 @@ protected static function download_box($platform) { protected static function WriteWebBoxes($useDescription) { global $embed_target; - global $_m_KeyboardDetails; + global $_m_Keyboards_Details; // only show if the jsFilename property is present in the .keyboard_info if(empty(self::$keyboard->jsFilename)) { @@ -179,11 +173,11 @@ protected static function WriteWebBoxes($useDescription) { $url = KeymanHosts::Instance()->keymanweb_com ."/#$lang,Keyboard_" . self::GetWebKeyboardId(); if($useDescription) { $description = htmlentities(self::$keyboard->name); - $description = "
    ".$_m_KeyboardDetails("use_keyboard_button_description", $description)."
    "; - $linktext = $_m_KeyboardDetails("use_keyboard_online"); + $description = "
    ".$_m_Keyboards_Details("use_keyboard_button_description", $description)."
    "; + $linktext = $_m_Keyboards_Details("use_keyboard_online"); } else { $description = ''; - $linktext = $_m_KeyboardDetails("full_online_editor"); + $linktext = $_m_Keyboards_Details("full_online_editor"); } return << @@ -195,39 +189,39 @@ protected static function WriteWebBoxes($useDescription) { protected static function LoadData() { global $stable_version; - global $_m_KeyboardDetails; + global $_m_Keyboards_Details; self::$error = ""; $s = @file_get_contents(KeymanHosts::Instance()->SERVER_api_keyman_com. '/keyboard/' . rawurlencode(self::$id)); if ($s === FALSE) { // Will fail later in the script self::$error .= error_get_last()['message'] . "\n"; - self::$title = $_m_KeyboardDetails("failed_to_load_keyboard_package", self::$id); + self::$title = $_m_Keyboards_Details("failed_to_load_keyboard_package", self::$id); header('HTTP/1.0 404 Keyboard not found'); } else { $s = json_decode($s); if(is_object($s)) { self::$keyboard = $s; self::$title = htmlentities(self::$keyboard->name); - if (!preg_match('/keyboard$/i', self::$title)) self::$title = $_m_KeyboardDetails("details_page_title", self::$title); + if (!preg_match('/keyboard$/i', self::$title)) self::$title = $_m_Keyboards_Details("details_page_title", self::$title); self::$description = isset(self::$keyboard->description) ? self::$keyboard->description : ''; self::$authorName = isset(self::$keyboard->authorName) ? self::$keyboard->authorName : ''; self::$minVersion = isset(self::$keyboard->minKeymanVersion) ? self::$keyboard->minKeymanVersion : $stable_version; self::$license = self::map_license(isset(self::$keyboard->license) ? self::$keyboard->license : 'Unknown'); } else { - self::$error .= $_m_KeyboardDetails("error_returned_from_api", KeymanHosts::Instance()->api_keyman_com, $s); - self::$title = $_m_KeyboardDetails("failed_to_load_keyboard_package", self::$id); + self::$error .= $_m_Keyboards_Details("error_returned_from_api", KeymanHosts::Instance()->api_keyman_com, $s); + self::$title = $_m_Keyboards_Details("failed_to_load_keyboard_package", self::$id); header('HTTP/1.0 500 Internal Server Error'); } } if(!empty(self::$keyboard)) { if (in_array('unicode', self::$keyboard->encodings) && in_array('ansi', self::$keyboard->encodings)) - self::$keyboardEncoding = $_m_KeyboardDetails("encoding_list"); + self::$keyboardEncoding = $_m_Keyboards_Details("encoding_list"); else if (in_array('unicode', self::$keyboard->encodings)) - self::$keyboardEncoding = $_m_KeyboardDetails("unicode"); + self::$keyboardEncoding = $_m_Keyboards_Details("unicode"); else // ansi - self::$keyboardEncoding = $_m_KeyboardDetails("legacy_ansi"); + self::$keyboardEncoding = $_m_Keyboards_Details("legacy_ansi"); // TODO: i18n date format, but would require a lot more Dockerfile dependencies $date = new DateTime(self::$keyboard->lastModifiedDate); @@ -294,7 +288,7 @@ protected static function WriteTitle() { global $embed, $session_query_q, $embed_win, $embed_version; global $embed_target; - global $_m_KeyboardDetails; + global $_m_Keyboards_Details; if ($embed != 'none') { $head_options += [ @@ -335,7 +329,7 @@ protected static function WriteTitle() { // If parameters are missing ... ?>

    -

    +

    Tier() == KeymanHosts::TIER_DEVELOPMENT && (ini_get('display_errors') !== '0')) { @@ -348,7 +342,7 @@ protected static function WriteTitle() { ?> @@ -358,9 +352,9 @@ protected static function WriteTitle() { - " . $_m_KeyboardDetails("important_note") . " " . - $_m_KeyboardDetails("obsolete_version") . - " $dep" . $_m_KeyboardDetails("instead") . " + " . $_m_Keyboards_Details("important_note") . " " . + $_m_Keyboards_Details("obsolete_version") . + " $dep" . $_m_Keyboards_Details("instead") . "
    + $_m_Keyboards_Details("view_obsolete_details") . "

    "; @@ -393,7 +387,7 @@ protected static function WriteTitle() { protected static function WriteDownloadBoxes() { global $embed, $embed_win, $embed_version; global $embed_developer; - global $_m_KeyboardDetails; + global $_m_Keyboards_Details; // We'll write all the different platforms here and then let Bowser determine // which box to show. This is true for both embedded and web-based viewing. @@ -413,7 +407,7 @@ protected static function WriteDownloadBoxes() { if ($embed_win && isset(self::$keyboard->minKeymanVersion) && version_compare(self::$keyboard->minKeymanVersion, $embed_version) > 0) { ?> -

    minKeymanVersion) ?>

    +

    minKeymanVersion) ?>

    -

    +

    @@ -528,49 +522,49 @@ protected static function WriteDescription() { protected static function WriteKeyboardDetails() { global $embed_target, $session_query_q; - global $_m_KeyboardDetails; + global $_m_Keyboards_Details; // this is html, trusted in database ?> -

    +

    - + - + - + - + - + - + - + - + @@ -602,7 +596,7 @@ protected static function WriteKeyboardDetails() { if(isset(self::$keyboard->packageFilename)) { ?> - + - + - - + + - + - + related)) { ?> - + - +
    helpLink)) { ?> - href='helpLink ?>'> + href='helpLink ?>'>
    sourcePath) && preg_match('/^(release|experimental)\//', self::$keyboard->sourcePath)) { @@ -579,15 +573,15 @@ protected static function WriteKeyboardDetails() { href='sourcePath) ?>'>sourcePath) ?>
    version) ?>
    id ?>.kmp
    related as $name => $value) { @@ -638,17 +632,17 @@ protected static function WriteKeyboardDetails() { $s = @file_get_contents(KeymanHosts::Instance()->SERVER_api_keyman_com.'/keyboard/' . rawurlencode($name)); if ($s === FALSE) { echo "$hname "; } else { echo "$hname "; } if (isset($value->deprecates) && $value->deprecates) { - echo $_m_KeyboardDetails("deprecated"); + echo $_m_Keyboards_Details("deprecated"); } if (isset($value->deprecatedBy) && $value->deprecatedBy) { - echo $_m_KeyboardDetails("new_version"); + echo $_m_Keyboards_Details("new_version"); } } ?> @@ -656,11 +650,11 @@ protected static function WriteKeyboardDetails() {
    languages)) - 3; @@ -672,9 +666,9 @@ protected static function WriteKeyboardDetails() { foreach($langs as $bcp47 => $detail) { if($n == 3) { echo " " . - $_m_KeyboardDetails("expand_more", $count) . ""; + $_m_Keyboards_Details("expand_more", $count) . ""; echo "" . - $_m_KeyboardDetails("collapse") . " "; + $_m_Keyboards_Details("collapse") . " "; } if (property_exists($detail, 'languageName')) { echo @@ -700,7 +694,7 @@ protected static function WriteKeyboardDetails() {
    -
    +