feat(translations): add 7.0 support for most settings and some of marketplace

This commit is contained in:
David Ralph
2022-06-03 21:52:37 +01:00
parent 109918a2c6
commit 80723cbed1
36 changed files with 696 additions and 126 deletions

View File

@@ -1,12 +1,7 @@
import variables from 'modules/variables';
import { PureComponent } from 'react';
import { MenuItem } from '@mui/material';
import {
MdSource,
MdOutlineKeyboardArrowRight,
MdOutlineAutoAwesome,
MdArrowBack,
} from 'react-icons/md';
import { MdSource, MdOutlineKeyboardArrowRight, MdOutlineAutoAwesome } from 'react-icons/md';
import Header from '../../Header';
import Checkbox from '../../Checkbox';
@@ -14,7 +9,6 @@ import Dropdown from '../../Dropdown';
import Slider from '../../Slider';
import Radio from '../../Radio';
import SettingsItem from '../../SettingsItem';
import Tooltip from '../../../../../helpers/tooltip/Tooltip';
import ColourSettings from './Colour';
import CustomSettings from './Custom';

View File

@@ -131,6 +131,7 @@ export default class CustomSettings extends PureComponent {
e.preventDefault();
};
// todo: make this get from FileUpload.jsx to prevent duplication
dnd.ondrop = (e) => {
e.preventDefault();
const file = e.dataTransfer.files[0];
@@ -143,7 +144,7 @@ export default class CustomSettings extends PureComponent {
const settingsSize = new TextEncoder().encode(JSON.stringify(settings)).length;
if (videoCheck(file) === true) {
if (settingsSize + file.size > 4850000) {
return toast('Not enough storage!');
return toast(this.getMessage('toasts.no_storage'));
}
return this.customBackground(file, false, this.state.currentBackgroundIndex);
@@ -151,7 +152,7 @@ export default class CustomSettings extends PureComponent {
compressAccurately(file, 200).then(async (res) => {
if (settingsSize + res.size > 4850000) {
return toast('Not enough storage!');
return toast(this.getMessage('toasts.no_storage'));
}
this.customBackground(await filetoDataURL(res), false, this.state.currentBackgroundIndex);

View File

@@ -1,7 +1,6 @@
import variables from 'modules/variables';
import { useState } from 'react';
import { MdAdd, MdClose } from 'react-icons/md';
import { TextField } from '@mui/material';
import Tooltip from '../../../../../helpers/tooltip/Tooltip';
export default function CustomURLModal({ modalClose, modalCloseOnly }) {
@@ -16,7 +15,12 @@ export default function CustomURLModal({ modalClose, modalCloseOnly }) {
'modals.main.settings.sections.background.source.add_url',
)}
</span>
<Tooltip title="Close">
<Tooltip
title={variables.language.getMessage(
variables.languagecode,
'modals.main.settings.sections.advanced.reset_modal.cancel',
)}
>
<div className="close" onClick={modalCloseOnly}>
<MdClose />
</div>
@@ -29,7 +33,13 @@ export default function CustomURLModal({ modalClose, modalCloseOnly }) {
onChange={(e) => setURL(e.target.value)}
varient="outlined"
/>
<Tooltip title="Add Link" placement="top">
<Tooltip
title={variables.language.getMessage(
variables.languagecode,
'modals.main.settings.sections.background.source.add_url',
)}
placement="top"
>
<button onClick={() => modalClose(url)}>
<MdAdd />
</button>