0.2.17 • Published 1 year ago

use-language-next v0.2.17

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

useLanguageNext

Quick and easy translation of your next.js applications

Installation

npm i use-language-next

Usage/Examples

import useLanguage from 'use-language-next'

function App() {
  const { handleLanguage } = useLanguage()

  return (
      <p>
        {handleLanguage({
            'es-MX': 'Hola Mundo', 
            'en-US': 'Hello World',
            'fr': 'Bonjour Monde'
        })}
      </p>
  )
}

The key you must use is the same as the one you configured in the i18 of the next.config

module.exports = {
  i18n: {
    locales: ['en-US', 'es-MX' , 'fr'], //Use this values for key in handleLanguage parameters
    defaultLocale: 'en-US',
  },
}
0.2.17

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago