@tolgee/svelte 4.2.1 → 4.3.0-rc.3106ab8.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 4.3.0-rc.3106ab8.0 (2022-03-28)
7
+
8
+
9
+ ### Features
10
+
11
+ * ui is now included automatically ([3106ab8](https://github.com/tolgee/tolgee-js/commit/3106ab8d8e7915b1fc7b72a776df9765a3280100))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.2.1](https://github.com/tolgee/tolgee-js/compare/v4.2.0...v4.2.1) (2022-03-14)
7
18
 
8
19
  **Note:** Version bump only for package @tolgee/svelte
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Tolgee for Svelte
2
+
2
3
  ![test workflow](https://github.com/tolgee/tolgee-js/actions/workflows/test.yml/badge.svg)
3
4
  ![@tolgee/svelte version](https://img.shields.io/npm/v/@tolgee/svelte?label=%40tolgee%2Fsvelte)
4
5
  ![types typescript](https://img.shields.io/badge/Types-Typescript-blue)
@@ -27,7 +28,7 @@ Lokalize (translate) your Svelte projects to multiple languages with Tolgee. Int
27
28
 
28
29
  First, install the package.
29
30
 
30
- npm install @tolgee/svelte @tolgee/ui --save
31
+ npm install @tolgee/svelte
31
32
 
32
33
  Then use the library in your app:
33
34
 
@@ -35,17 +36,14 @@ Then use the library in your app:
35
36
 
36
37
  <script lang="ts">
37
38
  import { TolgeeProvider } from "@tolgee/svelte";
38
- import UI from "@tolgee/ui";
39
39
  import type { TolgeeConfig } from "@tolgee/core";
40
40
 
41
41
  const tolgeeConfig = {
42
42
  preloadFallback: true,
43
-
43
+
44
44
  // when using SvelteKit and .env, otherwise you can set those params directly or use some dotenv library
45
45
  apiUrl: import.meta.env.VITE_TOLGEE_API_KEY,
46
- //this can be omitted for production build
47
- ui: import.meta.env.VITE_TOLGEE_API_KEY ? UI : undefined,
48
- apiKey: import.meta.env.VITE_TOLGEE_API_KEY
46
+ apiKey: import.meta.env.VITE_TOLGEE_API_KEY
49
47
  } as TolgeeConfig;
50
48
  </script>
51
49
 
@@ -60,6 +58,7 @@ Then use the library in your app:
60
58
  To translate texts using Tolgee Svelte integration, you can use `T` component or `getTranslate` function.
61
59
 
62
60
  ### T component
61
+
63
62
  ```sveltehtml
64
63
 
65
64
  <script>
@@ -71,7 +70,9 @@ To translate texts using Tolgee Svelte integration, you can use `T` component or
71
70
  ```
72
71
 
73
72
  ### getTranslate function
73
+
74
74
  The `getTranslate` function returns store containing the function, which actually translates your key.
75
+
75
76
  ```sveltehtml
76
77
  <script>
77
78
  import { getTranslate } from "@tolgee/svelte";
@@ -84,6 +85,7 @@ The `getTranslate` function returns store containing the function, which actuall
84
85
  ```
85
86
 
86
87
  ### Changing the language
88
+
87
89
  To change the current language, use `getLanguageStore` method. For example, you can bind it to select value.
88
90
 
89
91
  ```sveltehtml
@@ -108,4 +110,4 @@ To change the current language, use `getLanguageStore` method. For example, you
108
110
 
109
111
  ## Quick integration guide
110
112
 
111
- Learn more at our [documentation website 📖](https://tolgee.io).
113
+ Learn more at our [documentation website 📖](https://tolgee.io).
package/T.svelte CHANGED
File without changes
package/T.svelte.d.ts CHANGED
File without changes
@@ -3,6 +3,11 @@ import { IcuFormatter, Tolgee, TolgeeConfig } from '@tolgee/core';
3
3
  export let config;
4
4
  const tolgee = Tolgee.use(IcuFormatter).init({
5
5
  wrapperMode: 'invisible',
6
+ ui: process.env.NODE_ENV !== 'development'
7
+ ? undefined
8
+ : typeof require !== 'undefined'
9
+ ? require('@tolgee/ui')
10
+ : import('@tolgee/ui'),
6
11
  ...(config || new TolgeeConfig()),
7
12
  });
8
13
  let tolgeeRunPromise;
File without changes
File without changes
File without changes
File without changes
File without changes
package/getTranslate.d.ts CHANGED
File without changes
package/getTranslate.js CHANGED
File without changes
package/index.d.ts CHANGED
File without changes
package/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@tolgee/svelte",
3
- "version": "4.2.1",
3
+ "version": "4.3.0-rc.3106ab8.0",
4
4
  "dependencies": {
5
- "jest-fetch-mock": "^3.0.3"
5
+ "@tolgee/core": "^4.3.0-rc.3106ab8.0",
6
+ "@tolgee/ui": "^4.3.0-rc.3106ab8.0"
6
7
  },
7
8
  "devDependencies": {
8
9
  "@sveltejs/kit": "next",
9
10
  "@testing-library/jest-dom": "5.16.2",
10
11
  "@testing-library/svelte": "3.0.3",
11
- "@tolgee/core": "^4.2.1",
12
12
  "@types/jest": "27.4.1",
13
13
  "@typescript-eslint/eslint-plugin": "^5.14.0",
14
14
  "@typescript-eslint/parser": "^5.14.0",
@@ -16,6 +16,7 @@
16
16
  "eslint-config-prettier": "^8.5.0",
17
17
  "eslint-plugin-svelte3": "^3.4.1",
18
18
  "jest": "27.5.1",
19
+ "jest-fetch-mock": "^3.0.3",
19
20
  "nodemon": "^2.0.15",
20
21
  "prettier": "^2.5.1",
21
22
  "prettier-plugin-svelte": "^2.6.0",
package/types.d.ts CHANGED
File without changes
package/types.js CHANGED
File without changes