diff --git a/_includes/includes/ui/keyboard-details.php b/_includes/includes/ui/keyboard-details.php index e12a2fda..505d398b 100644 --- a/_includes/includes/ui/keyboard-details.php +++ b/_includes/includes/ui/keyboard-details.php @@ -9,7 +9,10 @@ use \DateTime; use \Keyman\Site\com\keyman\KeymanWebHost; use \Keyman\Site\Common\KeymanHosts; + use Keyman\Site\com\keyman\Locale; + Locale::localize('keyboards-details'); + define('GITHUB_ROOT', 'https://github.com/keymanapp/keyboards/tree/master/'); define('DOCUMENTATION_ROOT', KeymanHosts::Instance()->help_keyman_com . '/keyboard/'); @@ -103,10 +106,10 @@ protected static function WriteDeveloperCloneBox() { $installLink = 'keyman:keyboard/install/' . rawurlencode(self::$id); if(!empty(self::$bcp47)) $installLink .= "?bcp47=" . rawurlencode(self::$bcp47); $h_filename = htmlspecialchars($filename); - + $new_project_details = Locale::_s('Fill in New Project Details box below and click OK to clone %1$s.', $h_filename); return << -
Fill in New Project Details box below and click OK to clone $h_filename.
+
$new_project_details
END; // @@ -122,10 +125,13 @@ protected static function download_box($platform) { $h_filename = htmlspecialchars($filename); $platformTitle = self::platformTitles[$platform]; + // Get the localized strings to pass to heredoc syntax + $install_keyboard = _('Install keyboard'); + $install_keyboard_description = Locale::_s('Installs %1$s for %2$s on this device', $h_filename, $platformTitle); return << - Install keyboard -
Installs {$h_filename} for $platformTitle on this device
+ $install_keyboard +
$install_keyboard_description
END; } else { @@ -169,11 +175,13 @@ protected static function WriteWebBoxes($useDescription) { $url = KeymanHosts::Instance()->keymanweb_com ."/#$lang,Keyboard_" . self::GetWebKeyboardId(); if($useDescription) { $description = htmlentities(self::$keyboard->name); - $description = "
Use $description in your web browser. No need to install anything.
"; - $linktext = 'Use keyboard online'; + $useKeyboardDescription = Locale::_s('Use %1$s in your web browser. No need to install anything.', $description); + $description = "
+ $useKeyboardDescription
"; + $linktext = _('Use keyboard online'); } else { $description = ''; - $linktext = 'Full online editor'; + $linktext = _('Full online editor'); } return << @@ -191,7 +199,7 @@ protected static function LoadData() { if ($s === FALSE) { // Will fail later in the script self::$error .= error_get_last()['message'] . "\n"; - self::$title = 'Failed to load keyboard package ' . self::$id; + self::$title = Locale::_s('Failed to load keyboard package %1$s', self::$id); header('HTTP/1.0 404 Keyboard not found'); } else { $s = json_decode($s); @@ -204,19 +212,19 @@ protected static function LoadData() { 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 .= Locale::_s('Error returned from %1$s: %2$s\n', $KeymanHosts::Instance()->api_keyman_com, $s); - self::$title = 'Failed to load keyboard package ' . self::$id; + self::$error .= Locale::_s('Error returned from %1$s: %2$s\n', KeymanHosts::Instance()->api_keyman_com, $s); + self::$title = Locale::_s('Failed to load keyboard package %1%s', 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 = 'Unicode, Legacy (ANSI)'; + self::$keyboardEncoding = _('Unicode, Legacy (ANSI)'); else if (in_array('unicode', self::$keyboard->encodings)) - self::$keyboardEncoding = 'Unicode'; + self::$keyboardEncoding = _('Unicode'); else // ansi - self::$keyboardEncoding = 'Legacy (ANSI)'; + self::$keyboardEncoding = _('Legacy (ANSI)'); $date = new DateTime(self::$keyboard->lastModifiedDate); self::$keyboardLastModifiedDate = $date->format('Y-m-d H:i'); @@ -321,7 +329,7 @@ protected static function WriteTitle() { // If parameters are missing ... ?>

-

Keyboard package not found.

+

Tier() == KeymanHosts::TIER_DEVELOPMENT && (ini_get('display_errors') !== '0')) { @@ -334,7 +342,7 @@ protected static function WriteTitle() { ?> @@ -344,9 +352,9 @@ protected static function WriteTitle() { - Important note: - This is an obsolete version of this keyboard. Unless you have a good reason, click here to install the new version, called $dep, instead. + + " . _('Important note:') . " " . + _('This is an obsolete version of this keyboard. Unless you have a good reason, click here to install the new version, called') . + " $dep" . _(', instead.') . "
- +
"; @@ -395,7 +406,7 @@ protected static function WriteDownloadBoxes() { if ($embed_win && isset(self::$keyboard->minKeymanVersion) && version_compare(self::$keyboard->minKeymanVersion, $embed_version) > 0) { ?> -

Sorry, this keyboard requires Keyman minKeymanVersion ?> or higher.

+

minKeymanVersion) ?>

-

Try this keyboard

+

@@ -504,45 +515,46 @@ protected static function WriteKeyboardDetails() { // this is html, trusted in database ?> -

Keyboard Details

+

- + - + - + - + - + - + - + - + @@ -574,31 +586,31 @@ protected static function WriteKeyboardDetails() { if(isset(self::$keyboard->packageFilename)) { ?> - + - + - - + + - + - + related)) { ?> - + - +
Keyboard ID
Supported Platforms
Author
License
Documentation helpLink)) { ?> - href='helpLink ?>'>Keyboard help + href='helpLink ?>'>
Source sourcePath) && preg_match('/^(release|experimental)\//', self::$keyboard->sourcePath)) { @@ -551,15 +563,15 @@ protected static function WriteKeyboardDetails() { href='sourcePath) ?>'>sourcePath) ?>
Keyboard Version version) ?>
Last Updated
Package Download id ?>.kmp
Monthly Downloads
Total Downloads'>
Encoding
Minimum Keyman Version
Related Keyboards related as $name => $value) { @@ -608,22 +620,26 @@ protected static function WriteKeyboardDetails() { // schema. $s = @file_get_contents(KeymanHosts::Instance()->SERVER_api_keyman_com.'/keyboard/' . rawurlencode($name)); if ($s === FALSE) { - echo "keyman_com_host) . "'>$hname "; } else { echo "$hname "; } - if (isset($value->deprecates) && $value->deprecates) echo " (deprecated) "; - if (isset($value->deprecatedBy) && $value->deprecatedBy) echo " (new version) "; + if (isset($value->deprecates) && $value->deprecates) { + echo _('(deprecated)'); + } + if (isset($value->deprecatedBy) && $value->deprecatedBy) { + echo _('(new version)'); + } } ?>
Supported Languages $detail) { if($n == 3) { - echo " Expand $count more >>"; - echo "<< Collapse "; + echo " " . + Locale::_s('Expand %1$s more >>', $count) . ""; + echo "" . + _('<< Collapse') . " "; } if (property_exists($detail, 'languageName')) { echo @@ -663,7 +681,7 @@ protected static function WriteKeyboardDetails() {
-
Scan this code to load this keyboard on another device
+