react-native-i18n
react-native-i18n copied to clipboard
missing en-US "" translation
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?