mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-18 21:35:27 -04:00
Console warnings for missing translations on development builds
This commit is contained in:
@@ -56,7 +56,7 @@ function Legend(props) {
|
|||||||
if (showCutoffUnmetIcon) {
|
if (showCutoffUnmetIcon) {
|
||||||
iconsToShow.push(
|
iconsToShow.push(
|
||||||
<LegendIconItem
|
<LegendIconItem
|
||||||
name={translate('Cutoff Not Met')}
|
name={translate('CutoffNotMet')}
|
||||||
icon={icons.EPISODE_FILE}
|
icon={icons.EPISODE_FILE}
|
||||||
kind={kinds.WARNING}
|
kind={kinds.WARNING}
|
||||||
fullColorEvents={fullColorEvents}
|
fullColorEvents={fullColorEvents}
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ export default function translate(
|
|||||||
key: string,
|
key: string,
|
||||||
tokens: Record<string, string | number | boolean> = {}
|
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;
|
const translation = translations[key] || key;
|
||||||
|
|
||||||
tokens.appName = 'Sonarr';
|
tokens.appName = 'Sonarr';
|
||||||
|
|||||||
Vendored
+1
@@ -7,5 +7,6 @@ interface Window {
|
|||||||
theme: string;
|
theme: string;
|
||||||
urlBase: string;
|
urlBase: string;
|
||||||
version: string;
|
version: string;
|
||||||
|
isProduction: boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,6 +237,7 @@
|
|||||||
"CollectionsLoadError": "Unable to load collections",
|
"CollectionsLoadError": "Unable to load collections",
|
||||||
"ColonReplacement": "Colon Replacement",
|
"ColonReplacement": "Colon Replacement",
|
||||||
"ColonReplacementFormatHelpText": "Change how {appName} handles colon replacement",
|
"ColonReplacementFormatHelpText": "Change how {appName} handles colon replacement",
|
||||||
|
"Completed": "Completed",
|
||||||
"CompletedDownloadHandling": "Completed Download Handling",
|
"CompletedDownloadHandling": "Completed Download Handling",
|
||||||
"Component": "Component",
|
"Component": "Component",
|
||||||
"Condition": "Condition",
|
"Condition": "Condition",
|
||||||
@@ -302,6 +303,7 @@
|
|||||||
"CustomFormatsSpecificationResolution": "Resolution",
|
"CustomFormatsSpecificationResolution": "Resolution",
|
||||||
"CustomFormatsSpecificationSource": "Source",
|
"CustomFormatsSpecificationSource": "Source",
|
||||||
"Cutoff": "Cutoff",
|
"Cutoff": "Cutoff",
|
||||||
|
"CutoffNotMet": "Cutoff Not Met",
|
||||||
"CutoffUnmet": "Cutoff Unmet",
|
"CutoffUnmet": "Cutoff Unmet",
|
||||||
"CutoffUnmetLoadError": "Error loading cutoff unmet items",
|
"CutoffUnmetLoadError": "Error loading cutoff unmet items",
|
||||||
"CutoffUnmetNoItems": "No cutoff unmet items",
|
"CutoffUnmetNoItems": "No cutoff unmet items",
|
||||||
@@ -542,8 +544,8 @@
|
|||||||
"DownloadClientStatusSingleClientHealthCheckMessage": "Download clients unavailable due to failures: {downloadClientNames}",
|
"DownloadClientStatusSingleClientHealthCheckMessage": "Download clients unavailable due to failures: {downloadClientNames}",
|
||||||
"DownloadClientTransmissionSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Transmission location",
|
"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}'",
|
"DownloadClientTransmissionSettingsUrlBaseHelpText": "Adds a prefix to the {clientName} rpc url, eg {url}, defaults to '{defaultUrl}'",
|
||||||
"DownloadClientUnavailable": "Download Client Unavailable",
|
|
||||||
"DownloadClientUTorrentTorrentStateError": "uTorrent is reporting an error",
|
"DownloadClientUTorrentTorrentStateError": "uTorrent is reporting an error",
|
||||||
|
"DownloadClientUnavailable": "Download Client Unavailable",
|
||||||
"DownloadClientValidationApiKeyIncorrect": "API Key Incorrect",
|
"DownloadClientValidationApiKeyIncorrect": "API Key Incorrect",
|
||||||
"DownloadClientValidationApiKeyRequired": "API Key Required",
|
"DownloadClientValidationApiKeyRequired": "API Key Required",
|
||||||
"DownloadClientValidationAuthenticationFailure": "Authentication Failure",
|
"DownloadClientValidationAuthenticationFailure": "Authentication Failure",
|
||||||
@@ -1155,6 +1157,7 @@
|
|||||||
"MediaManagementSettingsSummary": "Naming, file management settings and root folders",
|
"MediaManagementSettingsSummary": "Naming, file management settings and root folders",
|
||||||
"Medium": "Medium",
|
"Medium": "Medium",
|
||||||
"MegabytesPerMinute": "Megabytes Per Minute",
|
"MegabytesPerMinute": "Megabytes Per Minute",
|
||||||
|
"Menu": "Menu",
|
||||||
"Message": "Message",
|
"Message": "Message",
|
||||||
"Metadata": "Metadata",
|
"Metadata": "Metadata",
|
||||||
"MetadataLoadError": "Unable to load Metadata",
|
"MetadataLoadError": "Unable to load Metadata",
|
||||||
@@ -1575,6 +1578,7 @@
|
|||||||
"PreferredProtocol": "Preferred Protocol",
|
"PreferredProtocol": "Preferred Protocol",
|
||||||
"PreferredSize": "Preferred Size",
|
"PreferredSize": "Preferred Size",
|
||||||
"PrefixedRange": "Prefixed Range",
|
"PrefixedRange": "Prefixed Range",
|
||||||
|
"Premiere": "Premiere",
|
||||||
"Presets": "Presets",
|
"Presets": "Presets",
|
||||||
"PreviewRename": "Preview Rename",
|
"PreviewRename": "Preview Rename",
|
||||||
"PreviewRenameSeason": "Preview Rename for this season",
|
"PreviewRenameSeason": "Preview Rename for this season",
|
||||||
|
|||||||
Reference in New Issue
Block a user