mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-07-17 16:39:40 +00:00
refactor: deduplicate OS-specific hotkey detection into a shared helper
This commit is contained in:
parent
5d946c52a7
commit
ec2d230d1b
5 changed files with 31 additions and 6 deletions
13
lib/I18n.php
13
lib/I18n.php
|
|
@ -297,6 +297,19 @@ class I18n
|
|||
return in_array(self::$_language, array('ar', 'he'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get OS-specific copy hotkey modifier key name based on user agent
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
* @return string 'Cmd' on macOS, 'Ctrl' otherwise
|
||||
*/
|
||||
public static function getCopyHotkey()
|
||||
{
|
||||
return isset($_SERVER['HTTP_USER_AGENT']) &&
|
||||
strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false ? 'Cmd' : 'Ctrl';
|
||||
}
|
||||
|
||||
/**
|
||||
* set the default language
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue