Skip to content

Commit

Permalink
Merge pull request #11 from MiracleUFO/README-patch
Browse files Browse the repository at this point in the history
chore: updated readme
  • Loading branch information
MiracleUFO authored Sep 5, 2023
2 parents ef390a0 + 8a96d3d commit 4a1e16d
Show file tree
Hide file tree
Showing 16 changed files with 4,665 additions and 13,657 deletions.
19 changes: 14 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
},
alias: {
map: [['~', './src/']],
extensions: ['.ts', '.js', '.tsx'],
extensions: ['.ts', '.js', '.jsx', '.tsx'],
},
},
},
Expand All @@ -32,11 +32,20 @@ module.exports = {
'@typescript-eslint',
],
rules: {
"react/function-component-definition": [
2,
'no-plusplus': 'off',
'no-console': ['warn', { allow: ['error', 'warn'] }],
'import/extensions': ['error', {
ts: 'never',
tsx: 'never',
js: 'never',
jsx: 'never',
}],
'react/jsx-filename-extension': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: "arrow-function" | "function-expression" | "function-declaration",
unnamedComponents: "arrow-function" | "function-expression" | "function-declaration",
namedComponents: ['function-declaration', 'arrow-function'],
unnamedComponents: 'arrow-function',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ jobs:
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: false
DEFAULT_BRANCH: "main"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_MARKDOWN: false
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A modern, *free*, *lightweight* npm package for translating react apps (pages an
- Spelling and Language correction
- Fast and reliable – it uses the same servers that [translate.google.com](https://translate.google.com) uses
- Allows to set defualt language and destination language in code.
- Translates entires pages and just text.
- Translates entire pages and just text.
- Allows for custom language list files. (Coming in v2.0.0)

## Install
Expand All @@ -21,8 +21,8 @@ or with yarn
## Usage

### To translate whole component:
```jsx (index.jsx)
import Translator from 'react-auto-translate';
```jsx
import Translator from 'react-g-translate';

return (
<Translator
Expand All @@ -36,7 +36,7 @@ return (

### To translate specific text inline:
```jsx
import { Translate } from 'react-auto-translate';
import { Translate } from 'react-g-translate';

return (
<div>
Expand All @@ -51,7 +51,7 @@ return (
### To change to and from props dynamically:
Overrides `to` and `from` of the <Translator> and <Translate> wrappers across the app (*Use with care*).
```jsx
import { useTranslate } from 'react-auto-translate';
import { useTranslate } from 'react-g-translate';

const { setLanguageFrom, setLanguageTo } = useTranslate();

Expand All @@ -67,7 +67,7 @@ return (
### To get translation of text directly:
```jsx
import { useTranslate } from 'react-auto-translate';
import { useTranslate } from 'react-g-translate';

const { translate } = useTranslate();
const helloInIgbo = translate('Hello', 'en', 'ig');
Expand Down
1 change: 0 additions & 1 deletion babel.config.js

This file was deleted.

Loading

0 comments on commit 4a1e16d

Please sign in to comment.