Console warnings for missing translations on development builds

(cherry picked from commit 67a1ecb0fea4e6c7dfdb68fbe3ef30d4c22398d8)

Closes #5239
pull/5316/head
Bogdan 1 month ago
parent afb3fd5bd5
commit ec93c33aa9

@ -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.Lidarr;
if (!isProduction && !(key in translations)) {
console.warn(`Missing translation for key: ${key}`);
}
const translation = translations[key] || key; const translation = translations[key] || key;
tokens.appName = 'Lidarr'; tokens.appName = 'Lidarr';

@ -7,5 +7,6 @@ interface Window {
theme: string; theme: string;
urlBase: string; urlBase: string;
version: string; version: string;
isProduction: boolean;
}; };
} }

@ -707,6 +707,7 @@
"MassSearchCancelWarning": "This cannot be cancelled once started without restarting {appName} or disabling all of your indexers.", "MassSearchCancelWarning": "This cannot be cancelled once started without restarting {appName} or disabling all of your indexers.",
"MatchedToAlbums": "Matched to Albums", "MatchedToAlbums": "Matched to Albums",
"MatchedToArtist": "Matched to Artist", "MatchedToArtist": "Matched to Artist",
"Max": "Max",
"MaximumLimits": "Maximum Limits", "MaximumLimits": "Maximum Limits",
"MaximumSize": "Maximum Size", "MaximumSize": "Maximum Size",
"MaximumSizeHelpText": "Maximum size for a release to be grabbed in MB. Set to zero to set to unlimited.", "MaximumSizeHelpText": "Maximum size for a release to be grabbed in MB. Set to zero to set to unlimited.",
@ -727,6 +728,7 @@
"MetadataProfiles": "Metadata Profiles", "MetadataProfiles": "Metadata Profiles",
"MetadataSettings": "Metadata Settings", "MetadataSettings": "Metadata Settings",
"MetadataSettingsArtistSummary": "Create metadata files when tracks are imported or artist are refreshed", "MetadataSettingsArtistSummary": "Create metadata files when tracks are imported or artist are refreshed",
"Min": "Min",
"MinFormatScoreHelpText": "Minimum custom format score allowed to download", "MinFormatScoreHelpText": "Minimum custom format score allowed to download",
"MinimumAge": "Minimum Age", "MinimumAge": "Minimum Age",
"MinimumAgeHelpText": "Usenet only: Minimum age in minutes of NZBs before they are grabbed. Use this to give new releases time to propagate to your usenet provider.", "MinimumAgeHelpText": "Usenet only: Minimum age in minutes of NZBs before they are grabbed. Use this to give new releases time to propagate to your usenet provider.",
@ -894,6 +896,7 @@
"PreferProtocol": "Prefer {preferredProtocol}", "PreferProtocol": "Prefer {preferredProtocol}",
"PreferTorrent": "Prefer Torrent", "PreferTorrent": "Prefer Torrent",
"PreferUsenet": "Prefer Usenet", "PreferUsenet": "Prefer Usenet",
"Preferred": "Preferred",
"PreferredProtocol": "Preferred Protocol", "PreferredProtocol": "Preferred Protocol",
"PreferredSize": "Preferred Size", "PreferredSize": "Preferred Size",
"Presets": "Presets", "Presets": "Presets",
@ -1208,6 +1211,7 @@
"TimeFormat": "Time Format", "TimeFormat": "Time Format",
"TimeLeft": "Time Left", "TimeLeft": "Time Left",
"Title": "Title", "Title": "Title",
"Today": "Today",
"Tomorrow": "Tomorrow", "Tomorrow": "Tomorrow",
"TorrentDelay": "Torrent Delay", "TorrentDelay": "Torrent Delay",
"TorrentDelayHelpText": "Delay in minutes to wait before grabbing a torrent", "TorrentDelayHelpText": "Delay in minutes to wait before grabbing a torrent",

Loading…
Cancel
Save