diff --git a/.htaccess b/.htaccess index 9ac54189..d7665f89 100644 --- a/.htaccess +++ b/.htaccess @@ -96,7 +96,7 @@ RewriteRule "^keyboards/download/([^/]+)$" "/keyboards/keyboard.php?id=$1" [END, # /keyboards/share/[id] to /keyboards/share.php # if the keyboard exists in the repo, then share.php will redirect to /keyboards/ -RewriteRule "^keyboards/share/([^/]+)$" "/keyboards/share.php?id=$1" [END] +RewriteRule "^keyboards/share/([^/]+)$" "/keyboards/share.php?id=$1" [END,QSA] # /keyboards/{id}.json to /keyboards/keyboard.json.php RewriteRule "^keyboards/(?!keyboard.json)(.*)\.json$" "/keyboards/keyboard.json.php?id=$1" [END] diff --git a/_includes/includes/ui/keyboard-details.php b/_includes/includes/ui/keyboard-details.php index 9135924e..0132e45d 100644 --- a/_includes/includes/ui/keyboard-details.php +++ b/_includes/includes/ui/keyboard-details.php @@ -11,12 +11,12 @@ use \Keyman\Site\com\keyman\Locale; use \Keyman\Site\com\keyman; - Locale::definePageLocale('LOCALE_KEYBOARD_DETAILS', 'keyboards/details'); + Locale::definePageLocale('LOCALE_KEYBOARDS_DETAILS', 'keyboards/details'); $_m_KeyboardDetails = function($id, ...$args) { - return Locale::m(LOCALE_KEYBOARD_DETAILS, $id, ...$args); + return Locale::m(LOCALE_KEYBOARDS_DETAILS, $id, ...$args); }; function _m_KeyboardDetails($id, ...$args) { - return Locale::m(LOCALE_KEYBOARD_DETAILS, $id, ...$args); + return Locale::m(LOCALE_KEYBOARDS_DETAILS, $id, ...$args); } define('GITHUB_ROOT', 'https://github.com/keymanapp/keyboards/tree/master/'); diff --git a/_includes/locale/strings/keyboards/install/en.php b/_includes/locale/strings/keyboards/install/en.php new file mode 100644 index 00000000..a55aff7d --- /dev/null +++ b/_includes/locale/strings/keyboards/install/en.php @@ -0,0 +1,71 @@ + + "Your %1\$s keyboard download should start shortly. + If it does not,click the button below to start the download.", + + # Help on installing keyboard + "help_on_installing_keyboard" => "Help on installing a keyboard", + + # Help on installing Keyman + "help_on_installing_keyman" => "Help on installing Keyman", + + # Download keyboard + "download_keyboard" => "Download keyboard", + + # Download just this keyboard... + "download_just_keyboard" => "Download just this keyboard", + + # ... and then install in the app + "and_then_install_in_the_app" => "and then install in the app.", + + # Install keyboard button + "install_keyboard" => "Install keyboard", + + # {keyboard} home + "keyboard_home" => "%1\$s keyboard home", + + # Keyman for {platform} not installed + "platform_not_installed" => + "If you have not yet installed %1\$s, please install it first before installing the keyboard.", + + # Download and install Keyman title + "download_keyman_title" => "Download and install Keyman", + + # Install Keyman for {platform} + "install_keyman" => "Install %1\$s", + + # Keyman for Android + "with_play_store" => + "Install Keyman together with %1\$s keyboard through the Google Play Store:", + + # Install from Play Store + "install_from_play_store" => + "Install from Play Store", + + # Installs Keyman and {keyboard} for {platform} + "keyman_and_keyboard_for_platform" => + "Installs Keyman and %1\$s keyboard for %2\$s", + + # Keyman already installed? + "already_installed" => "Keyman already installed?", + + # Downloads {keyboard} for {platform} + "downloads_keyboard_for_platform" => + "Downloads %1\$s for %2\$s", + + # {Keyboard} not found + "keyboard_not_found" => "Keyboard %1\$s not found." + +]; diff --git a/_includes/locale/strings/keyboards/install/es.php b/_includes/locale/strings/keyboards/install/es.php new file mode 100644 index 00000000..318b62af --- /dev/null +++ b/_includes/locale/strings/keyboards/install/es.php @@ -0,0 +1,70 @@ + + "La descarga de tu teclado %1\$s debería comenzar en breve. + Si no comienza, haz clic en el botón de abajo para iniciar la descarga.", + + # Help on installing keyboard + "help_on_installing_keyboard" => "Ayuda para instalar un teclado", + + # Help on installing Keyman + "help_on_installing_keyman" => "Ayuda para instalar Keyman", + + # Download keyboard + "download_keyboard" => "Descargar teclado", + + # Download just this keyboard... + "download_just_keyboard" => "Descarga solo este teclado", + + # ... and then install in the app + "and_then_install_in_the_app" => "y luego instálala en la aplicación.", + + # Install keyboard button + "install_keyboard" => "Instalar teclado", + + # {keyboard} home + "keyboard_home" => "Inicio del teclado %1\$s", + + # Keyman for {platform} not installed + "platform_not_installed" => + "Si aún no ha instalado %1\$s, instálelo primero antes de instalar el teclado.", + + # Download and install Keyman title + "download_keyman_title" => "Descarga e instala Keyman", + + # Install Keyman for {platform} + "install_keyman" => "Instalar %1\$s", + + # Keyman for Android + "with_play_store" => + "Instala Keyman junto con el teclado %1\$s a través de Google Play Store:", + + # Install from Play Store + "install_from_play_store" => + "Instalar desde Play Store", + + # Installs Keyman and {keyboard} for {platform} + "keyman_and_keyboard_for_platform" => + "Instala Keyman y el teclado %1\$s para %2\$s", + + # Keyman already installed? + "already_installed" => "¿Keyman ya instalada?", + + # Downloads {keyboard} for {platform} + "downloads_keyboard_for_platform" => + "Descargas %1\$s para %2\$s", + + # {Keyboard} not found + "keyboard_not_found" => "No se encontró el teclado %1\$s." + +]; diff --git a/_includes/locale/strings/keyboards/install/fr.php b/_includes/locale/strings/keyboards/install/fr.php new file mode 100644 index 00000000..b299048b --- /dev/null +++ b/_includes/locale/strings/keyboards/install/fr.php @@ -0,0 +1,70 @@ + + "Le téléchargement de votre clavier %1\$s devrait démarrer sous peu. + Si ce n'est pas le cas, cliquez sur le bouton ci-dessous pour lancer le téléchargement.", + + # Help on installing keyboard + "help_on_installing_keyboard" => "Aide pour l'installation du clavier", + + # Help on installing Keyman + "help_on_installing_keyman" => "Aide à l'installation de Keyman", + + # Download keyboard + "download_keyboard" => "Télécharger le clavier", + + # Download just this keyboard... + "download_just_keyboard" => "Téléchargez uniquement ce clavier", + + # ... and then install in the app + "and_then_install_in_the_app" => "puis installez-le dans l'application.", + + # Install keyboard button + "install_keyboard" => "Installer le clavier", + + # {keyboard} home + "keyboard_home" => "%1\$s clavier Accueil", + + # Keyman for {platform} not installed + "platform_not_installed" => + "Si vous n'avez pas encore installé %1\$s, veuillez l'installer avant d'installer le clavier.", + + # Download and install Keyman title + "download_keyman_title" => "Téléchargez et installez Keyman", + + # Install Keyman for {platform} + "install_keyman" => "Installer %1\$s", + + # Keyman for Android + "with_play_store" => + "Installez Keyman ainsi que le clavier %1\$s via le Google Play Store:", + + # Install from Play Store + "install_from_play_store" => + "Installer depuis le Play Store", + + # Installs Keyman and {keyboard} for {platform} + "keyman_and_keyboard_for_platform" => + "Installe Keyman et le clavier %1\$s pour %2\$s", + + # Keyman already installed? + "already_installed" => "Keyman est-il déjà installé?", + + # Downloads {keyboard} for {platform} + "downloads_keyboard_for_platform" => + "Téléchargements %1\$s pour %2\$s", + + # {Keyboard} not found + "keyboard_not_found" => "Clavier %1\$s introuvable." + +]; diff --git a/_includes/locale/strings/keyboards/share/en.php b/_includes/locale/strings/keyboards/share/en.php new file mode 100644 index 00000000..c60042d9 --- /dev/null +++ b/_includes/locale/strings/keyboards/share/en.php @@ -0,0 +1,41 @@ + "Share Keyboard %1\$s", + + # Page title - Sharing {keyboard} + "h1_sharing_keyboard" => "Sharing keyboard %1\$s", + + "line1" => "You probably arrived here by scanning a QRCode or opening a link + to share a keyboard from the Keyman app.", + + "line2" => "We are sorry, but unfortunately, the keyboard you are interested in, called ", + + "line3" => "is not currently available from the Keyman keyboards repository.", + + "h2_how_to_get" => "How you can get this keyboard", + + "how_to_get_1" => "This keyboard has been distributed peer-to-peer rather than through + the Keyman keyboards repository, so the best way to access the keyboard + is to ask the person who shared this link or QRCode with you.", + + "how_to_get_2" => "If you cannot locate the person who shared the keyboard with you, + please do feel free to ask on the ", + + # link to the Keyman forum + "keyman_forum" => "Keyman Community Forum", + + "how_to_get_3" => "for assistance in locating the keyboard or a suitable alternative." + + +]; diff --git a/_includes/locale/strings/keyboards/share/es.php b/_includes/locale/strings/keyboards/share/es.php new file mode 100644 index 00000000..2ea9a128 --- /dev/null +++ b/_includes/locale/strings/keyboards/share/es.php @@ -0,0 +1,41 @@ + "Compartir teclado %1\$s", + + # Page title - Sharing {keyboard} + "h1_sharing_keyboard" => "Compartir teclado %1\$s", + + "line1" => "Probablemente llegaste aquí escaneando un código QR o abriendo un enlace + para compartir un teclado desde la aplicación Keyman.", + + "line2" => "Lo sentimos, pero desafortunadamente, el teclado que le interesa se llama", + + "line3" => "actualmente no está disponible en el repositorio de teclados Keyman.", + + "h2_how_to_get" => "Cómo puedes conseguir este teclado", + + "how_to_get_1" => "Este teclado se ha distribuido de forma peer-to-peer en lugar de a través de + el repositorio de teclados Keyman, por lo que la mejor manera de acceder al teclado + es preguntarle a la persona que compartió este enlace o código QR contigo.", + + "how_to_get_2" => "Si no logras encontrar a la persona con la que compartiste el teclado, + no dudes en preguntar en el foro.", + + # link to the Keyman forum + "keyman_forum" => "Foro de la comunidad Keyman", + + "how_to_get_3" => "para obtener ayuda para localizar el teclado o una alternativa adecuada." + + +]; diff --git a/_includes/locale/strings/keyboards/share/fr.php b/_includes/locale/strings/keyboards/share/fr.php new file mode 100644 index 00000000..c928fbc7 --- /dev/null +++ b/_includes/locale/strings/keyboards/share/fr.php @@ -0,0 +1,41 @@ + "Partager le clavier %1\$s", + + # Page title - Sharing {keyboard} + "h1_sharing_keyboard" => "Partage de clavier %1\$s", + + "line1" => "Vous êtes probablement arrivé ici en scannant un QR Code ou en ouvrant un lien + pour partager un clavier depuis l'application Keyman.", + + "line2" => "Nous sommes désolés, mais malheureusement, le clavier qui vous intéresse, appelé", + + "line3" => "n'est actuellement pas disponible dans le dépôt de claviers Keyman.", + + "h2_how_to_get" => "Comment vous pouvez vous procurer ce clavier", + + "how_to_get_1" => "Ce clavier a été distribué de pair à pair plutôt que par l'intermédiaire du + référentiel de claviers Keyman. + La meilleure façon d'y accéder est donc de demander à la personne qui vous a partagé ce lien ou ce code QR.", + + "how_to_get_2" => "Si vous ne parvenez pas à retrouver la personne avec qui vous avez partagé le clavier, + n'hésitez pas à poser votre question sur", + + # link to the Keyman forum + "keyman_forum" => "Forum communautaire Keyman", + + "how_to_get_3" => "pour obtenir de l'aide afin de trouver le clavier ou une alternative appropriée." + + +]; diff --git a/keyboards/install.php b/keyboards/install.php index 756b3b8b..8a69b2ca 100644 --- a/keyboards/install.php +++ b/keyboards/install.php @@ -4,6 +4,7 @@ namespace Keyman\Site\com\keyman; require __DIR__ . '/../_includes/autoload.php'; + require_once('./session.php'); use Keyman\Site\com\keyman\templates\Head; use Keyman\Site\com\keyman\templates\Menu; @@ -15,6 +16,15 @@ use Keyman\Site\Common\KeymanVersion; use Keyman\Site\com\keyman\Validation; use Keyman\Site\com\keyman\Util; + use Keyman\Site\com\keyman\Locale; + + Locale::definePageLocale('LOCALE_KEYBOARDS_INSTALL', 'keyboards/install'); + $_m = function($id, ...$args) { + return Locale::m(LOCALE_KEYBOARDS_INSTALL, $id, ...$args); + }; + function _m($id, ...$args) { + return Locale::m(LOCALE_KEYBOARDS_INSTALL, $id, ...$args); + } // Bundled downloads will make use of Keyman tier, which the site visitor // can override with tier=[alpha|beta|stable]. If no override has been @@ -88,6 +98,8 @@ public static function render_keyboard_details($id, $tier, $bcp47) { } protected static function WriteWindowsBoxes() { + global $_m; + $keyboard = self::$keyboard; $tier = self::$tier; $version = self::$versions->windows->$tier; @@ -123,16 +135,15 @@ protected static function WriteWindowsBoxes() { $result = << -

Your {$h['name']} keyboard download should start shortly. If it does not, - click the button below to start the download.

- +

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

+ END; @@ -140,6 +151,8 @@ protected static function WriteWindowsBoxes() { } protected static function WritemacOSBoxes() { + global $_m; + $keyboard = self::$keyboard; $tier = self::$tier; @@ -173,17 +186,17 @@ protected static function WritemacOSBoxes() { $result = <<
-

If you have not yet installed Keyman for macOS, please install it first before installing the keyboard.

+

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

    -
  1. Install Keyman for macOS
  2. +
  3. {$_m('install_keyman', 'Keyman for macOS')}
  4. - Install keyboard -
    Downloads {$h['name']} for macOS.
    + {$_m('install_keyboard')} +
    {$_m('downloads_keyboard_for_platform', $h['name'], 'macOS')}
@@ -192,6 +205,8 @@ protected static function WritemacOSBoxes() { } protected static function WriteLinuxBoxes() { + global $_m; + $keyboard = self::$keyboard; $tier = self::$tier; @@ -228,18 +243,19 @@ protected static function WriteLinuxBoxes() { startAfterPageLoad_Linux(document.currentScript.dataset);
-

If you have not yet installed Keyman for Linux, please install it first before installing the keyboard.

+

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

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

@@ -248,6 +264,8 @@ protected static function WriteLinuxBoxes() { } protected static function WriteAndroidBoxes() { + global $_m; + $keyboard = self::$keyboard; $tier = self::$tier; @@ -287,15 +305,14 @@ protected static function WriteAndroidBoxes() {

-

Install Keyman together with {$h['name']} keyboard through the Google Play Store:

- Install from Play Store -
Installs Keyman and {$h['name']} keyboard for Android
+

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

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

-

Keyman already installed? Download just this keyboard and then install in the app. -

+

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

@@ -304,6 +321,7 @@ protected static function WriteAndroidBoxes() { } protected static function WriteiOSBoxes() { + global $_m; $keyboard = self::$keyboard; $tier = self::$tier; @@ -338,17 +356,17 @@ protected static function WriteiOSBoxes() { $result = <<
-

If you have not yet installed Keyman for iPhone and iPad, please install it first before installing the keyboard.

+

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

    -
  1. Install Keyman for iPhone and iPad
  2. +
  3. {$_m('install_keyman', 'Keyman for iPhone and iPad')}
  4. - Install keyboard -
    Downloads {$h['name']} for iPhone and iPad.
    + {$_m('install_keyboard')} +
    {$_m('downloads_keyboard_for_platform', $h['name'], 'iPhone and iPad')}
@@ -409,7 +427,7 @@ protected static function WriteTitle() { // If parameters are missing ... ?>

-

Keyboard not found.

+

Tier() == KeymanHosts::TIER_DEVELOPMENT && (ini_get('display_errors') !== '0')) { diff --git a/keyboards/share.php b/keyboards/share.php index ee254543..4f9ac19b 100644 --- a/keyboards/share.php +++ b/keyboards/share.php @@ -4,6 +4,15 @@ require_once('./session.php'); require_once __DIR__ . '/../_includes/autoload.php'; use Keyman\Site\Common\KeymanHosts; + use Keyman\Site\com\keyman\Locale; + + Locale::definePageLocale('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'); @@ -38,26 +47,19 @@ function find_keyboard($id) { // Keyboard not found, so let's explain. $head_options = [ - 'title' => "Share Keyboard: $id" + 'title' => $_m('head_title', $id) ]; head($head_options); ?> -

Sharing keyboard

+

-

You probably arrived here by scanning a QRCode or opening a link -to share a keyboard from the Keyman app. We are sorry, but unfortunately, -the keyboard you are interested in, called , is not currently available from the -Keyman keyboards repository.

+

,

-

How you can get this keyboard

+

-

This keyboard has been distributed peer-to-peer rather than through -the Keyman keyboards repository, so the best way to access the keyboard -is to ask the person who shared this link or QRCode with you.

+

-

If you cannot locate the person who shared the keyboard with you, -please do feel free to ask on the -Keyman Community Forum for assistance in locating the keyboard or -a suitable alternative.

\ No newline at end of file +

+

\ No newline at end of file