Skip to content

Commit

Permalink
fixes translations, adds new translation
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Jan 28, 2025
1 parent deac738 commit 15bbd49
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 11 deletions.
9 changes: 8 additions & 1 deletion src/components/FoodSiteCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
import { getCurrentInstance } from 'vue';
const instance = getCurrentInstance();
const i18nLocale = computed(() => {
return instance.appContext.config.globalProperties.$i18n.locale;
});
const props = defineProps({
item: {
Expand Down Expand Up @@ -83,7 +90,7 @@ const props = defineProps({
v-for="(exception, index) of exceptionsList"
:key="index"
>
{{ parseException(exception, index+1) }}
{{ parseException(exception, index+1, i18nLocale) }}
</div>
</div>
</section>
Expand Down
10 changes: 9 additions & 1 deletion src/components/GeneralSiteCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import $config from '../main.js';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
import { getCurrentInstance } from 'vue';
const instance = getCurrentInstance();
const i18nLocale = computed(() => {
return instance.appContext.config.globalProperties.$i18n.locale;
});
import { computed } from 'vue';
const props = defineProps({
Expand Down Expand Up @@ -99,7 +107,7 @@ const subsection = computed(() => {
v-for="(exception, index) of exceptionsList"
:key="index"
>
{{ parseException(exception, index+1) }}
{{ parseException(exception, index+1, i18nLocale) }}
</div>
</div>
</section>
Expand Down
10 changes: 9 additions & 1 deletion src/components/NdsSchoolCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import $config from '../main.js';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
import { getCurrentInstance } from 'vue';
const instance = getCurrentInstance();
const i18nLocale = computed(() => {
return instance.appContext.config.globalProperties.$i18n.locale;
});
const props = defineProps({
item: {
type: Object,
Expand Down Expand Up @@ -97,7 +105,7 @@ const subsection = computed(() => {
v-for="(exception, index) of exceptionsList"
:key="index"
>
{{ parseException(exception, index+1) }}
{{ parseException(exception, index+1, i18nLocale) }}
</div>
</div>
</section>
Expand Down
13 changes: 12 additions & 1 deletion src/components/PhaSchoolCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
import $config from '../main.js';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
import { getCurrentInstance } from 'vue';
const instance = getCurrentInstance();
const i18nLocale = computed(() => {
return instance.appContext.config.globalProperties.$i18n.locale;
});
const props = defineProps({
item: {
type: Object,
Expand Down Expand Up @@ -95,7 +106,7 @@ const subsection = computed(() => {
v-for="(exception, index) of exceptionsList"
:key="index"
>
{{ parseException(exception, index+1) }}
{{ parseException(exception, index+1, i18nLocale) }}
</div>
</div>
</section>
Expand Down
10 changes: 9 additions & 1 deletion src/components/PublicBenefitsSiteCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import $config from '../main.js';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
import { getCurrentInstance } from 'vue';
const instance = getCurrentInstance();
const i18nLocale = computed(() => {
return instance.appContext.config.globalProperties.$i18n.locale;
});
const props = defineProps({
item: {
type: Object,
Expand Down Expand Up @@ -97,7 +105,7 @@ const subsection = computed(() => {
v-for="(exception, index) of exceptionsList"
:key="index"
>
{{ parseException(exception, index+1) }}
{{ parseException(exception, index+1, i18nLocale) }}
</div>
</div>
</section>
Expand Down
13 changes: 7 additions & 6 deletions src/composables/useLocalSharedFunctions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { format, parseISO } from 'date-fns';

import $config from '../main.js';

export default function useLocalSharedFunctions() {

Expand Down Expand Up @@ -77,16 +77,17 @@ export default function useLocalSharedFunctions() {
return value;
};

const parseException = (exception, index) => {
const parseException = (exception, index, i18nLocale) => {
if (import.meta.env.VITE_DEBUG) console.log('i18nLocale', i18nLocale);
let parsedException = '';
for (let i=0; i<index; i++) {
parsedException += "*";
}
// if (this.$i18n.messages[this.i18nLocale].exceptions && this.$i18n.messages[this.i18nLocale].exceptions[exception]) {
// parsedException += ' ' + this.$i18n.messages[this.i18nLocale].exceptions[exception];
// } else {
if ($config.i18n.data.messages[i18nLocale].exceptions && $config.i18n.data.messages[i18nLocale].exceptions[exception]) {
parsedException += ' ' + $config.i18n.data.messages[i18nLocale].exceptions[exception];
} else {
parsedException += ' ' + exception;
// }
}
return parsedException;
};

Expand Down
1 change: 1 addition & 0 deletions src/i18n/en-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,6 @@ export default {
"Open on third Saturday of the month": "Open on third Saturday of the month",
"Open on second and fourth Wednesday of the month": "Open on second and fourth Wednesday of the month",
"Open on second and fourth Saturdays of the month": "Open on second and fourth Saturdays of the month",
"Open for Breakfast 7:00-8:30, Lunch 12:00-1:30, and Dinner 4:00-5:30": "Open for Breakfast 7:00-8:30, Lunch 12:00-1:30, and Dinner 4:00-5:30",
},
};
1 change: 1 addition & 0 deletions src/i18n/es-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,6 @@ export default {
"Open on third Saturday of the month": "Abierto el tercer sábado de cada mes",
"Open on second and fourth Wednesday of the month": "Abierto el segundo y cuarto miércoles de cada mes",
"Open on second and fourth Saturdays of the month": "Abierto el segundo y cuarto sábado del mes",
"Open for Breakfast 7:00-8:30, Lunch 12:00-1:30, and Dinner 4:00-5:30": "Abierto para el desayuno de 7:00 a 8:30, el almuerzo de 12:00 a 1:30y la cena de 4:00 a 5:30",
},
};
1 change: 1 addition & 0 deletions src/i18n/fr-fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,6 @@ export default {
"Open on third Saturday of the month": "Ouvert le troisième samedi du mois",
"Open on second and fourth Wednesday of the month": "Ouvert les deuxième et quatrième mercredis du mois",
"Open on second and fourth Saturdays of the month": "Ouvert les deuxième et quatrième samedis du mois",
"Open for Breakfast 7:00-8:30, Lunch 12:00-1:30, and Dinner 4:00-5:30": "Ouvert pour le petit déjeuner de 7h00 à 8h30, le déjeuner de 12h00 à 13h30 et le dîner de 4h00 à 17h30",
},
};
1 change: 1 addition & 0 deletions src/i18n/ru-ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@ export default {
"Open on third Saturday of the month": "Открыто в третью субботу месяца",
"Open on second and fourth Wednesday of the month": "Открыто во вторую и четвертую среду месяца",
"Open on second and fourth Saturdays of the month": "Открыто во вторую и четвертую субботу месяца",
"Open for Breakfast 7:00-8:30, Lunch 12:00-1:30, and Dinner 4:00-5:30": "Открыт на завтрак с 7:00 до 8:30, на обед с 12:00 до 13:30 и на ужин с 4:00 до 5:30",
},
};
1 change: 1 addition & 0 deletions src/i18n/vi-vn.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,6 @@ export default {
"Open on third Saturday of the month": "Mở cửa vào thứ bảy thứ ba của tháng",
"Open on second and fourth Wednesday of the month": "Открыто во вторую и четвертую среду месяца",
"Open on second and fourth Saturdays of the month": "Mở cửa vào thứ bảy thứ hai và thứ tư trong tháng",
"Open for Breakfast 7:00-8:30, Lunch 12:00-1:30, and Dinner 4:00-5:30": "Mở cửa phục vụ bữa sáng 7:00-8:30, Bữa trưa 12:00-1:30, và Bữa tối 4:00-5:30",
},
};
1 change: 1 addition & 0 deletions src/i18n/zh-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,6 @@ export default {
"Open on third Saturday of the month": "每月第三个星期六开放",
"Open on second and fourth Wednesday of the month": "每月第二和第四个星期三开放",
"Open on second and fourth Saturdays of the month": "每月第二和第四个星期六开放",
"Open for Breakfast 7:00-8:30, Lunch 12:00-1:30, and Dinner 4:00-5:30": "供应早餐 7:00-8:30、午餐 12:00-1:30 和晚餐 4:00-5:30",
},
};

0 comments on commit 15bbd49

Please sign in to comment.