From a319447ecd60cf16e446181918ecded3c61a04ab Mon Sep 17 00:00:00 2001 From: GitBluub Date: Thu, 1 Jun 2023 00:49:30 +0900 Subject: [PATCH] fix: scoreview more infos --- front/i18n/Translations.ts | 835 +++++++++++++++++++------------------ front/views/ScoreView.tsx | 50 ++- scorometer/main.py | 44 +- 3 files changed, 501 insertions(+), 428 deletions(-) diff --git a/front/i18n/Translations.ts b/front/i18n/Translations.ts index 5e1d25d..e49f043 100644 --- a/front/i18n/Translations.ts +++ b/front/i18n/Translations.ts @@ -1,230 +1,237 @@ export const en = { - welcome: 'Welcome', - welcomeMessage: 'Welcome back ', - signOutBtn: 'Sign out', - signInBtn: 'Sign in', - signUpBtn: 'Sign up', - changeLanguageBtn: 'Change language', - search: 'Search', - login: 'Login', - signUp: 'Sign up', - signIn: 'Sign in', - searchBtn: 'Search', - play: 'Play', - playBtn: 'Play', - practiceBtn: 'Practice', - playAgain: 'Play Again', - songPageBtn: 'Go to song page', - level: 'Level', - chapters: 'Chapters', - bestScore: 'Best Score', - lastScore: 'Last Score', - langBtn: 'Language', - backBtn: 'Back', - settingsBtn: 'Settings', - prefBtn: 'Preferences', - notifBtn: 'Notifications', - privBtn: 'Privacy', - goNextStep: 'Step Up!', - mySkillsToImprove: 'My Competencies to work on', - recentlyPlayed: 'Recently played', - - songsToGetBetter: 'Recommendations', - lastSearched: 'Last searched', - levelProgress: 'good notes', - score: 'Score', + welcome: "Welcome", + welcomeMessage: "Welcome back ", + signOutBtn: "Sign out", + signInBtn: "Sign in", + signUpBtn: "Sign up", + changeLanguageBtn: "Change language", + search: "Search", + login: "Login", + signUp: "Sign up", + signIn: "Sign in", + searchBtn: "Search", + play: "Play", + playBtn: "Play", + practiceBtn: "Practice", + playAgain: "Play Again", + songPageBtn: "Go to song page", + level: "Level", + chapters: "Chapters", + bestScore: "Best Score", + lastScore: "Last Score", + langBtn: "Language", + backBtn: "Back", + settingsBtn: "Settings", + prefBtn: "Preferences", + notifBtn: "Notifications", + privBtn: "Privacy", + goNextStep: "Step Up!", + mySkillsToImprove: "My Competencies to work on", + recentlyPlayed: "Recently played", + + songsToGetBetter: "Recommendations", + lastSearched: "Last searched", + levelProgress: "good notes", + score: "Score", //search - allFilter: 'All', - artistFilter: 'Artists', - songsFilter: 'Songs', - genreFilter: 'Genres', + allFilter: "All", + artistFilter: "Artists", + songsFilter: "Songs", + genreFilter: "Genres", // profile page - user: 'Profile', - medals: 'Medals', - playerStats: 'My stats', - mostPlayedSong: 'Most played song : ', - goodNotesPlayed: 'Good notes played : ', - longestCombo: 'Longest combo : ', - favoriteGenre: 'Favorite genre : ', + user: "Profile", + medals: "Medals", + playerStats: "My stats", + mostPlayedSong: "Most played song : ", + goodNotesPlayed: "Good notes played : ", + longestCombo: "Longest combo : ", + favoriteGenre: "Favorite genre : ", // Difficulty settings - diffBtn: 'Difficulty', - easy: 'Beginner', - medium: 'Intermediate', - hard: 'Pro', + diffBtn: "Difficulty", + easy: "Beginner", + medium: "Intermediate", + hard: "Pro", // theme settings - dark: 'Dark', - system: 'System', - light: 'Light', + dark: "Dark", + system: "System", + light: "Light", // competencies - pedalsCompetency: 'Pedals', - rightHandCompetency: 'Right hand', - leftHandCompetency: 'Left hand', - accuracyCompetency: 'Accuracy', - arpegeCompetency: 'Arpeges', - chordsCompetency: 'Chords', + pedalsCompetency: "Pedals", + rightHandCompetency: "Right hand", + leftHandCompetency: "Left hand", + accuracyCompetency: "Accuracy", + arpegeCompetency: "Arpeges", + chordsCompetency: "Chords", /* account settings and logs */ // buttons - requirementsSentence: 'Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and One Special Case Character', - + requirementsSentence: + "Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and One Special Case Character", // feedback for the user - usernameTooShort: 'Username is too short', - passwordTooShort: 'Password is too short', - usernameTooLong: 'Username is too long', - passwordTooLong: 'Password is too long', - passwordsDontMatch: 'Passwords don\'t match', - invalidCredentials: 'Invalid credentials', - invalidEmail: 'Invalid email', - accountCreated: 'Account created', - loggedIn: 'Logged in', - precisionScore: 'Precision', - goodNotesInARow: 'Good notes in a row', - usernameTaken: 'Username already taken', - goodNotes: 'good notes', + usernameTooShort: "Username is too short", + passwordTooShort: "Password is too short", + usernameTooLong: "Username is too long", + passwordTooLong: "Password is too long", + passwordsDontMatch: "Passwords don't match", + invalidCredentials: "Invalid credentials", + invalidEmail: "Invalid email", + accountCreated: "Account created", + loggedIn: "Logged in", + precisionScore: "Precision", + goodNotesInARow: "Good notes in a row", + usernameTaken: "Username already taken", + goodNotes: "good notes", // categories - username: 'Username', - password: 'Password', - email: 'Email', - repeatPassword: 'Repeat password', - changepasswdBtn: 'Change Password', - changeemailBtn: 'Change Email', - googleacctBtn: 'Google Account', - forgottenPassword: 'Forgotten password', - partition: 'Partition', + username: "Username", + password: "Password", + email: "Email", + repeatPassword: "Repeat password", + changepasswdBtn: "Change Password", + changeemailBtn: "Change Email", + googleacctBtn: "Google Account", + forgottenPassword: "Forgotten password", + partition: "Partition", //errors - unknownError: 'Unknown error', - errAlrdExst: 'Already exist', - errIncrrct: 'Incorrect Credentials', - errNoResults: 'No Results Found', - userProfileFetchError: 'An error occured while fetching your profile', - tryAgain: 'Try Again', + unknownError: "Unknown error", + errAlrdExst: "Already exist", + errIncrrct: "Incorrect Credentials", + errNoResults: "No Results Found", + userProfileFetchError: "An error occured while fetching your profile", + tryAgain: "Try Again", // Playback messages - missed: 'Missed note', - perfect: 'Perfect', - great: 'Great', - good: 'Good', - wrong: 'Wrong', - short: 'A little too short', - long: 'A little too long', - tooLong: 'Too Long', - tooShort: 'Too Short', + missed: "Missed note", + perfect: "Perfect", + great: "Great", + good: "Good", + bestStreak: "Best streak", + precision: "Precision", + wrong: "Wrong", + short: "A little too short", + long: "A little too long", + tooLong: "Too Long", + tooShort: "Too Short", + changePassword: "Change password", + oldPassword: "Old password", + newPassword: "New password", + confirmNewPassword: "Confirm new password", + submitBtn: "Submit", - changePassword: 'Change password', - oldPassword: 'Old password', - newPassword: 'New password', - confirmNewPassword: 'Confirm new password', - submitBtn: 'Submit', + changeEmail: "Change email", + oldEmail: "Old email", + newEmail: "New email", - changeEmail: 'Change email', - oldEmail: 'Old email', - newEmail: 'New email', + passwordUpdated: "Password updated", + emailUpdated: "Email updated", - passwordUpdated: 'Password updated', - emailUpdated: 'Email updated', + SettingsCategoryProfile: "Profile", + SettingsCategoryPreferences: "Preferences", + SettingsCategoryNotifications: "Notifications", + SettingsCategoryPrivacy: "Privacy", + SettingsCategorySecurity: "Security", + SettingsCategoryEmail: "Email", + SettingsCategoryGoogle: "Google", + SettingsCategoryPiano: "Piano", + SettingsCategoryGuest: "Guest", - SettingsCategoryProfile: 'Profile', - SettingsCategoryPreferences: 'Preferences', - SettingsCategoryNotifications: 'Notifications', - SettingsCategoryPrivacy: 'Privacy', - SettingsCategorySecurity: 'Security', - SettingsCategoryEmail: 'Email', - SettingsCategoryGoogle: 'Google', - SettingsCategoryPiano: 'Piano', - SettingsCategoryGuest: 'Guest', + transformGuestToUserExplanations: + "You can transform your guest account to a user account by providing a username and a password. You will then be able to save your progress and access your profile.", + SettingsNotificationsPushNotifications: "Push", + SettingsNotificationsEmailNotifications: "Email", + SettingsNotificationsTrainingReminder: "Training reminder", + SettingsNotificationsReleaseAlert: "Release alert", - transformGuestToUserExplanations: 'You can transform your guest account to a user account by providing a username and a password. You will then be able to save your progress and access your profile.', - SettingsNotificationsPushNotifications: 'Push', - SettingsNotificationsEmailNotifications: 'Email', - SettingsNotificationsTrainingReminder: 'Training reminder', - SettingsNotificationsReleaseAlert: 'Release alert', + dataCollection: "Data collection", + customAds: "Custom ads", + recommendations: "Recommendations", - dataCollection: 'Data collection', - customAds: 'Custom ads', - recommendations: 'Recommendations', + SettingsPreferencesTheme: "Theme", + SettingsPreferencesLanguage: "Language", + SettingsPreferencesDifficulty: "Difficulty", + SettingsPreferencesColorblindMode: "Colorblind mode", + SettingsPreferencesMicVolume: "Mic volume", + SettingsPreferencesDevice: "Device", - SettingsPreferencesTheme: 'Theme', - SettingsPreferencesLanguage: 'Language', - SettingsPreferencesDifficulty: 'Difficulty', - SettingsPreferencesColorblindMode: 'Colorblind mode', - SettingsPreferencesMicVolume: 'Mic volume', - SettingsPreferencesDevice: 'Device', - - NoAssociatedEmail: 'No associated email', - nbGamesPlayed: 'Games played', - XPDescription: 'XP is a measure of your progress. You earn XP by playing songs and completing challenges.', - userCreatedAt: 'Creation date', + NoAssociatedEmail: "No associated email", + nbGamesPlayed: "Games played", + XPDescription: + "XP is a measure of your progress. You earn XP by playing songs and completing challenges.", + userCreatedAt: "Creation date", premiumAccount: "Premium account", - yes: 'Yes', - no: 'No', + yes: "Yes", + no: "No", - Attention: 'Attention', - YouAreCurrentlyConnectedWithAGuestAccountWarning: "You are currently connected with a guest account. Disconneting will result in your data being lost. If you want to save your progress, you need to create an account.", + Attention: "Attention", + YouAreCurrentlyConnectedWithAGuestAccountWarning: + "You are currently connected with a guest account. Disconneting will result in your data being lost. If you want to save your progress, you need to create an account.", - recentSearches: 'Recent searches', - noRecentSearches: 'No recent searches', + recentSearches: "Recent searches", + noRecentSearches: "No recent searches", }; export const fr: typeof en = { - welcome: 'Bienvenue', - welcomeMessage: 'Re-Bonjour ', - signOutBtn: 'Se déconnecter', - signInBtn: 'Se connecter', - changeLanguageBtn: 'Changer la langue', - searchBtn: 'Rechercher', - playBtn: 'Jouer', - practiceBtn: 'S\'entrainer', - playAgain: 'Rejouer', - songPageBtn: 'Aller sur la page de la chanson', - level: 'Niveau', - chapters: 'Chapitres', - bestScore: 'Meilleur Score', - lastScore: 'Dernier Score', - langBtn: 'Langage', - backBtn: 'Retour', - prefBtn: 'Préférences', - notifBtn: 'Notifications', - privBtn: 'Confidentialité', + welcome: "Bienvenue", + welcomeMessage: "Re-Bonjour ", + signOutBtn: "Se déconnecter", + signInBtn: "Se connecter", + changeLanguageBtn: "Changer la langue", + searchBtn: "Rechercher", + playBtn: "Jouer", + practiceBtn: "S'entrainer", + playAgain: "Rejouer", + songPageBtn: "Aller sur la page de la chanson", + level: "Niveau", + chapters: "Chapitres", + bestScore: "Meilleur Score", + lastScore: "Dernier Score", + bestStreak: "Meilleure série", + precision: "Précision", - play: 'Jouer', - changeEmail: 'Changer d\'email', - newEmail: 'Nouvel email', - oldEmail: 'Ancien email', + langBtn: "Langage", + backBtn: "Retour", + prefBtn: "Préférences", + notifBtn: "Notifications", + privBtn: "Confidentialité", + + play: "Jouer", + changeEmail: "Changer d'email", + newEmail: "Nouvel email", + oldEmail: "Ancien email", // profile page - user: 'Profil', - medals: 'Medailles', - playerStats: 'Mes statistiques', - mostPlayedSong: 'Chanson la plus jouée : ', - goodNotesPlayed: 'Bonnes notes jouées : ', - longestCombo: 'Combo le plus long : ', - favoriteGenre: 'Genre favori : ', + user: "Profil", + medals: "Medailles", + playerStats: "Mes statistiques", + mostPlayedSong: "Chanson la plus jouée : ", + goodNotesPlayed: "Bonnes notes jouées : ", + longestCombo: "Combo le plus long : ", + favoriteGenre: "Genre favori : ", //search - allFilter: 'Tout', - artistFilter: 'Artistes', - songsFilter: 'Morceaux', - genreFilter: 'Genres', + allFilter: "Tout", + artistFilter: "Artistes", + songsFilter: "Morceaux", + genreFilter: "Genres", // Difficulty settings - diffBtn: 'Difficulté', - easy: 'Débutant', - medium: 'Intermédiaire', - hard: 'Avancé', + diffBtn: "Difficulté", + easy: "Débutant", + medium: "Intermédiaire", + hard: "Avancé", // theme settings - dark: 'Foncé', - system: 'Système', - light: 'Clair', + dark: "Foncé", + system: "Système", + light: "Clair", settingsBtn: "Réglages", goNextStep: "Prochaine Etape", mySkillsToImprove: "Mes Skills", @@ -232,292 +239,302 @@ export const fr: typeof en = { search: "Rechercher", lastSearched: "Dernières recherches", levelProgress: "Niveau", - login: 'Se connecter', + login: "Se connecter", signUp: "S'inscrire", signIn: "Se connecter", - oldPassword: 'Ancien mot de passe', - newPassword: 'Nouveau mot de passe', - confirmNewPassword: 'Confirmer le nouveau mot de passe', - submitBtn: 'Soumettre', + oldPassword: "Ancien mot de passe", + newPassword: "Nouveau mot de passe", + confirmNewPassword: "Confirmer le nouveau mot de passe", + submitBtn: "Soumettre", // competencies - pedalsCompetency: 'Pédales', - rightHandCompetency: 'Main droite', - leftHandCompetency: 'Main gauche', - accuracyCompetency: 'Justesse', - arpegeCompetency: 'Arpege', - chordsCompetency: 'Accords', + pedalsCompetency: "Pédales", + rightHandCompetency: "Main droite", + leftHandCompetency: "Main gauche", + accuracyCompetency: "Justesse", + arpegeCompetency: "Arpege", + chordsCompetency: "Accords", /* account settings and logs */ // buttons - requirementsSentence: 'Doit contenir 8 caractères, une majuscule, une minuscule, un chiffre et un caractère spécial', + requirementsSentence: + "Doit contenir 8 caractères, une majuscule, une minuscule, un chiffre et un caractère spécial", // feedback for the user - usernameTooShort: 'Le nom d\'utilisateur est trop court', - passwordTooShort: 'Le mot de passe est trop court', - usernameTooLong: 'Le nom d\'utilisateur est trop long', - passwordTooLong: 'Le mot de passe est trop long', - passwordsDontMatch: 'Mots de passes différents', - invalidCredentials: 'Identifiants incorrects', - invalidEmail: 'Email invalide', - loggedIn: 'Connecté', - usernameTaken: 'Nom d\'utilisateur déjà pris', - accountCreated: 'Compte créé', + usernameTooShort: "Le nom d'utilisateur est trop court", + passwordTooShort: "Le mot de passe est trop court", + usernameTooLong: "Le nom d'utilisateur est trop long", + passwordTooLong: "Le mot de passe est trop long", + passwordsDontMatch: "Mots de passes différents", + invalidCredentials: "Identifiants incorrects", + invalidEmail: "Email invalide", + loggedIn: "Connecté", + usernameTaken: "Nom d'utilisateur déjà pris", + accountCreated: "Compte créé", // categories - username: 'Nom d\'utilisateur', - password: 'Mot de passe', - email: 'Email', - repeatPassword: 'Confirmer', - score: 'Score', - changePassword: 'Modification du mot de passe', - precisionScore: 'Précision', - goodNotesInARow: 'Bonnes notes à la suite', - songsToGetBetter: 'Recommendations', - goodNotes: 'bonnes notes', - changepasswdBtn: 'Changer le mot de passe', - changeemailBtn: 'Changer l\'email', - googleacctBtn: 'Compte Google', - forgottenPassword: 'Mot de passe oublié', - partition: 'Partition', + username: "Nom d'utilisateur", + password: "Mot de passe", + email: "Email", + repeatPassword: "Confirmer", + score: "Score", + changePassword: "Modification du mot de passe", + precisionScore: "Précision", + goodNotesInARow: "Bonnes notes à la suite", + songsToGetBetter: "Recommendations", + goodNotes: "bonnes notes", + changepasswdBtn: "Changer le mot de passe", + changeemailBtn: "Changer l'email", + googleacctBtn: "Compte Google", + forgottenPassword: "Mot de passe oublié", + partition: "Partition", signUpBtn: "S'inscrire", //errors errAlrdExst: "Utilisateur existe déjà", - unknownError: 'Erreur inconnue', - errIncrrct: 'Identifiant incorrect', - errNoResults: 'Aucun resultat', - userProfileFetchError: 'Une erreur est survenue lors de la récupération du profil', - tryAgain: 'Réessayer', + unknownError: "Erreur inconnue", + errIncrrct: "Identifiant incorrect", + errNoResults: "Aucun resultat", + userProfileFetchError: + "Une erreur est survenue lors de la récupération du profil", + tryAgain: "Réessayer", // Playback messages - missed: 'Raté', - perfect: 'Parfait', - great: 'Super', - good: 'Bien', - wrong: 'Oups', - short: 'Un peu court', - long: 'Un peu long', - tooLong: 'Trop long', - tooShort: 'Trop court', - passwordUpdated: 'Mot de passe mis à jour', - emailUpdated: 'Email mis à jour', + missed: "Raté", + perfect: "Parfait", + great: "Super", + good: "Bien", + wrong: "Oups", + short: "Un peu court", + long: "Un peu long", + tooLong: "Trop long", + tooShort: "Trop court", + passwordUpdated: "Mot de passe mis à jour", + emailUpdated: "Email mis à jour", - SettingsCategoryProfile: 'Profil', - SettingsCategoryPreferences: 'Préférences', - SettingsCategoryNotifications: 'Notifications', - SettingsCategoryPrivacy: 'Confidentialité', - SettingsCategorySecurity: 'Sécurité', - SettingsCategoryEmail: 'Email', - SettingsCategoryGoogle: 'Google', - SettingsCategoryPiano: 'Piano', + SettingsCategoryProfile: "Profil", + SettingsCategoryPreferences: "Préférences", + SettingsCategoryNotifications: "Notifications", + SettingsCategoryPrivacy: "Confidentialité", + SettingsCategorySecurity: "Sécurité", + SettingsCategoryEmail: "Email", + SettingsCategoryGoogle: "Google", + SettingsCategoryPiano: "Piano", - transformGuestToUserExplanations: 'Vous êtes actuellement connecté en tant qu\'invité. Vous pouvez créer un compte pour sauvegarder vos données et profiter de toutes les fonctionnalités de Chromacase.', - SettingsCategoryGuest: 'Invité', - SettingsNotificationsEmailNotifications: 'Email', - SettingsNotificationsPushNotifications: 'Notifications push', - SettingsNotificationsReleaseAlert: 'Alertes de nouvelles Sorties', - SettingsNotificationsTrainingReminder: 'Rappel d\'entrainement', - - SettingsPreferencesColorblindMode: 'Mode daltonien', - SettingsPreferencesDevice: 'Appareil', - SettingsPreferencesDifficulty: 'Difficulté', - SettingsPreferencesLanguage: 'Langue', - SettingsPreferencesTheme: 'Thème', - SettingsPreferencesMicVolume: 'Volume du micro', + transformGuestToUserExplanations: + "Vous êtes actuellement connecté en tant qu'invité. Vous pouvez créer un compte pour sauvegarder vos données et profiter de toutes les fonctionnalités de Chromacase.", + SettingsCategoryGuest: "Invité", + SettingsNotificationsEmailNotifications: "Email", + SettingsNotificationsPushNotifications: "Notifications push", + SettingsNotificationsReleaseAlert: "Alertes de nouvelles Sorties", + SettingsNotificationsTrainingReminder: "Rappel d'entrainement", - dataCollection: 'Collecte de données', - recommendations: 'Recommandations', - customAds: 'Publicités personnalisées', + SettingsPreferencesColorblindMode: "Mode daltonien", + SettingsPreferencesDevice: "Appareil", + SettingsPreferencesDifficulty: "Difficulté", + SettingsPreferencesLanguage: "Langue", + SettingsPreferencesTheme: "Thème", + SettingsPreferencesMicVolume: "Volume du micro", - NoAssociatedEmail: 'Aucun email associé', - nbGamesPlayed: 'Parties jouées', - XPDescription: 'L\'XP est gagnée en jouant des chansons. Plus vous jouez, plus vous gagnez d\'XP. Plus vous avez d\'XP, plus vous montez de niveau.', - userCreatedAt: 'Compte créé le', - premiumAccount: 'Compte premium', - yes: 'Oui', - no: 'Non', + dataCollection: "Collecte de données", + recommendations: "Recommandations", + customAds: "Publicités personnalisées", - Attention: 'Attention', - YouAreCurrentlyConnectedWithAGuestAccountWarning: 'Vous êtes actuellement connecté en tant qu\'invité. La déconnexion résultera en une perte de données. Vous pouvez créer un compte pour sauvegarder vos données.', + NoAssociatedEmail: "Aucun email associé", + nbGamesPlayed: "Parties jouées", + XPDescription: + "L'XP est gagnée en jouant des chansons. Plus vous jouez, plus vous gagnez d'XP. Plus vous avez d'XP, plus vous montez de niveau.", + userCreatedAt: "Compte créé le", + premiumAccount: "Compte premium", + yes: "Oui", + no: "Non", - recentSearches: 'Recherches récentes', - noRecentSearches: 'Aucune recherche récente', + Attention: "Attention", + YouAreCurrentlyConnectedWithAGuestAccountWarning: + "Vous êtes actuellement connecté en tant qu'invité. La déconnexion résultera en une perte de données. Vous pouvez créer un compte pour sauvegarder vos données.", + + recentSearches: "Recherches récentes", + noRecentSearches: "Aucune recherche récente", }; export const sp: typeof en = { - welcomeMessage: 'Benvenido', - signOutBtn: 'Desconectarse', - signInBtn: 'Connectarse', - changepasswdBtn: 'Cambiar la contraseña', - changeemailBtn: 'Cambiar e-mail', - googleacctBtn: 'Cuenta Google', - goodNotes: 'buenas notas', + welcomeMessage: "Benvenido", + signOutBtn: "Desconectarse", + signInBtn: "Connectarse", + changepasswdBtn: "Cambiar la contraseña", + changeemailBtn: "Cambiar e-mail", + googleacctBtn: "Cuenta Google", + goodNotes: "buenas notas", - search: 'Buscar', - login: 'Iniciar sesión', - signUp: 'Registrarse', - signIn: 'Iniciar sesión', - changeEmail: 'Cambiar el correo electrónico', - newEmail: 'Nuevo correo electrónico', - oldEmail: 'Correo electrónico anterior', + search: "Buscar", + login: "Iniciar sesión", + signUp: "Registrarse", + signIn: "Iniciar sesión", + changeEmail: "Cambiar el correo electrónico", + newEmail: "Nuevo correo electrónico", + oldEmail: "Correo electrónico anterior", // competencies - changeLanguageBtn: 'Cambiar el idioma', - searchBtn: 'Buscar', - playBtn: 'reproducir', - practiceBtn: 'Práctica', - playAgain: 'Repetición', - precisionScore: 'Précision', - songPageBtn: 'canción', - level: 'nivele', - chapters: 'Capítulos', - bestScore: 'Mejor puntuación', - lastScore: 'Ùltima puntuación', - prefBtn: 'Preferencias', - notifBtn: 'Notificaciones', - privBtn: 'Privacidad', - goNextStep: 'Da el siguiente paso', - mySkillsToImprove: 'Mis habilidades para mejorar', - recentlyPlayed: 'Recientemente jugado', - lastSearched: 'Ultimas búsquedas', + changeLanguageBtn: "Cambiar el idioma", + searchBtn: "Buscar", + playBtn: "reproducir", + practiceBtn: "Práctica", + playAgain: "Repetición", + precisionScore: "Précision", + songPageBtn: "canción", + level: "nivele", + chapters: "Capítulos", + bestScore: "Mejor puntuación", + lastScore: "Ùltima puntuación", + prefBtn: "Preferencias", + notifBtn: "Notificaciones", + privBtn: "Privacidad", + goNextStep: "Da el siguiente paso", + mySkillsToImprove: "Mis habilidades para mejorar", + recentlyPlayed: "Recientemente jugado", + lastSearched: "Ultimas búsquedas", - welcome: 'Benvenido a Chromacase', - langBtn: 'Langua', - backBtn: 'Volver', - settingsBtn: 'Ajustes', - play: 'Jugar', + welcome: "Benvenido a Chromacase", + langBtn: "Langua", + backBtn: "Volver", + settingsBtn: "Ajustes", + play: "Jugar", // profile page - user: 'Perfil', - medals: 'Medallas', - playerStats: 'mis estadísticas', - mostPlayedSong: 'Canción más reproducida : ', - goodNotesPlayed: 'Buenas notas tocadas : ', - longestCombo: 'combo más largo : ', - favoriteGenre: 'genero favorito : ', + user: "Perfil", + medals: "Medallas", + playerStats: "mis estadísticas", + mostPlayedSong: "Canción más reproducida : ", + goodNotesPlayed: "Buenas notas tocadas : ", + longestCombo: "combo más largo : ", + favoriteGenre: "genero favorito : ", //search - allFilter: 'Todos', - artistFilter: 'Artistas', - songsFilter: 'canciones', - genreFilter: 'géneros', + allFilter: "Todos", + artistFilter: "Artistas", + songsFilter: "canciones", + genreFilter: "géneros", // Difficulty settings - diffBtn: 'Dificultad', - easy: 'Principiante', - medium: 'Intermedio', - hard: 'Avanzado', + diffBtn: "Dificultad", + easy: "Principiante", + medium: "Intermedio", + hard: "Avanzado", // theme settings - dark: 'Oscuro', - system: 'Sistema', - light: 'Claro', + dark: "Oscuro", + system: "Sistema", + light: "Claro", // competencies - pedalsCompetency: 'Pedal', - rightHandCompetency: 'Mano derecha', - leftHandCompetency: 'Mano izquierda', - accuracyCompetency: 'Exactitud', - arpegeCompetency: 'Arpegios', - chordsCompetency: 'Accords', + pedalsCompetency: "Pedal", + rightHandCompetency: "Mano derecha", + leftHandCompetency: "Mano izquierda", + accuracyCompetency: "Exactitud", + arpegeCompetency: "Arpegios", + chordsCompetency: "Accords", /* account settings and logs */ // buttons - requirementsSentence: 'Debe contener 8 caracteres, una mayúscula, una minúscula, un número y un carácter especial', + requirementsSentence: + "Debe contener 8 caracteres, una mayúscula, una minúscula, un número y un carácter especial", // feedback for the user - usernameTooShort: 'Nombre de usuario demasiado corto', - passwordTooShort: 'Contraseña demasiado corta', - usernameTooLong: 'Nombre de usuario demasiado largo', - passwordTooLong: 'Contraseña demasiado larga', - passwordsDontMatch: 'Las contraseñas no coinciden', - invalidCredentials: 'Credenciales incorrectas', - forgottenPassword: 'Contraseña olvidada', - invalidEmail: 'Email inválido', - accountCreated: 'Cuenta creada', - loggedIn: 'Connectado', - usernameTaken: 'Nombre de usuario ya tomado', - score: 'Puntaje', - goodNotesInARow: 'Buenas notas despues', - songsToGetBetter: 'Recomendaciones', + usernameTooShort: "Nombre de usuario demasiado corto", + passwordTooShort: "Contraseña demasiado corta", + usernameTooLong: "Nombre de usuario demasiado largo", + passwordTooLong: "Contraseña demasiado larga", + passwordsDontMatch: "Las contraseñas no coinciden", + invalidCredentials: "Credenciales incorrectas", + forgottenPassword: "Contraseña olvidada", + invalidEmail: "Email inválido", + accountCreated: "Cuenta creada", + loggedIn: "Connectado", + usernameTaken: "Nombre de usuario ya tomado", + score: "Puntaje", + goodNotesInARow: "Buenas notas despues", + songsToGetBetter: "Recomendaciones", // categories - username: 'Nombre del usuario', - password: 'Contraseña', - email: 'Correo electrónico', - repeatPassword: 'Repita la contraseña', - partition: 'Partitura', - levelProgress: 'Nivel progreso', + username: "Nombre del usuario", + password: "Contraseña", + email: "Correo electrónico", + repeatPassword: "Repita la contraseña", + partition: "Partitura", + levelProgress: "Nivel progreso", signUpBtn: "Inscribirse", //errors - unknownError: 'Error desconocido', + unknownError: "Error desconocido", errAlrdExst: "Ya existe", errIncrrct: "credenciales incorrectas", - errNoResults: 'No se han encontrado resultados', + errNoResults: "No se han encontrado resultados", - userProfileFetchError: 'Ocurrió un error al obtener su perfil', - tryAgain: 'intentar otra vez', - + userProfileFetchError: "Ocurrió un error al obtener su perfil", + tryAgain: "intentar otra vez", // Playback messages - missed: 'Te perdiste una nota', - perfect: 'Perfecto', - great: 'Excelente', - good: 'Bueno', - wrong: 'Equivocado', - short: 'Un poco demasiado corto', - long: 'Un poco demasiado largo', - tooLong: 'Demasiado largo', - tooShort: 'Demasiado corto', - changePassword: 'Cambio de contraseña', - oldPassword: 'Contraseña anterior', - newPassword: 'Nueva contraseña', - confirmNewPassword: 'Confirmar nueva contraseña', - submitBtn: 'Enviar', + missed: "Te perdiste una nota", + perfect: "Perfecto", + great: "Excelente", + good: "Bueno", + bestStreak: "Mejor racha", + precision: "Precisión", + wrong: "Equivocado", + short: "Un poco demasiado corto", + long: "Un poco demasiado largo", + tooLong: "Demasiado largo", + tooShort: "Demasiado corto", + changePassword: "Cambio de contraseña", + oldPassword: "Contraseña anterior", + newPassword: "Nueva contraseña", + confirmNewPassword: "Confirmar nueva contraseña", + submitBtn: "Enviar", - passwordUpdated: 'Contraseña actualizada', - emailUpdated: 'Email actualizado', + passwordUpdated: "Contraseña actualizada", + emailUpdated: "Email actualizado", - SettingsCategoryProfile: 'Perfil', - SettingsCategoryPreferences: 'Preferencias', - SettingsCategoryNotifications: 'Notificaciones', - SettingsCategoryPrivacy: 'Privacidad', - SettingsCategorySecurity: 'Seguridad', - SettingsCategoryEmail: 'Email', - SettingsCategoryGoogle: 'Google', - SettingsCategoryPiano: 'Piano', + SettingsCategoryProfile: "Perfil", + SettingsCategoryPreferences: "Preferencias", + SettingsCategoryNotifications: "Notificaciones", + SettingsCategoryPrivacy: "Privacidad", + SettingsCategorySecurity: "Seguridad", + SettingsCategoryEmail: "Email", + SettingsCategoryGoogle: "Google", + SettingsCategoryPiano: "Piano", - transformGuestToUserExplanations: 'Actualmente estás conectado como invitado. Puedes crear una cuenta para guardar tus datos y disfrutar de todas las funciones de Chromacase.', - SettingsCategoryGuest: 'Invitado', - SettingsNotificationsEmailNotifications: 'Email', - SettingsNotificationsPushNotifications: 'Notificaciones push', - SettingsNotificationsReleaseAlert: 'Alertas de nuevas Sorties', - SettingsNotificationsTrainingReminder: 'Recordatorio de entrenamiento', - - SettingsPreferencesColorblindMode: 'Modo daltoniano', - SettingsPreferencesDevice: 'Dispositivo', - SettingsPreferencesDifficulty: 'Dificultad', - SettingsPreferencesLanguage: 'Idioma', - SettingsPreferencesTheme: 'Tema', - SettingsPreferencesMicVolume: 'Volumen del micrófono', + transformGuestToUserExplanations: + "Actualmente estás conectado como invitado. Puedes crear una cuenta para guardar tus datos y disfrutar de todas las funciones de Chromacase.", + SettingsCategoryGuest: "Invitado", + SettingsNotificationsEmailNotifications: "Email", + SettingsNotificationsPushNotifications: "Notificaciones push", + SettingsNotificationsReleaseAlert: "Alertas de nuevas Sorties", + SettingsNotificationsTrainingReminder: "Recordatorio de entrenamiento", - dataCollection: 'Recopilación de datos', - recommendations: 'Recomendaciones', - customAds: 'Anuncios personalizados', + SettingsPreferencesColorblindMode: "Modo daltoniano", + SettingsPreferencesDevice: "Dispositivo", + SettingsPreferencesDifficulty: "Dificultad", + SettingsPreferencesLanguage: "Idioma", + SettingsPreferencesTheme: "Tema", + SettingsPreferencesMicVolume: "Volumen del micrófono", - NoAssociatedEmail: 'No hay correo electrónico asociado', - nbGamesPlayed: 'Partidos jugados', - XPDescription: 'XP se gana jugando canciones. Cuanto más juegas, más XP ganas. Cuanto más XP tienes, más subes de nivel.', - userCreatedAt: 'Cuenta creada el', - premiumAccount: 'Cuenta premium', - yes: 'Sí', - no: 'No', + dataCollection: "Recopilación de datos", + recommendations: "Recomendaciones", + customAds: "Anuncios personalizados", - Attention: 'Atención', - YouAreCurrentlyConnectedWithAGuestAccountWarning: 'Actualmente estás conectado como invitado. La desconexión resultará en la pérdida de datos. Puedes crear una cuenta para guardar tus datos.', + NoAssociatedEmail: "No hay correo electrónico asociado", + nbGamesPlayed: "Partidos jugados", + XPDescription: + "XP se gana jugando canciones. Cuanto más juegas, más XP ganas. Cuanto más XP tienes, más subes de nivel.", + userCreatedAt: "Cuenta creada el", + premiumAccount: "Cuenta premium", + yes: "Sí", + no: "No", - recentSearches: 'Búsquedas recientes', - noRecentSearches: 'No hay búsquedas recientes', -}; \ No newline at end of file + Attention: "Atención", + YouAreCurrentlyConnectedWithAGuestAccountWarning: + "Actualmente estás conectado como invitado. La desconexión resultará en la pérdida de datos. Puedes crear una cuenta para guardar tus datos.", + + recentSearches: "Búsquedas recientes", + noRecentSearches: "No hay búsquedas recientes", +}; diff --git a/front/views/ScoreView.tsx b/front/views/ScoreView.tsx index 88921ab..9c66aa3 100644 --- a/front/views/ScoreView.tsx +++ b/front/views/ScoreView.tsx @@ -22,18 +22,22 @@ import { LoadingView } from "../components/Loading"; type ScoreViewProps = { songId: number; overallScore: number; + precision: number; score: { missed: number; good: number; great: number; perfect: number; - maxScore: number; + max_score: number; + current_streak: number; + max_streak: number; }; }; const ScoreView = ({ songId, overallScore, + precision, score, }: RouteProps) => { const navigation = useNavigation(); @@ -104,6 +108,50 @@ const ScoreView = ({ {overallScore + "pts"} + + t + " : "} /> + + {score.perfect} + + + + t + " : "} /> + + {score.great} + + + + t + " : "} /> + + {score.good} + + + + t + " : "} /> + + {score.wrong} + + + + + t + " : "} /> + + {score.missed} + + + + t + " : "} /> + + {score.max_streak} + + + + t + " : "} /> + + {precision + "%"} + + + diff --git a/scorometer/main.py b/scorometer/main.py index 812cf8e..dc434b2 100755 --- a/scorometer/main.py +++ b/scorometer/main.py @@ -46,6 +46,8 @@ class ScoroInfo(TypedDict): perfect: int great: int good: int + current_streak: int + max_streak: int def send(o): @@ -71,6 +73,8 @@ class Scorometer: "perfect": 0, "great": 0, "good": 0, + "current_streak": 0, + "max_streak": 0, } def send(self, obj): @@ -90,6 +94,10 @@ class Scorometer: else [] ) + def incrementStreak(self): + self.info["current_streak"] += 1 + self.info["max_streak"] = max(self.info["max_streak"], self.info["current_streak"]) + def handleNoteOn(self, message: NoteOnMessage): is_down = any(x[0] == message.note for x in self.keys_down) logging.debug({"note_on": message.note}) @@ -108,11 +116,21 @@ class Scorometer: if to_play: perf = self.getTimingScore(key, to_play) self.info[perf] += 1 + self.info["score"] += ( + 100 + if perf == "perfect" + else 75 + if perf == "great" + else 50 + ) + to_play.done = True + self.incrementStreak() logging.debug({"note_on": f"{perf} on {message.note}"}) self.send({"type": "timing", "id": message.id, "timing": perf}) else: - self.info["score"] -= 50 - self.info["missed"] += 1 + self.info["score"] -= 25 + self.info["wrong"] += 1 + self.info["current_streak"] = 0 self.wrong_ids += [message.id] logging.debug({"note_on": f"wrong key {message.note}"}) self.send({"type": "timing", "id": message.id, "timing": "wrong"}) @@ -140,15 +158,8 @@ class Scorometer: ) if to_play: perf = self.getDurationScore(key, to_play) - self.info["score"] += ( - 100 - if perf == "perfect" - else 75 - if perf == "short" or perf == "long" - else 50 - ) + logging.debug({"note_off": f"{perf} on {message.note}"}) - to_play.done = True self.send({"type": "duration", "id": message.id, "duration": perf}) else: logging.warning("note_off: no key to play but it was not a wrong note_on") @@ -173,10 +184,12 @@ class Scorometer: if to_play: perf = "practice" logging.debug({"note_on": f"{perf} on {message.note}"}) + self.incrementStreak() self.send({"type": "timing", "id": message.id, "timing": perf}) else: self.wrong_ids += [message.id] logging.debug({"note_on": f"wrong key {message.note}"}) + self.info["current_streak"] = 0 self.send({"type": "timing", "id": message.id, "timing": "wrong"}) def handleNoteOffPractice(self, message: NoteOffMessage): @@ -279,19 +292,14 @@ class Scorometer: def endGame(self): for i in self.partition.notes: if i.done is False: - self.info["score"] -= 50 + self.info["score"] -= 25 self.info["missed"] += 1 send( { "type": "end", "overallScore": self.info["score"], - "score": { - "missed": self.info["missed"], - "good": self.info["good"], - "great": self.info["great"], - "perfect": self.info["perfect"], - "maxScore": len(self.partition.notes) * 100, - }, + "precision": round(((self.info["perfect"] + self.info["great"] + self.info["good"]) / len(self.partition.notes) * 100), 2), + "score": self.info, } ) if self.user_id != -1: