diff --git a/src/components/widgets/background/Background.jsx b/src/components/widgets/background/Background.jsx
index 8c75b313..e1b74ba5 100644
--- a/src/components/widgets/background/Background.jsx
+++ b/src/components/widgets/background/Background.jsx
@@ -1,5 +1,4 @@
// todo: rewrite this mess
-import variables from 'modules/variables';
import { PureComponent } from 'react';
import PhotoInformation from './PhotoInformation';
@@ -134,15 +133,10 @@ export default class Background extends PureComponent {
let credit = data.photographer;
let photoURL, photographerURL;
- const language = variables.language;
- const languagecode = variables.languagecode;
-
if (backgroundAPI === 'unsplash') {
- credit = data.photographer + ` ${language.getMessage(languagecode, 'background.unsplash')}`;
photoURL = data.photo_page;
photographerURL = data.photographer_page;
} else if (backgroundAPI === 'pexels') {
- credit = data.photographer + ` ${language.getMessage(languagecode, 'background.pexels')}`;
photoURL = data.photo_page;
photographerURL = data.photographer_page;
}
diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx
index d94e5d37..74ae0b69 100644
--- a/src/components/widgets/background/PhotoInformation.jsx
+++ b/src/components/widgets/background/PhotoInformation.jsx
@@ -36,17 +36,17 @@ export default function PhotoInformation({ info, url, api }) {
const pexels = variables.language.getMessage(variables.languagecode, 'widgets.background.pexels');
const photographer = info.credit.split(` ${unsplash}`)[0].split(` ${pexels}`);
- let credit;
- let photo;
+ let credit = info.credit;
+ let photo = variables.language.getMessage(variables.languagecode, 'widgets.background.credit');
// unsplash and pexels credit
if (info.photographerURL && info.photographerURL !== '' && !info.offline && api) {
if (api === 'unsplash') {
- photo = {variables.language.getMessage(variables.languagecode, 'widgets.background.credit')};
- credit = <>{photographer} {unsplash}>;
+ photo = {photo};
+ credit = <>{info.credit} {unsplash}>;
} else {
- photo = {variables.language.getMessage(variables.languagecode, 'widgets.background.credit')};
- credit = <>{photographer} {pexels}>;
+ photo = {photo};
+ credit = <>{info.credit} {pexels}>;
}
}
@@ -142,7 +142,7 @@ export default function PhotoInformation({ info, url, api }) {
{width}x{height}
- {info.credit}
+ {photographer}
{downloadEnabled ?
<>