File tree Expand file tree Collapse file tree 5 files changed +25
-0
lines changed Expand file tree Collapse file tree 5 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 15
15
</template >
16
16
17
17
<script >
18
+ import { updateLocale } from ' theme/utils/i18n-utils' ;
18
19
import GenericError from ' theme/components/GenericError.vue' ;
19
20
import AppStore from ' docc-render/stores/AppStore' ;
20
21
@@ -24,5 +25,13 @@ export default {
24
25
created () {
25
26
AppStore .setAllLocalesAreAvailable ();
26
27
},
28
+ beforeRouteEnter (to , from , next ) {
29
+ next ((vm ) => {
30
+ updateLocale (to .params .locale , vm);
31
+ });
32
+ },
33
+ beforeRouteUpdate (to ) {
34
+ updateLocale (to .params .locale , this );
35
+ },
27
36
};
28
37
</script >
Original file line number Diff line number Diff line change 13
13
</template >
14
14
15
15
<script >
16
+ import { updateLocale } from ' theme/utils/i18n-utils' ;
16
17
import GenericError from ' theme/components/GenericError.vue' ;
17
18
import AppStore from ' docc-render/stores/AppStore' ;
18
19
@@ -22,5 +23,13 @@ export default {
22
23
created () {
23
24
AppStore .setAllLocalesAreAvailable ();
24
25
},
26
+ beforeRouteEnter (to , from , next ) {
27
+ next ((vm ) => {
28
+ updateLocale (to .params .locale , vm);
29
+ });
30
+ },
31
+ beforeRouteUpdate (to ) {
32
+ updateLocale (to .params .locale , this );
33
+ },
25
34
};
26
35
</script >
Original file line number Diff line number Diff line change 21
21
</template >
22
22
23
23
<script >
24
+ import { updateLocale } from ' theme/utils/i18n-utils' ;
24
25
import {
25
26
fetchDataForRouteEnter ,
26
27
shouldFetchDataForRouteUpdate ,
@@ -80,13 +81,15 @@ export default {
80
81
return ;
81
82
}
82
83
fetchDataForRouteEnter (to, from, next).then (data => next ((vm ) => {
84
+ updateLocale (to .params .locale , vm);
83
85
vm .topicData = data; // eslint-disable-line no-param-reassign
84
86
})).catch (next);
85
87
},
86
88
beforeRouteUpdate (to , from , next ) {
87
89
if (shouldFetchDataForRouteUpdate (to, from)) {
88
90
fetchDataForRouteEnter (to, from, next).then ((data ) => {
89
91
this .topicData = data;
92
+ updateLocale (to .params .locale , this );
90
93
next ();
91
94
}).catch (next);
92
95
} else {
Original file line number Diff line number Diff line change 13
13
</template >
14
14
15
15
<script >
16
+ import { updateLocale } from ' theme/utils/i18n-utils' ;
16
17
import {
17
18
fetchDataForRouteEnter ,
18
19
shouldFetchDataForRouteUpdate ,
@@ -54,13 +55,15 @@ export default {
54
55
}
55
56
56
57
fetchDataForRouteEnter (to, from, next).then (data => next ((vm ) => {
58
+ updateLocale (to .params .locale , vm);
57
59
vm .topicData = data; // eslint-disable-line no-param-reassign
58
60
})).catch (next);
59
61
},
60
62
beforeRouteUpdate (to , from , next ) {
61
63
if (shouldFetchDataForRouteUpdate (to, from)) {
62
64
fetchDataForRouteEnter (to, from, next).then ((data ) => {
63
65
this .topicData = data;
66
+ updateLocale (to .params .locale , this );
64
67
next ();
65
68
}).catch (next);
66
69
} else {
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import FetchError from 'docc-render/errors/FetchError';
15
15
16
16
jest . mock ( 'docc-render/utils/theme-settings' , ( ) => ( {
17
17
baseUrl : '/' ,
18
+ getSetting : jest . fn ( ) ,
18
19
} ) ) ;
19
20
20
21
const mockInstance = {
You can’t perform that action at this time.
0 commit comments