1.0.63 • Published 2 years ago

vitra-auth-npm-pack v1.0.63

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Translate Website (Web Translator)

A website translation sdk from Vitra.ai

Logo

Installation

Install with npm

  npm i vitra-auth-npm-pack

Usage/Examples

Import css file in _app.tsx

import 'vitra-web-translator/dist/esm/styles/index.css';
import type { AppProps } from 'next/app';

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <Component {...pageProps} />
    </>
  );
}

Create a Common Component

import React, { FC, ReactNode } from 'react';
import { VitraWebTranslator } from 'vitra-web-translator';

type Props = {
  children: ReactNode,
};

const Layout: FC<Props> = ({ children }) => {
  return (
    <VitraWebTranslator
      apiKey="vitra.VjopflOAtjF9coT7U3_*********_*"
      glossaryId="*************"
      position="center-right"
      theme="dark"
    >
      {children}
    </VitraWebTranslator>
  );
};

export default Layout;

Use the common component anywhere in your app

import React from 'react';
import Layout from './Layout';

const Demo = () => {
  return (
    <Layout>
      <h1>This is a demo component</h1>
    </Layout>
  );
};

export default Demo;

Props

PropTypeRequiredDescriptionPossible ValuesDefault
apiKeystringYesAPI Key generated from Vitra Web Translator siteAPI KEYnull
glossaryIdstringYesGlossary Id generated from Vitra Web Translator siteGLOSSARY IDnull
themestringYesTheme of the language selector'dark' | 'blue' | 'pink' | 'yellow'dark
positionstringYesPosition of the language selector dropdown if it is floating'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center-center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right''center-right'

Support

For support, email support@vitra.ai.

1.0.49

2 years ago

1.0.62

2 years ago

1.0.51

2 years ago

1.0.61

2 years ago

1.0.50

2 years ago

1.0.60

2 years ago

1.0.55

2 years ago

1.0.54

2 years ago

1.0.53

2 years ago

1.0.63

2 years ago

1.0.52

2 years ago

1.0.59

2 years ago

1.0.58

2 years ago

1.0.47

2 years ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago