tera-system-ui 0.0.33 → 0.0.35

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.
@@ -82,14 +82,13 @@
82
82
 
83
83
  let openDialog = $state(false)
84
84
 
85
- let flagUrl = $derived(getFlagUrl(currentLangItem.flag))
86
85
  </script>
87
86
 
88
87
  <!--add component here-->
89
88
  <button onclick={() => {openDialog = true}}
90
89
  class="h-8 flex items-center bg-neutral-token-4 text-neutral-token-9 rounded-full ps-2 pe-1 hover:bg-neutral-token-5 transition-all duration-element-react">
91
90
  <IconLanguage class="size-icon-xs"/>
92
- <img class="size-6 flag-img" src={flagUrl} alt={currentLangItem.flag}>
91
+ <img class="size-6 flag-img" src={currentLangItem?.flag} alt={currentLangItem?.flag}>
93
92
  </button>
94
93
 
95
94
  <Dialog bind:open={openDialog} class="text-neutral-token-13" size="xs" staticRender>
@@ -105,7 +104,7 @@
105
104
  }}
106
105
  data-selected={lang.code === language ? '' : undefined}>
107
106
  <div class="flex items-center gap-2">
108
- <img class="size-8 flag-img" src={getFlagUrl(lang.flag)} alt={currentLangItem.flag} loading="lazy">
107
+ <img class="size-8 flag-img" src={getFlagUrl(lang.flag)} alt={currentLangItem?.flag} loading="lazy">
109
108
  {lang.label}
110
109
  </div>
111
110
  <div class="check">
@@ -5,6 +5,7 @@ export interface SideNavigationProps extends SideNavigationVariants {
5
5
  children?: any;
6
6
  class?: string;
7
7
  sideNavHref?: string;
8
+ language?: string;
8
9
  }
