react-native-i18n icon indicating copy to clipboard operation
react-native-i18n copied to clipboard

missing en-US "" translation

Open Xplosive06 opened this issue 1 year ago • 1 comments

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?

Xplosive06 avatar Aug 25 '22 08:08 Xplosive06