fbt-inline-translations 0.3.0 โ 0.3.2
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/README.md +19 -19
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.LICENSE.txt +1 -1
- package/dist/index.html +140 -2
- package/lib/TranslationDialog.d.ts +7 -22
- package/lib/TranslationDialog.js +35 -58
- package/lib/components/ActionButtons.d.ts +6 -6
- package/lib/components/ActionButtons.js +34 -30
- package/lib/components/Candidate.d.ts +7 -7
- package/lib/components/Candidate.js +29 -20
- package/lib/components/Glossary.d.ts +7 -7
- package/lib/components/Glossary.js +5 -5
- package/lib/components/Modal.d.ts +13 -0
- package/lib/components/Modal.js +74 -0
- package/lib/components/PhraseOverview.d.ts +3 -3
- package/lib/components/PhraseOverview.js +9 -8
- package/lib/components/TranslationCard.d.ts +8 -8
- package/lib/components/TranslationCard.js +62 -62
- package/lib/components/TranslationComposer.d.ts +3 -3
- package/lib/components/TranslationComposer.js +17 -17
- package/lib/contexts/PhraseContext.d.ts +9 -9
- package/lib/contexts/PhraseContext.js +3 -3
- package/lib/contexts/SwiftyperServiceContext.d.ts +4 -4
- package/lib/contexts/SwiftyperServiceContext.js +3 -3
- package/lib/contexts/TranslationContext.d.ts +17 -17
- package/lib/contexts/TranslationContext.js +3 -3
- package/lib/index.d.ts +14 -11
- package/lib/index.js +42 -22
- package/lib/providers/PhraseProvider.d.ts +8 -8
- package/lib/providers/PhraseProvider.js +11 -11
- package/lib/providers/SwiftyperServiceProvider.d.ts +6 -6
- package/lib/providers/SwiftyperServiceProvider.js +20 -20
- package/lib/providers/TranslationProvider.d.ts +6 -6
- package/lib/providers/TranslationProvider.js +23 -23
- package/lib/providers/swiftyper.d.ts +13 -13
- package/lib/providers/swiftyper.js +7 -7
- package/lib/services/SwiftyperService.d.ts +11 -11
- package/lib/services/SwiftyperService.js +33 -33
- package/lib/styleInjection.d.ts +2 -0
- package/lib/styleInjection.js +28 -0
- package/lib/types/Phrase.d.ts +61 -61
- package/lib/types/Phrase.js +1 -1
- package/lib/types/SwiftyperContextType.d.ts +5 -5
- package/lib/types/SwiftyperContextType.js +1 -1
- package/lib/types/Theme.d.ts +2 -0
- package/lib/types/Theme.js +9 -0
- package/lib/types/Translation.d.ts +16 -16
- package/lib/types/Translation.js +1 -1
- package/package.json +71 -75
- package/lib/App.css +0 -458
- package/lib/components/Rodal.d.ts +0 -57
- package/lib/components/Rodal.js +0 -111
- package/lib/rodal.css +0 -477
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ๐ฝ Inline
|
|
1
|
+
# ๐ฝ Inline Translations for FBT
|
|
2
2
|
|
|
3
3
|
The extension serves to effectively translate your application using inline translations so that you can view strings you are
|
|
4
4
|
translating in context.
|
|
@@ -13,9 +13,9 @@ You can make translations available to your translators, users, or the entire co
|
|
|
13
13
|

|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
## โน๏ธ
|
|
16
|
+
## โน๏ธ Prerequisites
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
This library requires one of the following FBT frameworks:
|
|
19
19
|
- [FBT for Laravel (v5.5+)](https://github.com/richardDobron/laravel-fbt)
|
|
20
20
|
- [FBT for PHP (v7.0+)](https://github.com/richardDobron/fbt)
|
|
21
21
|
- [FBT for JavaScript](https://github.com/facebook/fbt)
|
|
@@ -27,15 +27,15 @@ You can make translations available to your translators, users, or the entire co
|
|
|
27
27
|
- ๐ **Glossary**: support for consistent terminology
|
|
28
28
|
- ๐ **Voting**: on translation options
|
|
29
29
|
- ๐ **Variations**: for dynamic content
|
|
30
|
-
- ๐ **Dark
|
|
30
|
+
- ๐ **Dark Mode**: to match your theme
|
|
31
31
|
|
|
32
|
-
## ๐ฆ
|
|
32
|
+
## ๐ฆ Installation
|
|
33
33
|
|
|
34
|
-
โ ๏ธ **React 15 or higher
|
|
34
|
+
โ ๏ธ **React 15 or higher is required.**
|
|
35
35
|
|
|
36
|
-
Install the plugin
|
|
36
|
+
Install the plugin using npm or yarn:
|
|
37
37
|
|
|
38
|
-
```
|
|
38
|
+
```bash
|
|
39
39
|
npm install fbt-inline-translations
|
|
40
40
|
# or
|
|
41
41
|
yarn add fbt-inline-translations
|
|
@@ -129,25 +129,25 @@ init({
|
|
|
129
129
|
Register your FBT project on [Swiftyper Translations](https://translations.swiftyper.sk).
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
| **Option**
|
|
133
|
-
|
|
134
|
-
| `apiKey`
|
|
135
|
-
| `locale`
|
|
136
|
-
| `contributor`
|
|
137
|
-
| `darkMode`
|
|
132
|
+
| **Option** | **Type** | **Description** |
|
|
133
|
+
|---------------|----------|-----------------------------------------------------------|
|
|
134
|
+
| `apiKey` | string | API key for authenticating with the translation service. |
|
|
135
|
+
| `locale` | string | Locale setting for translations (e.g., `en_US`, `de_DE`). |
|
|
136
|
+
| `contributor` | string | Contributor email for authentication. |
|
|
137
|
+
| `darkMode` | boolean | Dark mode theme. |
|
|
138
138
|
|
|
139
139
|
## โก๏ธ Quick Start
|
|
140
140
|
|
|
141
141
|
### Non-React Usage
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
Include the following code snippet in your HTML page:
|
|
144
144
|
|
|
145
145
|
```html
|
|
146
146
|
<div id="inline-translator"></div>
|
|
147
147
|
|
|
148
148
|
<script src="https://cdn.jsdelivr.net/npm/fbt-inline-translations/dist/bundle.js"></script>
|
|
149
149
|
<script>
|
|
150
|
-
swiftyperInlineTranslations({
|
|
150
|
+
swiftyperInlineTranslations.default({
|
|
151
151
|
token: 'YOUR_API_KEY_HERE',
|
|
152
152
|
locale: 'sk_SK', // translation locale
|
|
153
153
|
contributor: 'contributor@email.com', // contributor must be invited
|
|
@@ -160,7 +160,7 @@ Add this code to your page:
|
|
|
160
160
|
|
|
161
161
|
In your application, wrap your `App` component. We recommend adding it around your root component in the `index.js` file.
|
|
162
162
|
|
|
163
|
-
```
|
|
163
|
+
```javascript
|
|
164
164
|
// src/index.js
|
|
165
165
|
|
|
166
166
|
import ReactDOM from 'react-dom';
|
|
@@ -181,8 +181,8 @@ ReactDOM.render(
|
|
|
181
181
|
|
|
182
182
|
## ๐งช Testing
|
|
183
183
|
|
|
184
|
-
```
|
|
185
|
-
npm run
|
|
184
|
+
```bash
|
|
185
|
+
npm run start
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
## ๐ Contributing
|