mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-23 23:29:41 +02:00
More localization (#358)
* Translate missing items on About page * Localize import summary dialog * Make site menu translation reactive * Localize import options * Include semi colon in string * Move API texts to frontend + better status codes * Provide feedback to user when no meal is planned * Fix API tests after latest rework * Add warning for API changes in changelog * Refactor API texts handling * Refactor API texts handling #2 * Better API feedback * Rearrange strings hierarchy * Add messages upon recipe updated * Fix 'recipe effected' typo * Remove snackbar usage in backend * Translate toolbox * Provide feedback for tags CRUD * Fix messed up merge * Translate sign-up form * Better feedback for sign-up CRUD * Refactor log-in API texts handling * No error message when user is not authenticated * Remove unimportant console log
This commit is contained in:
parent
861020ffe0
commit
1e5edc7434
72 changed files with 890 additions and 606 deletions
|
@ -1,5 +1,6 @@
|
|||
import { baseURL } from "./api-utils";
|
||||
import { apiReq } from "./api-utils";
|
||||
import i18n from '@/i18n.js';
|
||||
|
||||
const prefix = baseURL + "themes";
|
||||
|
||||
|
@ -23,21 +24,31 @@ export const themeAPI = {
|
|||
},
|
||||
|
||||
async create(postBody) {
|
||||
let response = await apiReq.post(settingsURLs.createTheme, postBody);
|
||||
return response.data;
|
||||
return await apiReq.post(
|
||||
settingsURLs.createTheme,
|
||||
postBody,
|
||||
function() { return i18n.t('settings.theme.error-creating-theme-see-log-file'); },
|
||||
function() { return i18n.t('settings.theme.theme-saved'); });
|
||||
},
|
||||
|
||||
async update(themeName, colors) {
|
||||
update(themeName, colors) {
|
||||
const body = {
|
||||
name: themeName,
|
||||
colors: colors,
|
||||
};
|
||||
let response = await apiReq.put(settingsURLs.updateTheme(themeName), body);
|
||||
return response.data;
|
||||
return apiReq.put(
|
||||
settingsURLs.updateTheme(themeName),
|
||||
body,
|
||||
function() { return i18n.t('settings.theme.error-updating-theme'); },
|
||||
function() { return i18n.t('settings.theme.theme-updated'); });
|
||||
},
|
||||
|
||||
async delete(themeName) {
|
||||
let response = await apiReq.delete(settingsURLs.deleteTheme(themeName));
|
||||
return response.data;
|
||||
delete(themeName) {
|
||||
return apiReq.delete(
|
||||
settingsURLs.deleteTheme(themeName),
|
||||
null,
|
||||
function() { return i18n.t('settings.theme.error-deleting-theme'); },
|
||||
function() { return i18n.t('settings.theme.theme-deleted'); }
|
||||
);
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue