Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions TODO.md

This file was deleted.

3 changes: 2 additions & 1 deletion _content/about/team/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ people who have helped Keyman serve you all better!
[<img class='contributor-minor' src="https://avatars.githubusercontent.com/u/6199709?v=4" alt="dotland" />](https://github.com/dotland "dotland")
[<img class='contributor-minor' src="https://github.com/DOUCKI56.png?size=240" alt="DOUCKI56" />](https://github.com/DOUCKI56 "DOUCKI56")
[<img class='contributor-minor' src="https://avatars.githubusercontent.com/u/53433504?v=4" alt="DP-Upstate" />](https://github.com/DP-Upstate "DP-Upstate")
[<img class='contributor-minor' src="https://avatars.githubusercontent.com/u/281530597?v=4" alt="DrTMarvinZou" />](https://github.com/DrTMarvinZou "DrTMarvinZou")
[<img class='contributor-minor' src="https://avatars.githubusercontent.com/u/1534119?v=4" alt="dy2288" />](https://github.com/dy2288 "dy2288")
[<img class='contributor-minor' src="https://avatars.githubusercontent.com/u/148839270?v=4" alt="Ehblut" />](https://github.com/Ehblut "Ehblut")
[<img class='contributor-minor' src="https://avatars.githubusercontent.com/u/122399466?v=4" alt="emily-roth" />](https://github.com/emily-roth "emily-roth")
Expand Down Expand Up @@ -685,7 +686,6 @@ people who have helped Keyman serve you all better!

<div class="contributors" id="crowdin-minor" markdown="1">
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/14746856/medium/b86f420541b7f40a825230dcd43b30b9.jpeg" alt="aaumsccs" />](https://crowdin.com/profile/aaumsccs "aaumsccs")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/15964203/medium/50948d769d289fdc93be7569671d8368.jpeg" alt="alexvis" />](https://crowdin.com/profile/alexvis "alexvis")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/14889606/medium/5b8954f9647df4bca760fb055c5cb12e_default.png" alt="Alisa110" />](https://crowdin.com/profile/Alisa110 "Alisa110")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/16848823/medium/456198db20944adfe6414bd5fd097c96_default.png" alt="Almeida463" />](https://crowdin.com/profile/Almeida463 "Almeida463")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/16419704/medium/4d1bc73e2bc01d1d075c21fc955dd4ce_default.png" alt="amadel24" />](https://crowdin.com/profile/amadel24 "amadel24")
Expand Down Expand Up @@ -759,6 +759,7 @@ people who have helped Keyman serve you all better!
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/13962625/medium/907539fd79ca32a8a08d400a1aa043f7_default.png" alt="PrinceNorris" />](https://crowdin.com/profile/PrinceNorris "PrinceNorris")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/17484784/medium/220356478951708fe5bdc2177b1317fb_default.png" alt="r.h.od.te" />](https://crowdin.com/profile/r.h.od.te "r.h.od.te")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/15308466/medium/8d05cc53180a1d5a57e81c8e81d35586.png" alt="ramesh-k" />](https://crowdin.com/profile/ramesh-k "ramesh-k")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/15964203/medium/fff475c6f619cbe85cf40d383f772cb0_default.png" alt="REMOVED_USER" />](https://crowdin.com/profile/REMOVED_USER "REMOVED_USER")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/14854186/medium/67cfbfa4912eca1d1e68e3fcd5f9062b_default.png" alt="REMOVED_USER" />](https://crowdin.com/profile/REMOVED_USER "REMOVED_USER")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/13657317/medium/886a3ed3197aa48cdd16bb3a792ed3d5.jpeg" alt="RomanVolak" />](https://crowdin.com/profile/RomanVolak "RomanVolak")
[<img class='contributor-minor' src="https://crowdin-static.cf-downloads.crowdin.com/avatar/15925483/medium/11be56aaae391e8610948a8e833634ef_default.png" alt="saikchan.tm" />](https://crowdin.com/profile/saikchan.tm "saikchan.tm")
Expand Down
26 changes: 13 additions & 13 deletions _content/downloads/_downloads.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<?php
downloadSection('Keyman for Windows', 'windows', 'keyman-$version.exe', 'stable');
downloadSection('Keyman for macOS', 'mac', 'keyman-$version.dmg', 'stable');
downloadSection('Keyman for Android', 'android', 'keyman-$version.apk', 'stable');
downloadSection('product_windows', 'windows', 'keyman-$version.exe', 'stable');
downloadSection('product_macos', 'mac', 'keyman-$version.dmg', 'stable');
downloadSection('product_android', 'android', 'keyman-$version.apk', 'stable');
?>

<p>Keyman for Android is also available on the Play Store.</p>
<p><?= _m_Downloads('available_on_play_store') ?></p>
<?= $playstoreTable ?>

<h2 id="iOS" class='red underline'>Keyman for iPhone and iPad</h2>
<p>Keyman for iPhone and iPad can be found on the App Store.</p>
<h2 id="iOS" class='red underline'><?= _m_Downloads('product_ios') ?></h2>
<p><?= _m_Downloads('available_on_app_store') ?></p>
<?= $appstoreTable ?>

<h2 id='linux' class='red underline'>Keyman for Linux</h2>
<h2 id='linux' class='red underline'><?= _m_Downloads('product_linux') ?></h2>

<li>Ubuntu, Wasta-Linux: Keyman for Linux can be installed via launchpad:</li>
<ul><li><?= _m_Downloads('install_via_launchpad') ?></li></ul>
<blockquote><pre class='language-bash code'><code>sudo add-apt-repository ppa:keymanapp/keyman
sudo apt install keyman onboard-keyman</code></pre></blockquote>

<h2 class='red underline large'>Products for Software Developers</h2>
<h2 class='red underline large'><?= _m_Downloads('products_for_software_developers') ?></h2>

<?php
downloadSection('KeymanWeb', 'web', 'keymanweb-$version.zip', 'stable');
downloadSection('Keyman Developer', 'developer', 'keymandeveloper-$version.exe', 'stable');
downloadSection('Keyman Engine for Android', 'android', 'keyman-engine-android-$version.zip', 'stable', 'android-engine');
downloadSection('Keyman Engine for iOS', 'ios', 'keyman-engine-ios-$version.zip', 'stable', 'ios-engine');
downloadSection('product_keymanweb', 'web', 'keymanweb-$version.zip', 'stable');
downloadSection('product_developer', 'developer', 'keymandeveloper-$version.exe', 'stable');
downloadSection('product_engine_android', 'android', 'keyman-engine-android-$version.zip', 'stable', 'android-engine');
downloadSection('product_engine_ios', 'ios', 'keyman-engine-ios-$version.zip', 'stable', 'ios-engine');
?>

<br/>
23 changes: 16 additions & 7 deletions _content/downloads/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,37 @@
require_once _KEYMANCOM_INCLUDES . '/includes/appstore.php';
require_once _KEYMANCOM_INCLUDES . '/includes/playstore.php';
use Keyman\Site\Common\KeymanHosts;
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([
'title' =>'Keyman Downloads',
'description' => 'Keyman stable downloads',
'title' => _m_Downloads('downloads_page_title'),
'description' => _m_Downloads('downloads_page_description'),
'css' => ['template.css','index.css','app-store-links.css', 'prism.css'],
'js' => ['prism.js'],
'showMenu' => true
]);
?>

<h2 class="red underline large">Keyman Downloads</h2>
<h2 class="red underline large"><?= _m_Downloads('downloads_page_title') ?></h2>

<p>
Get the latest version of Keyman here. These are standalone downloads and do not contain keyboard layouts
for your language. See also the <a href='pre-release'>pre-release download page</a> and the <a href='archive'>old versions download page</a>.
<?= _m_Downloads('get_the_latest',
sprintf('<a href=\'pre-release\'>%s</a>', _m_Downloads('downloads_pre_release_page')),
sprintf('<a href=\'archive\'>%s</a>', _m_Downloads('downloads_old_versions_page')) ) ?>
</p>

<p><a href='<?= KeymanHosts::Instance()->help_keyman_com?>/version-history'>Keyman version history</a> (all products)</p>
<p>
<a href='<?= KeymanHosts::Instance()->help_keyman_com?>/version-history'><?= _m_Downloads('keyman_version_history_1') ?></a>
<?= _m_Downloads('keyman_version_history_2') ?>
</p>


<a class="button" href="all-versions">Browse all versions (14.0 onwards)</a>
<a class="button" href="all-versions"><?= _m_Downloads('browse_all_versions') ?></a>


<?php
Expand Down
11 changes: 10 additions & 1 deletion _content/keyboards/session.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php
use \Keyman\Site\com\keyman\Locale;

if(!isset($_SESSION)) {
session_set_cookie_params(["SameSite" => "None"]); // Allow use in iframe, needed for Download Keyboards dialog
session_set_cookie_params(["Secure" => "true"]); // None requires Secure to be set
session_start();
$session_started = true;
}

if(isset($_REQUEST['embed'])) {
Expand Down Expand Up @@ -38,9 +41,15 @@
// /.htaccess for full discussion (line ~32)
//
// Note: 'SameSite=None; secure' is required for embedding in Keyman
// Configuration for Windows because that uses an iframe to embed the search
// Configuration for Windows because it uses an iframe to embed the search,
// and otherwise cookies are blocked
setcookie('embed_keyboards_no_locale_redirect', '1', ["secure" => true, "samesite" => 'None', 'path' => '/']);

if(!isset($_SESSION['lang'])) {
$_SESSION['lang'] = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en';
}
Locale::setOverrideLocale($_SESSION['lang']);

$session_query = http_build_query([
'embed' => $embed,
'version' => $embed_version
Expand Down
19 changes: 12 additions & 7 deletions _includes/includes/ui/downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function formatSizeUnits($bytes) {
function downloadSection($product, $platform, $filepattern, $tiers = '', $target = '') {
if($target == '') $target = $platform;

echo "<h2 id='$target' class='red underline'>$product</h2>\n\n";
echo sprintf("<h2 id='%s' class='red underline'>%s</h2>\n\n",
$target, _m_Downloads($product));
$tiers = explode(' ',$tiers);
foreach($tiers as $tier) {
echo downloadLinks($product, $platform, $tier, $filepattern);
Expand All @@ -38,9 +39,7 @@ function downloadSection($product, $platform, $filepattern, $tiers = '', $target

function downloadLinks($product, $platform, $tier, $filepatterns) {
global $versions;
$tierTitle = ucFirst($tier);
echo "<h3>$tierTitle</h3>\n";
echo "<ul>\n";
echo sprintf("<h3>%s</h3>\n<ul>\n", ucFirst(_m_Downloads($tier)));
if(!empty($versions->$platform->$tier)) {
if(!is_array($filepatterns)) $filepatterns = array($filepatterns);
foreach($filepatterns as $filepattern) {
Expand All @@ -50,12 +49,18 @@ function downloadLinks($product, $platform, $tier, $filepatterns) {
if(!empty($versions->$platform->$tier->files->$file)) {
$fileData = $versions->$platform->$tier->files->$file;
$fileSize = formatSizeUnits($fileData->size);
echo "<li><a href='" . KeymanHosts::Instance()->downloads_keyman_com . "/$platform/$tier/{$versions->$platform->$tier->version}/$file'>$file $tier</a> (released $fileData->date, $fileSize)</li>\n";
echo sprintf("<li><a href='%s/%s/%s/%s/%s'>%s %s</a> %s</li>\n",
KeymanHosts::Instance()->downloads_keyman_com ,
$platform, $tier,
$versions->$platform->$tier->version,
$file, $file, $tier,
_m_Downloads('released_date_size', $fileData->date, $fileSize));
}
}
}
echo "<li><a href='" . KeymanHosts::Instance()->downloads_keyman_com . "/$platform/$tier/'>All $product $tier releases</a></li>\n";
echo "</ul><br/>\n";
echo sprintf("<li><a href='%s/%s/%s/'>%s</a></li>\n</ul><br/>\n",
KeymanHosts::Instance()->downloads_keyman_com, $platform, $tier,
_m_Downloads('all_product_releases', _m_Downloads($product), _m_Downloads($tier)));
}

function downloadLargeCTA($product, $platform, $tier, $filepattern) {
Expand Down
25 changes: 18 additions & 7 deletions _includes/locale/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ public static function currentLocales() {
return self::$currentLocales;
}

/**
* For places where we are outside our normal i18n framework with the locale
* in the path, e.g. /keyboards in embed, we set a locale based on alternate
* parameter, and we allow fallback to be applied
*/
public static function setOverrideLocale($locale) {
self::setLocale($locale, true);
}

/**
* Return the user-selected page locale, which is always embedded at the
* front of the URL path
Expand Down Expand Up @@ -79,19 +88,21 @@ private static function setLocaleFromURL() {
} else {
$pageLocale = Locale::DEFAULT_LOCALE;
}
self::setLocale($pageLocale);
self::setLocale($pageLocale, false);
}

/**
* Set the current locales, with an array of fallbacks, ending in 'en'.
* @param $locale - the new current locale (xx-YY as specified in crowdin %locale%)
* @param $locale - the new current locale (xx-YY as specified in crowdin
* %locale%)
* @param $fallback - true if the function should search for fallback
* locales (other than 'en', which is always added)
*/
private static function setLocale($locale) {
// Clear current locales
self::$currentLocales = [];

if (!empty($locale)) {
private static function setLocale($locale, $fallback) {
if ($fallback) {
self::$currentLocales = self::calculateFallbackLocales($locale);
} else {
self::$currentLocales =[$locale];
}

if(!in_array(Locale::DEFAULT_LOCALE, self::$currentLocales)) {
Expand Down
94 changes: 94 additions & 0 deletions _includes/locale/strings/downloads/en.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php

/*
* Keyman is copyright (C) SIL Global. MIT License.
*
* Default English strings for downloads/index.php
* When exporting strings from crowdin, convert \\$s to \$s
*/

declare(strict_types=1);

return [
# Downloads Page Title
"downloads_page_title" => "Keyman Downloads",

# Downloads_page_description
"downloads_page_description" => "Keyman stable downloads",

# Get the latest
"get_the_latest" =>
"Get the latest version of Keyman here. These are standalone downloads and do not contain keyboard layouts
for your language. See also the %1\$s and the %2\$s.",

# Downloads pre-release page
"downloads_pre_release_page" => "pre-release download page",

# Downloads old versions page
"downloads_old_versions_page" => "old versions download page",

# Keyman version history
"keyman_version_history_1" => "Keyman version history",

# Keyman version history (description)
"keyman_version_history_2" => "(all products)",

# Browse all versions
"browse_all_versions" => "Browse all versions (14.0 onwards)",

### Product Downloads

# Keyman for Windows
"product_windows" => "Keyman for Windows",

# Keyman for macOS
"product_macos" => "Keyman for macOS",

# Keyman for Android
"product_android" => "Keyman for Android",

"available_on_play_store" => "Keyman for Android is also available on the Play Store.",

# Keyman for iPhone and iPad
"product_ios" => "Keyman for iPHone and iPad",

"available_on_app_store" => "Keyman for iPhone and iPad can be found on the App Store.",

# Keyman for Linux
"product_linux" => "Keyman for Linux",

"install_via_launchpad" => "Ubuntu, Wasta-Linux: Keyman for Linux can be installed via launchpad:",

# Products for Software Developers
"products_for_software_developers" => "Products for Software Developers",

# KeymanWeb
"product_keymanweb" => "KeymanWeb",

# Keyman Developer
"product_developer" => "Keyman Developer",

# Keyman Engine for Android
"product_engine_android" => "Keyman Engine for Android",

# Keyman Engine for iOS
"product_engine_ios" => "Keyman Engine for iOS",

## Tiers
"alpha" => "alpha",

"beta" => "beta",

"stable" => "stable",

# (released {date}, {file size})
"released_date_size" => "(released %1\$s, %2\$s)",

# All {product} {tier} releases
"all_product_releases" => "All %1\$s %2\$s releases",

# No downloads found for {product}
"no_downloads_found" => "No downloads found for %1\$s."
]
;

Loading
Loading