GithubHelp home page GithubHelp logo

omarsaggou / react-translator-i18next Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abdelhamidlarachi/react-translator-i18next

0.0 0.0 0.0 21 KB

open-source project made to auto translate react apps using i18next, this project should extract components text, translate, and replace it with i18n function, also it generates the json file for your target languages.

License: MIT License

TypeScript 100.00%

react-translator-i18next's Introduction

React-translator-i18next

GitHub license GitHub license

Open-Source project made to auto translate react apps using i18next, this project should extract, translate and replace your components texts, then generates the Json language file.

Works as follows :

  • Extract text from components / props / yup : nothing to write here, you can just go to the next part, so it feels like a description.
  • Convert JSX / TSX files to i18n hook : by replacing theses texts with your i18n hook function, adding imports, and initializing hooks.
  • Translate detected texts : deepl api was used for translating part, you just need to set your free api key on the .env file.
  • Generate JSON language file: it should generate the final json files for the languages you've selected.

Installation

React has been designed for gradual adoption from the start, and you can use as little or as much React as you need:

  • set your default project path in src/directory. Desktop/project by default ( don't forget to make a project copy ).
  • Run npm install then > npm start
  • Check your project/langs folder for json files
  • Your JSX / TSX files should be translated now.

Contributing

The main purpose of this repository is to continue evolving and to help lazy ass developers, we should expect a lot of bugs in this type of projects, so i invite you to contribute by creating a pull request or report issues.

Thanks for your support.

License

MIT licensed.

react-translator-i18next's People

Contributors

abdelhamidlarachi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.