npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-power-translator-react-18

v1.0.0

Published

A no-hassle way to use Google and Microsoft cloud translation services in react native.

Readme

Power Translator - A simple way to use cloud translation services

PowerTranslator gives you a no-hassle way to use Google and Microsoft cloud translation services in react native.

Power Translator Demo

An example of how to use it: Download Demo

Install

npm i react-native-power-translator --save

1. Import module

import { PowerTranslator, ProviderTypes, TranslatorConfiguration, TranslatorFactory } from 'react-native-power-translator';

2. Set PowerTranslator configuration

TranslatorConfiguration.setConfig('Provider_Type', 'Your_API_Key','Target_Language', 'Source_Language');

// Example
TranslatorConfiguration.setConfig(ProviderTypes.Google, 'xxxx','fr');

Note: The source of the language is optional, if you are not specify it, the provider will detect the language for you.

3. Add translation

There are a couple of ways to use this module based on different use case.

Use it as a component

<PowerTranslator text={'Engineering physics or engineering science refers to the study of the combined disciplines of physics'} />

Use it as a service/class The return value will be a promise that returns translated text.

const translator = TranslatorFactory.createTranslator();
translator.translate('Engineering physics or engineering science').then(translated => {
    //Do something with the translated text
});

You can also pass in an optional language parameter to translate to desire languagues (default use current config)

const translator = TranslatorFactory.createTranslator();
translator.translate('Engineering physics or engineering science', 'fr').then(translated => {
    //Do something with the translated text which would be in French
});

Complete reference

  • PowerTranslator: A react component to translate your texts.
  • ProviderTypes: List of the cloud provider types. There are two providers is available. ProviderTypes.Google for google translate and ProviderTypes.Microsoft for microsoft translator text cloud service.
  • TranslatorFactory: It creates a suitable translator instance, based on your configuration.
  • TranslatorConfiguration: It initializes and keeps the translator configuration.

Props list

Here is the list of props:

  • text: The text you need to translate. Required.
  • onTranslationStart: Get triggered when the text translation gets started.
  • onTranslationEnd: Get triggered when the text translation ends.
  • style: Styles for translated text. All the react native Text styles props are valid.

Inspiration on how to use it

A few use cases that is possible to cover with this module.

  • As a fallback translation: In case your primary translation service/library failed for some reason. It is possible to use the cloud service next to your translation service/library as a fallback.
  • As a quick solution: Build a translation service from scratch is not easy and quick. If you don't want to invest in building one, the cloud APIs can save you a huge amount of time.

Cloud service API keys

To get Google translator api key, visit here To get Microsoft azure translator api key, visit here