React-i18next: returned an object instead of string

Created on 6 Apr 2020  ·  5Comments  ·  Source: i18next/react-i18next

Question about react-i18next

en.js

export default {
  message: {
    copyright: '2019 - Designed and developed by Linxu'
  }
}
{t('message')}
{t('message.copyright')}

How to get the value of an object?

Most helpful comment

use returnObjects in the options: https://www.i18next.com/translation-function/essentials#overview-options

All 5 comments

please at least read the docs or look at the examples...before guessing how it should work...

@jamuhl The documentation does not seem to describe the useage of key as object

use returnObjects in the options: https://www.i18next.com/translation-function/essentials#overview-options

@adrai thanks

If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.

If you liked my support / work - I would enjoy a coffee sponsored using the “💜Sponsor Button”.

There are many ways to help this project 🙏

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChCosmin picture ChCosmin  ·  4Comments

leandrocamacho picture leandrocamacho  ·  4Comments

flq picture flq  ·  4Comments

ok2ju picture ok2ju  ·  3Comments

aniket-dalvi picture aniket-dalvi  ·  4Comments