From 7df77d33e420db5879fdb45ffc8a9c4567d031c3 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sun, 5 Jun 2022 15:43:49 +0100 Subject: [PATCH] fix: background upload, finish 7.0 translation support --- .../main/marketplace/sections/Create.jsx | 24 +++++++++++------- .../modals/main/settings/FileUpload.jsx | 4 +-- .../sections/background/Background.jsx | 25 ++++++++++++------- .../settings/sections/background/Custom.jsx | 6 ++--- src/translations/de_DE.json | 22 ++++++++++++++++ src/translations/en_GB.json | 22 ++++++++++++++++ src/translations/en_US.json | 22 ++++++++++++++++ src/translations/es.json | 22 ++++++++++++++++ src/translations/fr.json | 22 ++++++++++++++++ src/translations/id_ID.json | 22 ++++++++++++++++ src/translations/nl.json | 22 ++++++++++++++++ src/translations/no.json | 22 ++++++++++++++++ src/translations/ru.json | 22 ++++++++++++++++ src/translations/zh_CN.json | 22 ++++++++++++++++ 14 files changed, 256 insertions(+), 23 deletions(-) diff --git a/src/components/modals/main/marketplace/sections/Create.jsx b/src/components/modals/main/marketplace/sections/Create.jsx index a42f29b5..996ebccf 100644 --- a/src/components/modals/main/marketplace/sections/Create.jsx +++ b/src/components/modals/main/marketplace/sections/Create.jsx @@ -207,12 +207,18 @@ export default class Create extends PureComponent {
- Create {this.state.addonMetadata.type} Pack + {getMessage('modals.main.addons.create.metadata.create_type', { + type: this.state.addonMetadata.type, + })} + + + {getMessage( + 'modals.main.addons.create.metadata.descriptions.' + this.addonMetadata.type, + ) || 'marketplace'} - Description of what is being made
@@ -229,8 +235,8 @@ export default class Create extends PureComponent { {getMessage('modals.main.marketplace.product.version')} @@ -379,7 +385,7 @@ export default class Create extends PureComponent {
@@ -411,14 +417,14 @@ export default class Create extends PureComponent {
- Next step, Publishing... + {getMessage('modals.main.addons.create.publishing.title')} - Visit the Mue Knowledgebase on information on how to publish your newly created addon. + {getMessage('modals.main.addons.create.publishing.subtitle')}
diff --git a/src/components/modals/main/settings/FileUpload.jsx b/src/components/modals/main/settings/FileUpload.jsx index b2faa532..69231734 100644 --- a/src/components/modals/main/settings/FileUpload.jsx +++ b/src/components/modals/main/settings/FileUpload.jsx @@ -23,7 +23,7 @@ export default class FileUpload extends PureComponent { }); const settingsSize = new TextEncoder().encode(JSON.stringify(settings)).length; - if (videoCheck(file) === true) { + if (videoCheck(file.type) === true) { if (settingsSize + file.size > 4850000) { return toast(this.getMessage('toasts.no_storage')); } @@ -32,7 +32,7 @@ export default class FileUpload extends PureComponent { } // todo: change number - compressAccurately(file, 200).then(async (res) => { + compressAccurately(file, 300).then(async (res) => { if (settingsSize + res.size > 4850000) { return toast(this.getMessage('toasts.no_storage')); } diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index 940ea56a..4807b2fe 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -67,7 +67,10 @@ export default class BackgroundSettings extends PureComponent { const { getMessage } = this; const interval = ( - + {this.state.backgroundCategories[0] === getMessage('modals.main.loading') ? ( <> @@ -244,7 +247,9 @@ export default class BackgroundSettings extends PureComponent { {getMessage('modals.main.settings.sections.background.source.title')} - Select where to get background images from + + {getMessage('modals.main.settings.sections.background.source.subtitle')} +
@@ -284,7 +289,9 @@ export default class BackgroundSettings extends PureComponent { {getMessage('modals.main.settings.sections.background.effects.title')} - Add effects to the background image + + {getMessage('modals.main.settings.sections.background.effects.subtitle')} +
@@ -296,8 +303,8 @@ export default class BackgroundSettings extends PureComponent { ) : null} {this.state.backgroundSettingsSection !== true && this.state.effects !== true ? ( 4850000) { return toast(this.getMessage('toasts.no_storage')); } @@ -150,7 +150,7 @@ export default class CustomSettings extends PureComponent { return this.customBackground(file, false, this.state.currentBackgroundIndex); } - compressAccurately(file, 200).then(async (res) => { + compressAccurately(file, 300).then(async (res) => { if (settingsSize + res.size > 4850000) { return toast(this.getMessage('toasts.no_storage')); } @@ -165,7 +165,7 @@ export default class CustomSettings extends PureComponent { return ( <> {this.props.interval} -
+
{this.state.customBackground.map((url, index) => ( diff --git a/src/translations/de_DE.json b/src/translations/de_DE.json index 3b4c762a..94a59257 100644 --- a/src/translations/de_DE.json +++ b/src/translations/de_DE.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Effekte", + "subtitle": "Add effects to the background images", "blur": "Unschärfe anpassen", "brightness": "Helligkeit anpassen", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Quelle", + "subtitle": "Select where to get background images from", "api": "Hintergrund API", "custom_background": "Benutzerdefinierter Hintergrund", "custom_colour": "Benutzerdefinierter Hintergrundfarbe", @@ -223,8 +225,13 @@ "datasaver": "Datensparer" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Ändern Sie alle", + "subtitle": "Change how often the background is updated", "minute": "Minute", "half_hour": "Halbe Stunde", "hour": "Stunde", @@ -517,7 +524,22 @@ }, "create": { "title": "Erstellen", + "example": "Example", "other_title": "Add-on erstellen", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Name", "icon_url": "Icon URL", diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index bcfa0795..4681d7be 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Effects", + "subtitle": "Add effects to the background images", "blur": "Adjust blur", "brightness": "Adjust brightness", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Source", + "subtitle": "Select where to get background images from", "api": "Background API", "custom_background": "Custom background", "custom_colour": "Custom background colour", @@ -223,8 +225,13 @@ "datasaver": "Data Saver" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Change every", + "subtitle": "Change how often the background is updated", "minute": "Minute", "half_hour": "Half hour", "hour": "Hour", @@ -516,7 +523,22 @@ }, "create": { "title": "Create", + "example": "Example", "other_title": "Create Add-on", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Name", "icon_url": "Icon URL", diff --git a/src/translations/en_US.json b/src/translations/en_US.json index c457df2a..faadf1a8 100644 --- a/src/translations/en_US.json +++ b/src/translations/en_US.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Effects", + "subtitle": "Add effects to the background images", "blur": "Adjust blur", "brightness": "Adjust brightness", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Source", + "subtitle": "Select where to get background images from", "api": "Background API", "custom_background": "Custom background", "custom_colour": "Custom background color", @@ -223,8 +225,13 @@ "datasaver": "Data Saver" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Change every", + "subtitle": "Change how often the background is updated", "minute": "Minute", "half_hour": "Half hour", "hour": "Hour", @@ -516,7 +523,22 @@ }, "create": { "title": "Create", + "example": "Example", "other_title": "Create Add-on", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Name", "icon_url": "Icon URL", diff --git a/src/translations/es.json b/src/translations/es.json index d062c27a..d4b2926c 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Efectos", + "subtitle": "Add effects to the background images", "blur": "Ajustar difuminado", "brightness": "Ajustar brillo", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Fuente", + "subtitle": "Select where to get background images from", "api": "API de fondos", "custom_background": "Fondo personalizado", "custom_colour": "Color del fondo personalizado", @@ -223,8 +225,13 @@ "datasaver": "Ahorro de datos" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Cambiar cada", + "subtitle": "Change how often the background is updated", "minute": "Minuto", "half_hour": "Media hora", "hour": "Hora", @@ -516,7 +523,22 @@ }, "create": { "title": "Crear", + "example": "Example", "other_title": "Crear complemento", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Nombre", "icon_url": "URL del icono", diff --git a/src/translations/fr.json b/src/translations/fr.json index 224f8eca..11a46972 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Effets", + "subtitle": "Add effects to the background images", "blur": "Ajuster le flou", "brightness": "Ajuster la luminosité", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Source", + "subtitle": "Select where to get background images from", "api": "Source", "custom_background": "Arrière-plan personnalisé", "custom_colour": "Couleur d'arrière-plan personnalisée", @@ -223,8 +225,13 @@ "datasaver": "Data Saver" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Change every", + "subtitle": "Change how often the background is updated", "minute": "Minute", "half_hour": "Half hour", "hour": "Hour", @@ -516,7 +523,22 @@ }, "create": { "title": "Create", + "example": "Example", "other_title": "Create Add-on", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Name", "icon_url": "Icon URL", diff --git a/src/translations/id_ID.json b/src/translations/id_ID.json index 8b6e2dc2..73ac41d3 100644 --- a/src/translations/id_ID.json +++ b/src/translations/id_ID.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Efek", + "subtitle": "Add effects to the background images", "blur": "Sesuaikan blur", "brightness": "Sesuaikan kecerahan", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Sumber", + "subtitle": "Select where to get background images from", "api": "Background API", "custom_background": "Background kustom", "custom_colour": "Background warna kustom", @@ -223,8 +225,13 @@ "datasaver": "Data Saver" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Ubah setiap", + "subtitle": "Change how often the background is updated", "minute": "Menit", "half_hour": "Setengah jam", "hour": "Jam", @@ -516,7 +523,22 @@ }, "create": { "title": "Buat", + "example": "Example", "other_title": "Buat Add-on", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Nama", "icon_url": "URL Ikon", diff --git a/src/translations/nl.json b/src/translations/nl.json index c7b71712..bec0a932 100644 --- a/src/translations/nl.json +++ b/src/translations/nl.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Effects", + "subtitle": "Add effects to the background images", "blur": "Vervaging instellen", "brightness": "Adjust brightness", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Source", + "subtitle": "Select where to get background images from", "api": "Achtergrond-api", "custom_background": "Aangepaste achtergrond", "custom_colour": "Aangepaste achtergrondkleur", @@ -223,8 +225,13 @@ "datasaver": "Data Saver" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Change every", + "subtitle": "Change how often the background is updated", "minute": "Minute", "half_hour": "Half hour", "hour": "Hour", @@ -516,7 +523,22 @@ }, "create": { "title": "Create", + "example": "Example", "other_title": "Create Add-on", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Name", "icon_url": "Icon URL", diff --git a/src/translations/no.json b/src/translations/no.json index 2dc758d9..9d9d22eb 100644 --- a/src/translations/no.json +++ b/src/translations/no.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Effects", + "subtitle": "Add effects to the background images", "blur": "Juster Blur", "brightness": "Adjust brightness", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Source", + "subtitle": "Select where to get background images from", "api": "Bakgrunn API", "custom_background": "Personlig bakgrunn", "custom_colour": "Personlig Bakgrunn Farge", @@ -223,8 +225,13 @@ "datasaver": "Data Saver" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Change every", + "subtitle": "Change how often the background is updated", "minute": "Minute", "half_hour": "Half hour", "hour": "Hour", @@ -516,7 +523,22 @@ }, "create": { "title": "Create", + "example": "Example", "other_title": "Create Add-on", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Name", "icon_url": "Icon URL", diff --git a/src/translations/ru.json b/src/translations/ru.json index 45d330a4..b57442ae 100644 --- a/src/translations/ru.json +++ b/src/translations/ru.json @@ -180,6 +180,7 @@ }, "effects": { "title": "Effects", + "subtitle": "Add effects to the background images", "blur": "Размытие", "brightness": "Яркость", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "Source", + "subtitle": "Select where to get background images from", "api": "API для фона", "custom_background": "Пользовательский фон", "custom_colour": "Пользовательский цвет фон", @@ -223,8 +225,13 @@ "datasaver": "Data Saver" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "Change every", + "subtitle": "Change how often the background is updated", "minute": "Minute", "half_hour": "Half hour", "hour": "Hour", @@ -516,7 +523,22 @@ }, "create": { "title": "Create", + "example": "Example", "other_title": "Create Add-on", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "Name", "icon_url": "Icon URL", diff --git a/src/translations/zh_CN.json b/src/translations/zh_CN.json index a0c44707..8e3b0d55 100644 --- a/src/translations/zh_CN.json +++ b/src/translations/zh_CN.json @@ -180,6 +180,7 @@ }, "effects": { "title": "背景特效", + "subtitle": "Add effects to the background images", "blur": "模糊程度", "brightness": "更改亮度", "filters": { @@ -202,6 +203,7 @@ }, "source": { "title": "来源", + "subtitle": "Select where to get background images from", "api": "背景来源", "custom_background": "自定义背景 (支持图片/视频)", "custom_colour": "自定义背景颜色", @@ -223,8 +225,13 @@ "datasaver": "省流模式" } }, + "display": "Display", + "display_subtitle": "Change how background and photo information are loaded", + "api": "API Settings", + "api_subtitle": "Options for getting an image from an external service (API)", "interval": { "title": "更改频率", + "subtitle": "Change how often the background is updated", "minute": "每分钟", "half_hour": "每半小时", "hour": "每小时", @@ -516,7 +523,22 @@ }, "create": { "title": "创建", + "example": "Example", "other_title": "创建插件", + "create_type": "Create {type} Pack", + "descriptions": { + "settings": "", + "photo_pack": "", + "quote_pack": "" + }, + "information": "Information", + "information_subtitle": "For example: 1.2.3 (major update, minor update, patch update)", + "import_custom": "Import from custom settings.", + "publishing": { + "title": "Next step, Publishing...", + "subtitle": "Visit the Mue Knowledgebase on information on how to publish your newly created addon.", + "button": "Learn more" + }, "metadata": { "name": "名称", "icon_url": "图标URL",