Skip to content

Conversation

@darcywong00
Copy link
Contributor

Follows #622 for #384

This localizes the keyboards share and install pages

.htaccess also updated so the query string (lang=) gets appended on the share page

Test-bot: skip

@darcywong00 darcywong00 added this to the A19S16 milestone Nov 18, 2025
@keymanapp-test-bot
Copy link

User Test Results

Test specification and instructions

User tests are not required

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually requesting the same change to #622 if that's okay 😁 (#604 doesn't have any variable duplication so not needed there)

Comment on lines 310 to 317
$downloadKeymanTitle = _m("download_keyman_title");
$withPlayStore = _m("with_play_store", $h['name']);
$installFromPlayStore = _m("install_from_play_store");
$installKeymanAndKeyboard = _m("keyman_and_keyboard_for_platform", $h['name'], "Android");
$alreadyInstalled = _m("already_installed");
$downloadJustKeyboard = _m("download_just_keyboard");
$downloadKeymanUrl = PlayStore::url . "&referrer=" . rawurlencode($referrer);
$andThenInstallInApp = _m("and_then_install_in_the_app");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of introducing lots of variables which results in repetition and divergence of variable names (e.g. $andThenInstallInApp vs and_then_install_in_the_app). Is there a way we just embed in the strings instead?

e.g. in Locale.php, add the following line to declare a global variable $_m:

$_m = '_m';
echo <<<END
  ... {$_m('already_installed')} ...

This ends up calling _m(...) which is kinda weird and kinda helpful.

Here and in #622, #604.

https://stackoverflow.com/a/43759648/1836776

@keyman-server keyman-server modified the milestones: A19S16, A19S17 Nov 22, 2025
Base automatically changed from feat/localize/keyboard-details-map to master December 3, 2025 05:31
@darcywong00 darcywong00 requested a review from mcdurdin December 3, 2025 05:32
use Keyman\Site\com\keyman\Util;
use Keyman\Site\com\keyman\Locale;

define('LOCALE_KEYBOARD_INSTALL', 'keyboards/install');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be LOCALE_KEYBOARDS_INSTALL for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose? In keyboard-details, we used LOCAL_KEYBOARD_DETAILS

define('LOCALE_KEYBOARD_DETAILS', 'keyboards/details');
$_m_KeyboardDetails = function($id, ...$args) {
return Locale::m(LOCALE_KEYBOARD_DETAILS, $id, ...$args);
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw that this morning and then when I saw it here also I realized that we should probably be consistent and it's worth fixing up before we trip over ourselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the 3 pages to use LOCALE_KEYBOARDS_

Comment on lines 9 to 15
define('LOCALE_KEYBOARD_SHARE', 'keyboards/share');
$_m_KeyboardShare = function($id, ...$args) {
return Locale::m(LOCALE_KEYBOARD_SHARE, $id, ...$args);
};
function _m_KeyboardShare($id, ...$args) {
return Locale::m(LOCALE_KEYBOARD_SHARE, $id, ...$args);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dittos

darcywong00 and others added 2 commits December 3, 2025 18:42
Co-authored-by: Marc Durdin <marc@durdin.net>
@darcywong00 darcywong00 requested a review from mcdurdin December 4, 2025 02:02
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@darcywong00 darcywong00 merged commit 14007af into master Dec 4, 2025
5 checks passed
@darcywong00 darcywong00 deleted the feat/localize/keyboards-share branch December 4, 2025 07:06
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants