Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing en-US "" translation #295

Open
Xplosive06 opened this issue Aug 25, 2022 · 1 comment
Open

missing en-US "" translation #295

Xplosive06 opened this issue Aug 25, 2022 · 1 comment

Comments

@Xplosive06
Copy link

I've followed the doc and just added one function, but I'm always getting: [missing "fr-US.strategiesScreen_all" translation] or [missing "en-US.strategiesScreen_all" translation] etc ...

My component:

import React from "react";
import { Text } from "react-native";

import { getI18n } from "../i18n/i18n";

export default function StrategiesScreen() {
  const i18name = "strategiesScreen_";

  return <Text>{getI18n(i18name + "all")}</Text>;
}

i18n.js:

import I18n from 'react-native-i18n';
import en from './locales/en';
import fr from './locales/fr';
import es from './locales/es';

I18n.fallbacks = true;

I18n.translations = {
  en,
  fr,
};

export function getI18n(i18name, i18nTrad) {
  return I18n.t(i18name + i18nTrad);
}

en.js

export default {
  strategiesScreen_all: 'All',
};

fr.js

export default {
  strategiesScreen_all: 'Tous',
};

All my paths are good, I'm able to log my en.js or fr.js files.

What am doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Xplosive06 and others