@live-change/frontend-template 0.9.137 → 0.9.138

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.
package/front/src/App.vue CHANGED
@@ -23,6 +23,7 @@
23
23
 
24
24
  import { useI18n } from 'vue-i18n'
25
25
  const i18n = useI18n()
26
+ const { locale: i18nLocale } = useI18n()
26
27
 
27
28
  import { client as useClient, useApi } from '@live-change/vue3-ssr'
28
29
  const api = useApi()
@@ -58,6 +59,16 @@
58
59
  StyleModule.mount(window.document, defaultHighlightStyle.module)
59
60
  }
60
61
 
62
+ locale.getLocaleObservable() // to force locale to be observed
63
+ // Synchronizacja języka między useLocale a vue-i18n
64
+ watch(() => locale.localeRef.value, (newLocale, oldLocale) => {
65
+ console.log("LOCALE CHANGE", oldLocale?.language, '=>', newLocale?.language)
66
+ if(newLocale?.language && i18nLocale.value !== newLocale.language) {
67
+ console.log("UPDATING I18N LOCALE TO", newLocale.language)
68
+ i18nLocale.value = newLocale.language
69
+ }
70
+ }, { immediate: true })
71
+
61
72
  import "./analytics"
62
73
 
63
74
  </script>
@@ -3,6 +3,17 @@ import deepmerge from 'deepmerge';
3
3
  import * as en from "../locales/en.js"
4
4
  import { locales as autoFormLocales } from "@live-change/frontend-auto-form"
5
5
  import { locales as userFrontendLocales } from "@live-change/user-frontend"
6
+ import { locales as accessControlLocales } from "@live-change/access-control-frontend"
7
+ import { locales as baseLocales } from "@live-change/frontend-base"
8
+ import { locales as contentLocales } from "@live-change/content-frontend"
9
+ import { locales as imageLocales } from "@live-change/image-frontend"
10
+ import { locales as peerConnectionLocales } from "@live-change/peer-connection-frontend"
11
+ import { locales as taskLocales } from "@live-change/task-frontend"
12
+ import { locales as uploadLocales } from "@live-change/upload-frontend"
13
+ import { locales as urlLocales } from "@live-change/url-frontend"
14
+ import { locales as videoCallLocales } from "@live-change/video-call-frontend"
15
+ import { locales as wysiwygLocales } from "@live-change/wysiwyg-frontend"
16
+ import { locales as blogLocales } from "@live-change/blog-frontend"
6
17
 
7
18
  import Aura from '@primeuix/themes/aura'
8
19
 
@@ -24,11 +35,37 @@ export default {
24
35
  },
25
36
 
26
37
  defaultLocale: 'en',
