0.1.3 • Published 1 year ago

react-native-language-translations v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-language-translation

This library help you to translate easy in 50 languages and its easy to use

Installation

npm install react-native-language-translations

Make sure to build project again after installing the dependency

DEMO

Screenrecorder-2023-03-05-13-21

Modal Download

Screenrecorder-2023-03-04-23-24

Usage

This package first downloads the modal which you want to use for that you have to call a method createLanguageTranslator giving parameters as languages codes.

import {
  createLanguageTranslator,
  translate,
  getAllLanguages,
} from 'react-native-language-translations';
 // english to chinese
 const t = (text: string) => {
    createLanguageTranslator('en', 'zh', () => {
      translate(text, (result: string) => {
        setResult(result);
      });
    });
  };

   getAllLanguages((val: String) => {
      console.log(val);
      let langVal = [];
     
      Object.keys(val).forEach((i) => langVal.push(i));
    });

// ...
ParameterTypeDescriptioniOSAndroid
createLanguageTranslatorFunctionDownloads the trasnlator modal just pass to and from language codeX
translateFunctionused too translate textX

| getAllLanguages | Function | returns all the supported languages | X | ✔ |

Contributing

License

MIT


0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago