fbt-inline-translations 0.1.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/.babelrc +7 -0
- package/.eslintrc.js +25 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +6 -0
- package/README.md +39 -0
- package/babel.config.js +20 -0
- package/dist/0d8bb5b3ee5f5dac9e44.woff2 +0 -0
- package/dist/176f8f5bd5f02b3abfcf.woff2 +0 -0
- package/dist/18d00f739ff1e1c52db1.woff +0 -0
- package/dist/2267169ee7270a22a963.woff +0 -0
- package/dist/37a7069dc30fc663c878.woff2 +0 -0
- package/dist/451d4e559d6f57cdf6a1.woff +0 -0
- package/dist/49ae34d4cc6b98c00c69.woff +0 -0
- package/dist/7d8125ff7f707231fd89.woff2 +0 -0
- package/dist/7f839a8652da29745ce4.woff2 +0 -0
- package/dist/865f928cbabcc9f8f2b5.woff +0 -0
- package/dist/870c8c1486f76054301a.woff2 +0 -0
- package/dist/9360531f9bb817f917f0.woff +0 -0
- package/dist/a45108d3b34af91f9113.woff +0 -0
- package/dist/b1d9d9904bfca8802a63.woff +0 -0
- package/dist/bac8362e7a6ea60b6983.woff +0 -0
- package/dist/bd5b7a13f2c52b531a2a.woff +0 -0
- package/dist/bundle.js +2 -0
- package/dist/bundle.js.LICENSE.txt +67 -0
- package/dist/c18ee39fb002ad58b6dc.woff2 +0 -0
- package/dist/c20d916c1a1b094c1cec.woff +0 -0
- package/dist/c2aa4ab115bf9c6057cb.woff2 +0 -0
- package/dist/c64e7e354c88e613c77c.woff2 +0 -0
- package/dist/cb5ad999740e9d8a8bd1.woff2 +0 -0
- package/dist/cea99d3e3e13a3a599a0.woff +0 -0
- package/dist/d022bc70dc1bf7b3425d.woff2 +0 -0
- package/dist/f5b74d7ffcdf85b9dd60.woff2 +0 -0
- package/dist/index.html +26 -0
- package/images/demo.gif +0 -0
- package/package.json +58 -0
- package/postcss.config.js +6 -0
- package/src/@types/Phrase.ts +58 -0
- package/src/@types/SwiftyperContextType.ts +5 -0
- package/src/@types/Translation.ts +16 -0
- package/src/App.css +24 -0
- package/src/App.tsx +83 -0
- package/src/components/Candidate.tsx +32 -0
- package/src/components/Composer.tsx +65 -0
- package/src/components/PhraseOverview.tsx +19 -0
- package/src/components/TranslationCard.tsx +120 -0
- package/src/contexts/SwiftyperServiceContext.tsx +37 -0
- package/src/index.tsx +35 -0
- package/src/providers/swiftyper.tsx +21 -0
- package/src/services/SwiftyperService.ts +46 -0
- package/tailwind.config.js +9 -0
- package/tsconfig.json +20 -0
- package/webpack.config.js +43 -0
package/.babelrc
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parser: '@typescript-eslint/parser',
|
|
4
|
+
parserOptions: {
|
|
5
|
+
ecmaVersion: 2020,
|
|
6
|
+
sourceType: "module",
|
|
7
|
+
},
|
|
8
|
+
plugins: [
|
|
9
|
+
'@typescript-eslint',
|
|
10
|
+
'prettier'
|
|
11
|
+
],
|
|
12
|
+
extends: [
|
|
13
|
+
'eslint:recommended',
|
|
14
|
+
'plugin:@typescript-eslint/eslint-recommended',
|
|
15
|
+
'plugin:@typescript-eslint/recommended',
|
|
16
|
+
'plugin:prettier/recommended'
|
|
17
|
+
],
|
|
18
|
+
"rules": {
|
|
19
|
+
"prettier/prettier": "warn",
|
|
20
|
+
"@typescript-eslint/member-delimiter-style": "off",
|
|
21
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
22
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
23
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
24
|
+
}
|
|
25
|
+
};
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules
|
package/.prettierrc.json
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# 👽 Inline translations for FBT
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## ℹ️ Usage notes
|
|
7
|
+
|
|
8
|
+
- this library requires FBT for PHP:
|
|
9
|
+
- [FBT for Laravel (v5.5+)](https://github.com/richardDobron/laravel-fbt)
|
|
10
|
+
- [FBT for PHP (v7.0+)](https://github.com/richardDobron/fbt)
|
|
11
|
+
|
|
12
|
+
## 📦 Installing
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
npm install fbt-inline-translations
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 🔧 Configuration
|
|
19
|
+
|
|
20
|
+
Register your FBT project on [Swiftyper Translations](https://translations.swiftyper.sk)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Non-React usage
|
|
24
|
+
|
|
25
|
+
Add this code to page your page:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<div id="inline-translator"></div>
|
|
29
|
+
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/fbt-inline-translations/dist/bundle.js"></script>
|
|
31
|
+
<script>
|
|
32
|
+
swiftyperInlineTranslations({
|
|
33
|
+
token: 'YOUR_API_KEY_HERE',
|
|
34
|
+
locale: 'sk_SK', // translation locale
|
|
35
|
+
contributor: 'contributor@email.com', // contributor must be invited
|
|
36
|
+
darkMode: false, // dark mode also depends on html class 'dark'
|
|
37
|
+
})
|
|
38
|
+
</script>
|
|
39
|
+
```
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = function (api) {
|
|
2
|
+
api.cache(true)
|
|
3
|
+
|
|
4
|
+
const useESModules = process.env.BABEL_MODULE === 'es'
|
|
5
|
+
|
|
6
|
+
return {
|
|
7
|
+
presets: [
|
|
8
|
+
[
|
|
9
|
+
'@babel/preset-env',
|
|
10
|
+
{
|
|
11
|
+
loose: true,
|
|
12
|
+
modules: useESModules ? false : 'commonjs',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
['@babel/preset-react', { runtime: 'automatic' }],
|
|
16
|
+
'@babel/preset-typescript',
|
|
17
|
+
],
|
|
18
|
+
plugins: ['@babel/plugin-proposal-class-properties'],
|
|
19
|
+
}
|
|
20
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|