question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nsMode global configuration option

See original GitHub issue

Did something change with 6.x? Formerly, I could pass multiple namespaces into translate and I could use them without prefixes, understanding that the first key found would win. Now it is not finding my key, but it will if I prefix it.

So, from the example in the docs:

function TranslatableView(props) {
  const { t } = props;
  return (
    <div>
      <h1>{t('keyFromDefault')}</h1>
      <p>{t('anotherNamespace:key.from.another.namespace', { /* options t options */ })}</p>
    </div>
  )
}

export default translate(['defaultNamespace', 'anotherNamespace'])(TranslatableView);

^^ works, but the following no longer does:

function TranslatableView(props) {
  const { t } = props;
  return (
    <div>
      <h1>{t('keyFromDefault')}</h1>
      <p>{t('key.from.another.namespace', { /* options t options */ })}</p>
    </div>
  )
}

export default translate(['defaultNamespace', 'anotherNamespace'])(TranslatableView);

This would state (something like my log message) translation missing 'key.from.another.namespace' for en 'defaultNamespace'. Am I missing a config option?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rosskevincommented, Oct 1, 2017

Thank you, this was my mistake.

I was looking here: https://www.i18next.com/configuration-options.html

And I should have been looking here: https://react.i18next.com/components/i18next-instance.html

I used the react addition to options and it works fine.

0reactions
jamuhlcommented, Oct 1, 2017

Just made a test: https://www.webpackbin.com/bins/-KvMK7GooEOLVwtqEzgq

app.js line 55 -> nsMode in translate options: works i18n.js line 40 -> nsMode in i18n options: works

(react-i18next@6.0.2)

Could you provide a webpackbin or more info where setting nsMode fails - seems i miss a case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: No Global Configuration Mode? - Cisco Community
I tried holding down the Mode button on reboot but it didn't seem to change anything. I'm just trying to gain access to...
Read more >
Enable Use Source IP Mode - Citrix Product Documentation
The USIP global setting applies only to services that are created after the USIP global setting is made. ... enable ns mode USIP....
Read more >
Using the Global Configuration Object - AWS SDK for JavaScript
There are two ways to configure the SDK: Set the global configuration using AWS.Config . Pass extra configuration information to a service object....
Read more >
Configuration - Node-RED
The following properties can be used to configure Node-RED. When running as a normal application, it loads its configuration from a settings file....
Read more >
21.4.3.1 NDB Cluster Configuration: Basic Example
Global configuration options are discussed later in this section. # my.cnf # example additions to my.cnf for NDB Cluster # (valid in MySQL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found