mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
Merge pull request #788 from ilyesAj/feat/add_french_layout
Add French keyboard layout support on paste window
This commit is contained in:
@@ -78,6 +78,7 @@ const de = {
|
||||
ctrlaltdel: 'Ctrl+Alt+Del',
|
||||
dropdownEnglish: 'Englisch',
|
||||
dropdownGerman: 'Deutsch',
|
||||
dropdownFrench: 'Französisch',
|
||||
dropdownRussian: 'Russisch'
|
||||
},
|
||||
mouse: {
|
||||
|
||||
@@ -91,6 +91,7 @@ const en = {
|
||||
clipboardReadError: 'Failed to read clipboard',
|
||||
dropdownEnglish: 'English',
|
||||
dropdownGerman: 'German',
|
||||
dropdownFrench: 'French',
|
||||
dropdownRussian: 'Russian',
|
||||
shortcut: {
|
||||
title: 'Shortcuts',
|
||||
|
||||
@@ -70,7 +70,14 @@ const fr = {
|
||||
placeholder: 'Veuillez saisir',
|
||||
submit: 'Soumettre',
|
||||
virtual: 'Clavier',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
ctrlaltdel: 'Ctrl+Alt+Del',
|
||||
readClipboard: 'Lire le presse-papiers',
|
||||
clipboardPermissionDenied: "Accès au presse-papiers refusé. Veuillez autoriser l'accès dans votre navigateur.",
|
||||
clipboardReadError: 'Échec de la lecture du presse-papiers',
|
||||
dropdownEnglish: 'Anglais',
|
||||
dropdownGerman: 'Allemand',
|
||||
dropdownFrench: 'Français',
|
||||
dropdownRussian: 'Russe'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Curseur par défaut',
|
||||
|
||||
@@ -76,6 +76,7 @@ const ru = {
|
||||
ctrlaltdel: 'Ctrl+Alt+Del',
|
||||
dropdownEnglish: 'Английский',
|
||||
dropdownGerman: 'Немецкий',
|
||||
dropdownFrench: 'Французский',
|
||||
dropdownRussian: 'Русский'
|
||||
},
|
||||
mouse: {
|
||||
|
||||
@@ -29,6 +29,7 @@ export const Paste = () => {
|
||||
const languages = [
|
||||
{ value: 'en', label: t('keyboard.dropdownEnglish') },
|
||||
{ value: 'de', label: t('keyboard.dropdownGerman') },
|
||||
{ value: 'fr', label: t('keyboard.dropdownFrench') },
|
||||
{ value: 'ru', label: t('keyboard.dropdownRussian') }
|
||||
];
|
||||
|
||||
@@ -132,10 +133,11 @@ export const Paste = () => {
|
||||
|
||||
function isValidForLanguage(value: string, selectedLangue: string) {
|
||||
const isRussian = selectedLangue === 'ru';
|
||||
|
||||
const isFrench = selectedLangue === 'fr';
|
||||
|
||||
for (const ch of value) {
|
||||
const code = ch.codePointAt(0) ?? 0;
|
||||
|
||||
|
||||
if (isRussian) {
|
||||
// For Russian language, allow Cyrillic letters and special characters
|
||||
// that can be typed on Russian keyboard (but not English letters)
|
||||
@@ -149,6 +151,12 @@ export const Paste = () => {
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
} else if (isFrench) {
|
||||
// For French, allow ASCII and Latin-1/Extended accented characters
|
||||
// (é è ê ë à â ù û ç î ï ô œ æ ° µ £ § ¨ etc.)
|
||||
if (code <= 0x7F) continue;
|
||||
if (code >= 0x00A0 && code <= 0x017E) continue;
|
||||
return false;
|
||||
} else {
|
||||
// For English/German, only allow ASCII
|
||||
if (code <= 0x7F) continue;
|
||||
|
||||
Reference in New Issue
Block a user