Add French keyboard layout support and update language options

This commit is contained in:
ilyesAj
2026-04-11 22:39:40 +02:00
parent aa0546ff37
commit fcb1f1c7fe
6 changed files with 96 additions and 3 deletions

View File

@@ -78,6 +78,7 @@ const de = {
ctrlaltdel: 'Ctrl+Alt+Del',
dropdownEnglish: 'Englisch',
dropdownGerman: 'Deutsch',
dropdownFrench: 'Französisch',
dropdownRussian: 'Russisch'
},
mouse: {

View File

@@ -91,6 +91,7 @@ const en = {
clipboardReadError: 'Failed to read clipboard',
dropdownEnglish: 'English',
dropdownGerman: 'German',
dropdownFrench: 'French',
dropdownRussian: 'Russian',
shortcut: {
title: 'Shortcuts',

View File

@@ -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',

View File

@@ -76,6 +76,7 @@ const ru = {
ctrlaltdel: 'Ctrl+Alt+Del',
dropdownEnglish: 'Английский',
dropdownGerman: 'Немецкий',
dropdownFrench: 'Французский',
dropdownRussian: 'Русский'
},
mouse: {

View File

@@ -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;