feat: Rename the card to advanced-camera-card (#1873)
Whilst the Frigate support in this card is the best among camera engines, the name incorrectly suggests that Frigate is a requirement. Instead, to broaden the appeal, change to more camera agnostic name. This does not suggest any change in priority, role or support for Frigate. This change is likely to be bug prone, due to the size of the rename -- the code contains 1500+ references to "Frigate" most of which make sense to rename, some which do not, all of which needed human assessment. - Closes #1298 BREAKING CHANGE: References to `frigate-card` in all kinds of configuration need to be updated to `advanced-camera-card`. An automated config upgrade should take care of the majority of usecases (click `Edit -> Upgrade -> Save`), though may not be perfect.
This commit is contained in:
@@ -14,7 +14,7 @@ const languages: Record<string, any> = {
|
||||
// The language is calculated and stored once, then re-used to avoid needing to
|
||||
// repeat the lookups and to ensure minimal information needs to be plumbed
|
||||
// through on each localization call.
|
||||
let frigateCardLanguage: string | undefined;
|
||||
let advancedCameraCardLanguage: string | undefined;
|
||||
|
||||
/**
|
||||
* Get the configured language.
|
||||
@@ -67,7 +67,7 @@ export const loadLanguages = async (hass: HomeAssistant): Promise<boolean> => {
|
||||
}
|
||||
|
||||
if (lang) {
|
||||
frigateCardLanguage = lang;
|
||||
advancedCameraCardLanguage = lang;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@@ -85,7 +85,7 @@ export function localize(string: string, search = '', replace = ''): string {
|
||||
try {
|
||||
translated = string
|
||||
.split('.')
|
||||
.reduce((o, i) => o[i], languages[frigateCardLanguage ?? DEFAULT_LANG]);
|
||||
.reduce((o, i) => o[i], languages[advancedCameraCardLanguage ?? DEFAULT_LANG]);
|
||||
} catch (_) {}
|
||||
|
||||
if (!translated) {
|
||||
|
||||
Reference in New Issue
Block a user