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:
sephrat
2021-04-23 08:13:00 +02:00
committed by GitHub
parent 048d3d5469
commit 80f8806604
18 changed files with 65 additions and 125 deletions

View File

@@ -27,7 +27,7 @@
<div class="text-truncate">
<strong>{{ backup.name }}</strong>
</div>
<div class="text-truncate">{{ readableTime(backup.date) }}</div>
<div class="text-truncate">{{ $d(new Date(backup.date), "medium") }}</div>
</v-col>
</v-row>
</v-card-text>
@@ -40,7 +40,6 @@
<script>
import ImportDialog from "./ImportDialog";
import { api } from "@/api";
import utils from "@/utils";
export default {
props: {
backups: Array,
@@ -57,14 +56,10 @@ export default {
},
methods: {
openDialog(backup) {
this.selectedDate = this.readableTime(backup.date);
this.selectedDate = backup.date;
this.selectedName = backup.name;
this.$refs.import_dialog.open();
},
readableTime(timestamp) {
let date = new Date(timestamp);
return utils.getDateAsText(date);
},
async importBackup(data) {
this.$emit("loading");
let response = await api.backups.import(data.name, data);

View File

@@ -26,7 +26,7 @@
<div>
<strong>{{ backup.name }}</strong>
</div>
<div>{{ readableTime(backup.date) }}</div>
<div>{{ $d(new Date(backup.date), "medium") }}</div>
</v-col>
</v-row>
</v-card-text>
@@ -39,7 +39,6 @@
<script>
import ImportDialog from "./ImportDialog";
import { api } from "@/api";
import utils from "@/utils";
export default {
props: {
backups: Array,
@@ -56,14 +55,10 @@ export default {
},
methods: {
openDialog(backup) {
this.selectedDate = this.readableTime(backup.date);
this.selectedDate = backup.date;
this.selectedName = backup.name;
this.$refs.import_dialog.open();
},
readableTime(timestamp) {
let date = new Date(timestamp);
return utils.getDateAsText(date);
},
async importBackup(data) {
this.$emit("loading");
let response = await api.backups.import(data.name, data);

View File

@@ -19,7 +19,7 @@
</v-toolbar-items>
</v-toolbar>
<v-card-title> {{ name }} </v-card-title>
<v-card-subtitle class="mb-n3"> {{ date }} </v-card-subtitle>
<v-card-subtitle class="mb-n3"> {{ $d(new Date(date), "medium") }} </v-card-subtitle>
<v-divider></v-divider>
<v-card-text>
@@ -29,7 +29,7 @@
<v-checkbox
dense
label="Remove existing entries matching imported entries"
:label="$t('settings.remove-existing-entries-matching-imported-entries')"
v-model="forceImport"
></v-checkbox>
</v-card-text>

View File

@@ -32,7 +32,7 @@
<strong>{{ migration.name }}</strong>
</div>
<div class="text-truncate">
{{ readableTime(migration.date) }}
{{ $d(new Date(migration.date), "medium") }}
</div>
</v-col>
</v-row>
@@ -67,7 +67,6 @@
<script>
import TheUploadBtn from "@/components/UI/Buttons/TheUploadBtn";
import utils from "@/utils";
import { api } from "@/api";
import MigrationDialog from "./MigrationDialog";
export default {
@@ -98,10 +97,6 @@ export default {
// this.$emit("imported", response.successful, response.failed);
this.loading = false;
},
readableTime(timestamp) {
let date = new Date(timestamp);
return utils.getDateAsText(date);
},
},
};
</script>