Package 'gtranslate'

Title: Translate Between Different Languages
Description: The goal of this package is to translate between different languages without any Google API authentication which is pain and you must pay for the key, This package is free and lightweight.
Authors: Mohamed El-Desouky [aut, cre]
Maintainer: Mohamed El-Desouky <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1
Built: 2024-10-31 16:33:33 UTC
Source: https://github.com/mohamed-180/gtranslate

Help Index


List of language codes

Description

This is the list of supported codes for languages included in gtranslate.

Usage

lang_codes

Format

An object of class list of length 133.

Author(s)

Google

References

https://cloud.google.com/translate/docs/languages


Translate between different languages

Description

Translate between different languages

Usage

translate(text, from = "auto", to = "ar", trim_str = TRUE)

Arguments

text

(character) vector of text to translate

from

(character) abbreviation to the input language code eg: "en" for English, by default it is "auto" for auto-detecting the input language.

to

(character) abbreviation to the output language code.

trim_str

(logical) indicating whether to trim the string if it is exceeds 5000 characters.

Value

(character) vector of translated input text.

Examples

translate("How are you?", from = "auto", to = "ar")