refactor: i18n "View in LibreScore"

This commit is contained in:
Xmader 2021-01-02 02:44:43 -05:00
parent 60d842bac7
commit 8945a53896
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
5 changed files with 12 additions and 2 deletions

View File

@ -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()

View File

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

View File

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

View File

@ -17,6 +17,8 @@ export interface LOCALE {
'IND_PARTS_TOOLTIP' (): string;
'FULL_SCORE' (): string;
'VIEW_IN_LIBRESCORE' (): string;
}
const locales = (<L extends { [n: string]: LOCALE } /** type checking */> (l: L) => Object.freeze(l))({

View File

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