traduxpress
v1.0.8
Published
Downloads
8
Readme
TraduxPress
TraduXpress is a simple npm package that provides translation functionality using the MyMemory Translation Memory API. It allows you to easily translate a given term into a specified language or the language of the user's browser.
Installation
To install TraduXpress, use the following npm command:
npm install traduxpress
Usage
const traduxpress = require('traduxpress');
// Example Usage
async function translateTerm() {
try {
const result = await traduxpress({ term: 'Hello man how are u today ?', lang: 'es' });
console.log(result);
} catch (error) {
console.error('Unexpected translation error:', error);
}
}
translateTerm();
Ememple of code works with
https://codepen.io/failaxite/pen/BabzrjM
API Reference
traduxpress(options)
options (Object):
Options for translation.
term (string):
The term to translate.
lang (string, optional):
The language to translate the term into. If not specified, it uses the language of the user's browser.
Returns a Promise resolving to the translated text.
Configuration
TraduXpress uses the MyMemory Translation Memory API for translation. You need to provide your RapidAPI key in the traductFunction
function in the traduction.js
file.
Tests
Run tests using the following command:
npm test
License
This project is licensed under the MIT License - see the LICENSE file for details.
Issues
Please report any issues or suggestions on the GitHub Issues page.
Author
Version
- Current version: 1.0.6
Links
Contributing
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.
Badges
Add badges from somewhere like: shields.io