9
10
  export declare const SCREEN_BREAK_POINTS: {
10
11
  sm: number;
@@ -19,7 +19,7 @@
19
19
 
20
20
  import {getGlobalContext} from "../tera-ui-context/global-context";
21
21
 
22
- let {children, sideNavHref, ...props}: SideNavigationProps = $props();
22
+ let {children, sideNavHref, language, ...props}: SideNavigationProps = $props();
23
23
 
24
24
  let temporaryExpand: any = undefined
25
25
 
@@ -48,19 +48,23 @@
48
48
  let globalContext = getGlobalContext()
49
49
 
50
50
  sideNavHref = sideNavHref || globalContext?.sideNavHref
51
+ language = language || globalContext?.language
52
+
53
+ let langPath = (language === 'en' || !language) ? '' : `/${language}`
51
54
 
52
55
  function isSelected(href: string) {
53
56
  return sideNavHref?.startsWith(href)
54
57
  }
55
58
 
59
+
56
60
  const NAV_ITEM = [
57
61
  {
58
- href: '/calculator',
62
+ href: `/calculator${langPath}`,
59
63
  icon: IconCalculator,
60
64
  title: m.text_calces_scientific_calculator(),
61
65
  },
62
66
  {
63
- href: '/convert',
67
+ href: `/convert${langPath}`,
64
68
  icon: IconTransform,
65
69
  title: m.text_unit_converter(),
66
70
  },
@@ -2,7 +2,7 @@
2
2
  import {SideNavigation} from "./";
3
3
  import './sidenav.scss'
4
4
 
5
- let {children} = $props()
5
+ let {children, language} = $props()
6
6
  </script>
7
7
 
8
8
  <main
@@ -10,7 +10,7 @@
10
10
  class="side-nav_main-layout relative"
11
11
  data-side-nav-state="compact"
12
12
  >
13
- <SideNavigation/>
13
+ <SideNavigation language={language}/>
14
14
 
15
15
  <section class="side-nav_main-content">
16
16
  {@render children?.()}
@@ -1,6 +1,7 @@
1
1
  import './sidenav.scss';
2
2
  declare const SideNavigationLayout: import("svelte").Component<{
3
3
  children: any;
4
+ language: any;
4
5
  }, {}, "">;
5
6
  type SideNavigationLayout = ReturnType<typeof SideNavigationLayout>;
6
7
  export default SideNavigationLayout;
@@ -10,12 +10,13 @@
10
10
  } from "../dropdown-menu";
11
11
  import {IconLogout, IconSettings} from "../icons";
12
12
  import {extractShortUsernameFromEmail} from "../../internal/service/user.service";
13
-
13
+ import * as m from '../../paraglide/messages'
14
14
  let {children, user, onLogout,...props}: UserAvatarWithMenuProps = $props();
15
15
 
16
16
  let shortUserName = extractShortUsernameFromEmail(user?.email)
17
17
  let triggerRef = $state()
18
18
  let open = $state(false)
19
+
19
20
  </script>
20
21
 
21
22
 
@@ -54,14 +55,14 @@
54
55
  href="/account-settings"
55
56
  >
56
57
  <IconSettings/>
57
- Account Settings
58
+ {m.text_account_settings()}
58
59
  </DropdownMenuItem>
59
60
  </DropdownMenuGroup>
60
61
  <DropdownMenuSeparator/>
61
62
  <DropdownMenuGroup>
62
63
  <DropdownMenuItem onclick={onLogout}>
63
64
  <IconLogout/>
64
- Logout
65
+ {m.text_logout()}
65
66
  </DropdownMenuItem>
66
67
  </DropdownMenuGroup>
67
68
  </DropdownMenu>
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `CalcES Sci. Rechner`
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `CalcES Dokumentation`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Kontoeinstellungen`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Abmelden`
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `CalcES Scientific Calcul
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `CalcES Documentation`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Account Settings`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Logout`
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `Calculadora Científica`
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `Documentación de CalcES`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Configuración de la cuenta`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Cerrar sesión`
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `Calculatrice Scientifiqu
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `Documentation de CalcES`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Paramètres du compte`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Déconnexion`
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `Calcolatrice Scientifica
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `Documentazione di CalcES`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Impostazioni dell'account`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Disconnettersi`
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `Calculadora Científica`
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `Documentação CalcES`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Configurações da conta`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Sair`
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `Научный каль
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `Документация CalcES`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Настройки аккаунта`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Выйти`
@@ -2,3 +2,5 @@ export function text_select_language(): string;
2
2
  export function text_unit_converter(): string;
3
3
  export function text_calces_scientific_calculator(): string;
4
4
  export function text_calces_documentation(): string;
5
+ export function text_account_settings(): string;
6
+ export function text_logout(): string;
@@ -40,3 +40,19 @@ export const text_calces_scientific_calculator = () => `Máy Tính Khoa Học`
40
40
  */
41
41
  /* @__NO_SIDE_EFFECTS__ */
42
42
  export const text_calces_documentation = () => `Tài Liệu CalcES`
43
+
44
+
45
+ /**
46
+ *
47
+ * @returns {string}
48
+ */
49
+ /* @__NO_SIDE_EFFECTS__ */
50
+ export const text_account_settings = () => `Cài đặt tài khoản`
51
+
52
+
53
+ /**
54
+ *
55
+ * @returns {string}
56
+ */
57
+ /* @__NO_SIDE_EFFECTS__ */
58
+ export const text_logout = () => `Đăng xuất`
@@ -10,3 +10,9 @@ export function text_calces_scientific_calculator(params?: {}, options?: {
10
10
  export function text_calces_documentation(params?: {}, options?: {
11
11
  languageTag?: "de" | "en" | "es" | "fr" | "pt" | "vi" | "ru" | "it";
12
12
  }): string;
13
+ export function text_account_settings(params?: {}, options?: {
14
+ languageTag?: "de" | "en" | "es" | "fr" | "pt" | "vi" | "ru" | "it";
15
+ }): string;
16
+ export function text_logout(params?: {}, options?: {
17
+ languageTag?: "de" | "en" | "es" | "fr" | "pt" | "vi" | "ru" | "it";
18
+ }): string;
@@ -120,3 +120,59 @@ export const text_calces_documentation = (params = {}, options = {}) => {
120
120
  }[options.languageTag ?? languageTag()]()
121
121
  }
122
122
 
123
+
124
+
125
+ /**
126
+ * This message has been compiled by [inlang paraglide](https://inlang.com/m/gerre34r/library-inlang-paraglideJs).
127
+ *
128
+ * - Don't edit the message's code. Use [Sherlock (VS Code extension)](https://inlang.com/m/r7kp499g/app-inlang-ideExtension),
129
+ * the [web editor](https://inlang.com/m/tdozzpar/app-inlang-finkLocalizationEditor) instead, or edit the translation files manually.
130
+ *
131
+ * - The params are NonNullable<unknown> because the inlang SDK does not provide information on the type of a param (yet).
132
+ *
133
+ * @param {{}} params
134
+ * @param {{ languageTag?: "de" | "en" | "es" | "fr" | "pt" | "vi" | "ru" | "it" }} options
135
+ * @returns {string}
136
+ */
137
+ /* @__NO_SIDE_EFFECTS__ */
138
+ export const text_account_settings = (params = {}, options = {}) => {
139
+ return {
140
+ de: de.text_account_settings,
141
+ en: en.text_account_settings,
142
+ es: es.text_account_settings,
143
+ fr: fr.text_account_settings,
144
+ it: it.text_account_settings,
145
+ pt: pt.text_account_settings,
146
+ ru: ru.text_account_settings,
147
+ vi: vi.text_account_settings
148
+ }[options.languageTag ?? languageTag()]()
149
+ }
150
+
151
+
152
+
153
+ /**
154
+ * This message has been compiled by [inlang paraglide](https://inlang.com/m/gerre34r/library-inlang-paraglideJs).
155
+ *
156
+ * - Don't edit the message's code. Use [Sherlock (VS Code extension)](https://inlang.com/m/r7kp499g/app-inlang-ideExtension),
157
+ * the [web editor](https://inlang.com/m/tdozzpar/app-inlang-finkLocalizationEditor) instead, or edit the translation files manually.
158
+ *
159
+ * - The params are NonNullable<unknown> because the inlang SDK does not provide information on the type of a param (yet).
160
+ *
161
+ * @param {{}} params
162
+ * @param {{ languageTag?: "de" | "en" | "es" | "fr" | "pt" | "vi" | "ru" | "it" }} options
163
+ * @returns {string}
164
+ */
165
+ /* @__NO_SIDE_EFFECTS__ */
166
+ export const text_logout = (params = {}, options = {}) => {
167
+ return {
168
+ de: de.text_logout,
169
+ en: en.text_logout,
170
+ es: es.text_logout,
171
+ fr: fr.text_logout,
172
+ it: it.text_logout,
173
+ pt: pt.text_logout,
174
+ ru: ru.text_logout,
175
+ vi: vi.text_logout
176
+ }[options.languageTag ?? languageTag()]()
177
+ }
178
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tera-system-ui",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "npm run customPrepublish && npm run generate-index && vite build && npm run package && npm run postpublish",