From 8945a538968b30a131b524b665c41a68da9d620f Mon Sep 17 00:00:00 2001 From: Xmader Date: Sat, 2 Jan 2021 02:44:43 -0500 Subject: [PATCH] refactor: i18n "View in LibreScore" --- src/cli.ts | 2 +- src/i18n/en.ts | 4 ++++ src/i18n/es.ts | 4 ++++ src/i18n/index.ts | 2 ++ src/main.ts | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 4dd5d78..420d0a5 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -114,7 +114,7 @@ void (async () => { } if (librescoreLink) { try { - spinner.info(`View in LibreScore: ${await librescoreLink}`) + spinner.info(`${i18n('VIEW_IN_LIBRESCORE')()}: ${await librescoreLink}`) } catch { } // it doesn't affect the main feature } spinner.start() diff --git a/src/i18n/en.ts b/src/i18n/en.ts index c06d7cc..d92e261 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -27,6 +27,10 @@ export default createLocale({ return 'Download individual parts (BETA)' as const }, + 'VIEW_IN_LIBRESCORE' () { + return 'View in LibreScore' as const + }, + 'FULL_SCORE' () { return 'Full score' as const }, diff --git a/src/i18n/es.ts b/src/i18n/es.ts index 744d97c..89c10e9 100644 --- a/src/i18n/es.ts +++ b/src/i18n/es.ts @@ -27,6 +27,10 @@ export default createLocale({ return 'Descargar partes individuales (BETA)' as const }, + 'VIEW_IN_LIBRESCORE' () { + return 'Ver en LibreScore' as const + }, + 'FULL_SCORE' () { return 'Partitura Completa' as const }, diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 0e62670..fab7958 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -17,6 +17,8 @@ export interface LOCALE { 'IND_PARTS_TOOLTIP' (): string; 'FULL_SCORE' (): string; + + 'VIEW_IN_LIBRESCORE' (): string; } const locales = ( (l: L) => Object.freeze(l))({ diff --git a/src/main.ts b/src/main.ts index f1643ee..6f7ec77 100644 --- a/src/main.ts +++ b/src/main.ts @@ -133,7 +133,7 @@ const main = (): void => { }) btnList.add({ - name: 'View in LibreScore', + name: i18n('VIEW_IN_LIBRESCORE')(), action: BtnAction.openUrl(() => getLibreScoreLink(scoreinfo)), tooltip: 'BETA', icon: ICON.LIBRESCORE,