aloha-vue 1.0.351 → 1.0.352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import AButton from "../../../../src/AButton/AButton";
|
|
1
2
|
import AIcon from "../../../../src/AIcon/AIcon";
|
|
2
3
|
import AMenuButtonToggle from "../../../../src/AMenu/AMenuButtonToggle";
|
|
3
4
|
import ASelect from "../../../../src/ui/ASelect/ASelect";
|
|
4
5
|
|
|
5
6
|
import LanguagesAPI from "./compositionAPI/LanguagesAPI";
|
|
7
|
+
import ATranslationAPI from "../../../../src/ATranslation/compositionAPI/ATranslationAPI";
|
|
6
8
|
|
|
7
9
|
export default {
|
|
8
10
|
name: "TheNavbar",
|
|
9
11
|
components: {
|
|
12
|
+
AButton,
|
|
10
13
|
AIcon,
|
|
11
14
|
AMenuButtonToggle,
|
|
12
15
|
ASelect,
|
|
@@ -18,10 +21,17 @@ export default {
|
|
|
18
21
|
modelLanguage,
|
|
19
22
|
} = LanguagesAPI();
|
|
20
23
|
|
|
24
|
+
const {
|
|
25
|
+
isTranslate,
|
|
26
|
+
toggleTranslate,
|
|
27
|
+
} = ATranslationAPI();
|
|
28
|
+
|
|
21
29
|
return {
|
|
22
30
|
changeLanguage,
|
|
31
|
+
isTranslate,
|
|
23
32
|
languages,
|
|
24
33
|
modelLanguage,
|
|
34
|
+
toggleTranslate,
|
|
25
35
|
};
|
|
26
36
|
},
|
|
27
37
|
};
|
|
@@ -17,6 +17,12 @@ nav.a_d_flex.a_justify_content_between.a_align_items_center.a_px_2(
|
|
|
17
17
|
span.h1.mb-0.ms-4.align-bottom ALOHA
|
|
18
18
|
|
|
19
19
|
form.a_d_flex
|
|
20
|
+
a-button.a_mr_2(
|
|
21
|
+
:is-switch="true"
|
|
22
|
+
:model-switch="isTranslate"
|
|
23
|
+
icon-left="Translate"
|
|
24
|
+
@click="() => toggleTranslate()"
|
|
25
|
+
)
|
|
20
26
|
a-select(
|
|
21
27
|
v-model="modelLanguage"
|
|
22
28
|
:data="languages"
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
const language = ref("de");
|
|
11
11
|
const i18n = ref({});
|
|
12
|
-
const isTranslate = ref(true);
|
|
12
|
+
export const isTranslate = ref(true);
|
|
13
13
|
|
|
14
14
|
export const translation = computed(() => {
|
|
15
15
|
if (isTranslate.value) {
|
|
@@ -21,6 +21,7 @@ export const translation = computed(() => {
|
|
|
21
21
|
export default function ATranslationAPI() {
|
|
22
22
|
return {
|
|
23
23
|
i18n,
|
|
24
|
+
isTranslate,
|
|
24
25
|
language,
|
|
25
26
|
setI18n,
|
|
26
27
|
setLanguage,
|
|
@@ -40,6 +41,7 @@ export function setLanguage(languageLocal = "") {
|
|
|
40
41
|
export function toggleTranslate(isTranslateLocal) {
|
|
41
42
|
if (isUndefined(isTranslateLocal)) {
|
|
42
43
|
isTranslate.value = !isTranslate.value;
|
|
44
|
+
} else {
|
|
45
|
+
isTranslate.value = !!isTranslateLocal;
|
|
43
46
|
}
|
|
44
|
-
isTranslate.value = !!isTranslateLocal;
|
|
45
47
|
}
|