mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-27 17:19:40 +02:00
Localize more dates and texts (#341)
* Localize more dates and texts * Adapt source language to 4-letter code for VS code * Make page titles more reactive to language change * Translate missing text + fix missed refactoring * Fix missed page titles refactoring * Translate nutrition view * Translate Image upload vue * Fix default text being defined twice in upload btn
This commit is contained in:
parent
048d3d5469
commit
80f8806604
18 changed files with 65 additions and 125 deletions
|
@ -9,45 +9,6 @@ const notifyHelpers = {
|
|||
info: "notify-info-color",
|
||||
};
|
||||
|
||||
const days = [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday",
|
||||
];
|
||||
const months = [
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December",
|
||||
];
|
||||
|
||||
const monthsShort = [
|
||||
"Jan",
|
||||
"Feb",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"Aug",
|
||||
"Sept",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec",
|
||||
];
|
||||
|
||||
export default {
|
||||
getImageURL(image) {
|
||||
return `/api/recipes/${image}/image?image_type=small`;
|
||||
|
@ -56,22 +17,6 @@ export default {
|
|||
const uniqueKey = `${item}-${index}`;
|
||||
return uniqueKey;
|
||||
},
|
||||
getDateAsText(dateObject) {
|
||||
const dow = days[dateObject.getUTCDay()];
|
||||
const month = months[dateObject.getUTCMonth()];
|
||||
const day = dateObject.getUTCDate();
|
||||
// const year = dateObject.getFullYear();
|
||||
|
||||
return `${dow}, ${month} ${day}`;
|
||||
},
|
||||
getDateAsTextAlt(dateObject) {
|
||||
const dow = days[dateObject.getUTCDay()];
|
||||
const month = monthsShort[dateObject.getUTCMonth()];
|
||||
const day = dateObject.getUTCDate();
|
||||
// const year = dateObject.getFullYear();
|
||||
|
||||
return `${dow}, ${month} ${day}`;
|
||||
},
|
||||
getDateAsPythonDate(dateObject) {
|
||||
const month = dateObject.getUTCMonth() + 1;
|
||||
const day = dateObject.getUTCDate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue