mirror of
https://github.com/Sonarr/Sonarr
synced 2025-03-11 06:33:32 +00:00
Console warnings for missing translations on development builds
This commit is contained in:
parent
5bc943583c
commit
67a1ecb0fe
4 changed files with 13 additions and 2 deletions
|
@ -56,7 +56,7 @@ function Legend(props) {
|
|||
if (showCutoffUnmetIcon) {
|
||||
iconsToShow.push(
|
||||
<LegendIconItem
|
||||
name={translate('Cutoff Not Met')}
|
||||
name={translate('CutoffNotMet')}
|
||||
icon={icons.EPISODE_FILE}
|
||||
kind={kinds.WARNING}
|
||||
fullColorEvents={fullColorEvents}
|
||||
|
|
|
@ -27,6 +27,12 @@ export default function translate(
|
|||
key: string,
|
||||
tokens: Record<string, string | number | boolean> = {}
|
||||
) {
|
||||
const { isProduction = true } = window.Sonarr;
|
||||
|
||||
if (!isProduction && !(key in translations)) {
|
||||
console.warn(`Missing translation for key: ${key}`);
|
||||
}
|
||||
|
||||
const translation = translations[key] || key;
|
||||
|
||||
tokens.appName = 'Sonarr';
|
||||
|
|
1
frontend/typings/Globals.d.ts
vendored
1
frontend/typings/Globals.d.ts
vendored
|
@ -7,5 +7,6 @@ interface Window {
|
|||
theme: string;
|
||||
urlBase: string;
|
||||
version: string;
|
||||
isProduction: boolean;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -237,6 +237,7 @@
|
|||
"CollectionsLoadError": "Unable to load collections",
|
||||
"ColonReplacement": "Colon Replacement",
|
||||
"ColonReplacementFormatHelpText": "Change how {appName} handles colon replacement",
|
||||
"Completed": "Completed",
|
||||
"CompletedDownloadHandling": "Completed Download Handling",
|
||||
"Component": "Component",
|
||||
"Condition": "Condition",
|
||||
|
@ -302,6 +303,7 @@
|
|||
"CustomFormatsSpecificationResolution": "Resolution",
|
||||
"CustomFormatsSpecificationSource": "Source",
|
||||
"Cutoff": "Cutoff",
|
||||
"CutoffNotMet": "Cutoff Not Met",
|
||||
"CutoffUnmet": "Cutoff Unmet",
|
||||
"CutoffUnmetLoadError": "Error loading cutoff unmet items",
|
||||
"CutoffUnmetNoItems": "No cutoff unmet items",
|
||||
|
@ -542,8 +544,8 @@
|
|||
"DownloadClientStatusSingleClientHealthCheckMessage": "Download clients unavailable due to failures: {downloadClientNames}",
|
||||
"DownloadClientTransmissionSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Transmission location",
|
||||
"DownloadClientTransmissionSettingsUrlBaseHelpText": "Adds a prefix to the {clientName} rpc url, eg {url}, defaults to '{defaultUrl}'",
|
||||
"DownloadClientUnavailable": "Download Client Unavailable",
|
||||
"DownloadClientUTorrentTorrentStateError": "uTorrent is reporting an error",
|
||||
"DownloadClientUnavailable": "Download Client Unavailable",
|
||||
"DownloadClientValidationApiKeyIncorrect": "API Key Incorrect",
|
||||
"DownloadClientValidationApiKeyRequired": "API Key Required",
|
||||
"DownloadClientValidationAuthenticationFailure": "Authentication Failure",
|
||||
|
@ -1155,6 +1157,7 @@
|
|||
"MediaManagementSettingsSummary": "Naming, file management settings and root folders",
|
||||
"Medium": "Medium",
|
||||
"MegabytesPerMinute": "Megabytes Per Minute",
|
||||
"Menu": "Menu",
|
||||
"Message": "Message",
|
||||
"Metadata": "Metadata",
|
||||
"MetadataLoadError": "Unable to load Metadata",
|
||||
|
@ -1575,6 +1578,7 @@
|
|||
"PreferredProtocol": "Preferred Protocol",
|
||||
"PreferredSize": "Preferred Size",
|
||||
"PrefixedRange": "Prefixed Range",
|
||||
"Premiere": "Premiere",
|
||||
"Presets": "Presets",
|
||||
"PreviewRename": "Preview Rename",
|
||||
"PreviewRenameSeason": "Preview Rename for this season",
|
||||
|
|
Loading…
Add table
Reference in a new issue