38
+ localeSelector: ({ api, host, url, headers }) => {
39
+ let locale = 'en'
40
+ const acceptLanguage = headers?.['accept-language']
41
+ if(acceptLanguage) {
42
+ locale = acceptLanguage?.split(',')[0]
43
+ }
44
+ if(typeof window !== 'undefined') {
45
+ const html = document.querySelector('html')
46
+ const lang = html.getAttribute('lang')
47
+ if(html) {
48
+ locale = lang?.split('-')[0]
49
+ }
50
+ }
51
+ return locale || 'en'
52
+ },
27
53
  i18n: {
28
54
  messages: {
29
55
  en: deepmerge.all([
56
+ baseLocales.en,
30
57
  autoFormLocales.en,
31
58
  userFrontendLocales.en,
59
+ accessControlLocales.en,
60
+ contentLocales.en,
61
+ imageLocales.en,
62
+ peerConnectionLocales.en,
63
+ taskLocales.en,
64
+ uploadLocales.en,
65
+ urlLocales.en,
66
+ videoCallLocales.en,
67
+ wysiwygLocales.en,
68
+ blogLocales.en,
32
69
  en.messages
33
70
  ])
34
71
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/frontend-template",
3
- "version": "0.9.137",
3
+ "version": "0.9.138",
4
4
  "scripts": {
5
5
  "memDev": "tsx --inspect --expose-gc server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "tsx server/start.js localDev --enableSessions --initScript ./init.js --dbAccess",
@@ -39,44 +39,44 @@
39
39
  "@codemirror/language": "6.10.1",
40
40
  "@dotenvx/dotenvx": "0.27.0",
41
41
  "@fortawesome/fontawesome-free": "^6.7.2",
42
- "@live-change/access-control-frontend": "^0.9.137",
43
- "@live-change/access-control-service": "^0.9.137",
44
- "@live-change/agreement-service": "^0.9.137",
45
- "@live-change/backup-service": "^0.9.137",
46
- "@live-change/blog-frontend": "^0.9.137",
47
- "@live-change/blog-service": "^0.9.137",
48
- "@live-change/cli": "^0.9.137",
49
- "@live-change/content-frontend": "^0.9.137",
50
- "@live-change/content-service": "^0.9.137",
51
- "@live-change/dao": "^0.9.137",
52
- "@live-change/dao-vue3": "^0.9.137",
53
- "@live-change/dao-websocket": "^0.9.137",
54
- "@live-change/db-client": "^0.9.137",
55
- "@live-change/draft-service": "^0.9.137",
56
- "@live-change/email-service": "^0.9.137",
57
- "@live-change/framework": "^0.9.137",
58
- "@live-change/frontend-auto-form": "^0.9.137",
59
- "@live-change/frontend-base": "^0.9.137",
60
- "@live-change/geoip-service": "^0.9.137",
61
- "@live-change/image-frontend": "^0.9.137",
62
- "@live-change/locale-settings-service": "^0.9.137",
63
- "@live-change/password-authentication-service": "^0.9.137",
64
- "@live-change/prosemirror-service": "^0.9.137",
65
- "@live-change/secret-code-service": "^0.9.137",
66
- "@live-change/secret-link-service": "^0.9.137",
67
- "@live-change/session-service": "^0.9.137",
68
- "@live-change/task-frontend": "^0.9.137",
69
- "@live-change/task-service": "^0.9.137",
70
- "@live-change/upload-frontend": "^0.9.137",
71
- "@live-change/url-frontend": "^0.9.137",
72
- "@live-change/url-service": "^0.9.137",
73
- "@live-change/user-frontend": "^0.9.137",
74
- "@live-change/user-identification-service": "^0.9.137",
75
- "@live-change/user-service": "^0.9.137",
76
- "@live-change/vote-service": "^0.9.137",
77
- "@live-change/vue3-components": "^0.9.137",
78
- "@live-change/vue3-ssr": "^0.9.137",
79
- "@live-change/wysiwyg-frontend": "^0.9.137",
42
+ "@live-change/access-control-frontend": "^0.9.138",
43
+ "@live-change/access-control-service": "^0.9.138",
44
+ "@live-change/agreement-service": "^0.9.138",
45
+ "@live-change/backup-service": "^0.9.138",
46
+ "@live-change/blog-frontend": "^0.9.138",
47
+ "@live-change/blog-service": "^0.9.138",
48
+ "@live-change/cli": "^0.9.138",
49
+ "@live-change/content-frontend": "^0.9.138",
50
+ "@live-change/content-service": "^0.9.138",
51
+ "@live-change/dao": "^0.9.138",
52
+ "@live-change/dao-vue3": "^0.9.138",
53
+ "@live-change/dao-websocket": "^0.9.138",
54
+ "@live-change/db-client": "^0.9.138",
55
+ "@live-change/draft-service": "^0.9.138",
56
+ "@live-change/email-service": "^0.9.138",
57
+ "@live-change/framework": "^0.9.138",
58
+ "@live-change/frontend-auto-form": "^0.9.138",
59
+ "@live-change/frontend-base": "^0.9.138",
60
+ "@live-change/geoip-service": "^0.9.138",
61
+ "@live-change/image-frontend": "^0.9.138",
62
+ "@live-change/locale-settings-service": "^0.9.138",
63
+ "@live-change/password-authentication-service": "^0.9.138",
64
+ "@live-change/prosemirror-service": "^0.9.138",
65
+ "@live-change/secret-code-service": "^0.9.138",
66
+ "@live-change/secret-link-service": "^0.9.138",
67
+ "@live-change/session-service": "^0.9.138",
68
+ "@live-change/task-frontend": "^0.9.138",
69
+ "@live-change/task-service": "^0.9.138",
70
+ "@live-change/upload-frontend": "^0.9.138",
71
+ "@live-change/url-frontend": "^0.9.138",
72
+ "@live-change/url-service": "^0.9.138",
73
+ "@live-change/user-frontend": "^0.9.138",
74
+ "@live-change/user-identification-service": "^0.9.138",
75
+ "@live-change/user-service": "^0.9.138",
76
+ "@live-change/vote-service": "^0.9.138",
77
+ "@live-change/vue3-components": "^0.9.138",
78
+ "@live-change/vue3-ssr": "^0.9.138",
79
+ "@live-change/wysiwyg-frontend": "^0.9.138",
80
80
  "@vueuse/core": "^12.3.0",
81
81
  "codeceptjs-assert": "^0.0.5",
82
82
  "compression": "^1.7.5",
@@ -108,5 +108,5 @@
108
108
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
109
109
  "license": "ISC",
110
110
  "description": "",
111
- "gitHead": "762fcddea43fa160b99ee72eb29219a5e0048498"
111
+ "gitHead": "af56bfe0ca7899934a4c563ead788318832336de"
112
112
  }