Exorth98 / react-native-translation

A Npm package providing to React Native developers an easy and flexible tool for translating their app in other languages.
https://www.npmjs.com/package/react-native-translation
MIT License
13 stars 4 forks source link

No exported function getTranslation #4

Open igortas opened 4 years ago

igortas commented 4 years ago

Hi,

Why there is no exported function getTranslation with version 1.1.0?

Br,

Exorth98 commented 4 years ago

Hi,

Why there is no exported function getTranslation with version 1.1.0?

Br,

Hello!

The package is up to date with the repository like you can see here. The export exists, here which is imported from here.

I just tested the import and the function on a expo snack and it works fine.

Maybe it is related to something else? I'm sorry but I'm not sure to know how to help you on that, never encountered the issue before.

Please let me know if I can help you more.

igortas commented 4 years ago

I'm using typescript with react native, so in index.d.ts, the export does not exists, I've added manually those functions I needed...

Some of the core library versions are:

react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",

This is how the index.d.ts looks like without the exported functions, which I have issues:

import { LanguageProvider, TransText, AnimatedTransText } from './LanguageProvider';
import React from 'react';

type Dictionary = Object | string

interface ILanguageProviderProps {
    defaultLanguage?: string;
    translations?: Object;
    language: string;
}

interface ITransTextProps {
    dictionary: Dictionary;
    values?: Object;
}

interface IAnimatedTransTextProps {
    dictionary: Dictionary;
    values?: Object;
}

export const LanguageProvider: React.SFC<ILanguageProviderProps>;
export const TransText: React.SFC<ITransTextProps>;
export const AnimatedTransText: React.SFC<IAnimatedTransTextProps>;