mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
Since we are using the react-i18n babel loader plugin, useI18n can only be used once per file. Also we have to remember to add the istanbul ignore next comment each time we use it. By moving this to a common file, it can be easily copied and pasted when a new submodule is created and we don't have to remember the rules when calling it.
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2021-2022 The Pybricks Authors
|
|
//
|
|
// Settings translation keys.
|
|
|
|
import { I18n, useI18n as useShopifyI18n } from '@shopify/react-i18n';
|
|
|
|
export function useI18n(): I18n {
|
|
// istanbul ignore next: babel-loader rewrites this line
|
|
const [i18n] = useShopifyI18n();
|
|
return i18n;
|
|
}
|
|
|
|
export enum I18nId {
|
|
Title = 'title',
|
|
AppearanceTitle = 'appearance.title',
|
|
AppearanceDocumentationLabel = 'appearance.documentation.label',
|
|
AppearanceDocumentationHelp = 'appearance.documentation.help',
|
|
AppearanceDarkModeLabel = 'appearance.darkMode.label',
|
|
AppearanceDarkModeHelp = 'appearance.darkMode.help',
|
|
AppearanceZoomHelp = 'appearance.zoom.help',
|
|
FirmwareTitle = 'firmware.title',
|
|
FirmwareCurrentProgramLabel = 'firmware.flashCurrentProgram.label',
|
|
FirmwareCurrentProgramHelp = 'firmware.flashCurrentProgram.help',
|
|
FirmwareHubNameLabel = 'firmware.hubName.label',
|
|
FirmwareHubNameHelp = 'firmware.hubName.help',
|
|
FirmwareHubNameError = 'firmware.hubName.error',
|
|
HelpTitle = 'help.title',
|
|
HelpProjectsLabel = 'help.projects.label',
|
|
HelpSupportLabel = 'help.support.label',
|
|
HelpChatLabel = 'help.chat.label',
|
|
HelpBugsLabel = 'help.bugs.label',
|
|
AppTitle = 'app.title',
|
|
AppOfflineUseHelp = 'app.offlineUseHelp',
|
|
AppInstallLabel = 'app.install.label',
|
|
AppCheckForUpdateLabel = 'app.checkForUpdate.label',
|
|
AppRestartLabel = 'app.restart.label',
|
|
AppAboutLabel = 'app.about.label',
|
|
}
|