Added navigation to application, internationalization, and sign in screen.
This commit is contained in:
36
translations/en-US/common.json
Normal file
36
translations/en-US/common.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"translation": {
|
||||
"general": {
|
||||
"actions": {
|
||||
"signout": "Sign Out"
|
||||
}
|
||||
},
|
||||
"joblist": {
|
||||
"labels": {
|
||||
"activejobs": "All Active Jobs"
|
||||
},
|
||||
"titles": {
|
||||
"jobtab": "Jobs"
|
||||
}
|
||||
},
|
||||
"messaging": {
|
||||
"titles": {
|
||||
"messagingtab": "Messaging"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"titles": {
|
||||
"settings": "Settings"
|
||||
}
|
||||
},
|
||||
"signin": {
|
||||
"actions": {
|
||||
"signin": "Sign In"
|
||||
},
|
||||
"fields": {
|
||||
"email": "Email",
|
||||
"password": "Password"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
translations/es-MX/common.json
Normal file
36
translations/es-MX/common.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"translation": {
|
||||
"general": {
|
||||
"actions": {
|
||||
"signout": ""
|
||||
}
|
||||
},
|
||||
"joblist": {
|
||||
"labels": {
|
||||
"activejobs": ""
|
||||
},
|
||||
"titles": {
|
||||
"jobtab": ""
|
||||
}
|
||||
},
|
||||
"messaging": {
|
||||
"titles": {
|
||||
"messagingtab": ""
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"titles": {
|
||||
"settings": ""
|
||||
}
|
||||
},
|
||||
"signin": {
|
||||
"actions": {
|
||||
"signin": ""
|
||||
},
|
||||
"fields": {
|
||||
"email": "Email",
|
||||
"password": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
translations/fr-CA/common.json
Normal file
36
translations/fr-CA/common.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"translation": {
|
||||
"general": {
|
||||
"actions": {
|
||||
"signout": ""
|
||||
}
|
||||
},
|
||||
"joblist": {
|
||||
"labels": {
|
||||
"activejobs": ""
|
||||
},
|
||||
"titles": {
|
||||
"jobtab": ""
|
||||
}
|
||||
},
|
||||
"messaging": {
|
||||
"titles": {
|
||||
"messagingtab": ""
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"titles": {
|
||||
"settings": ""
|
||||
}
|
||||
},
|
||||
"signin": {
|
||||
"actions": {
|
||||
"signin": ""
|
||||
},
|
||||
"fields": {
|
||||
"email": "Email",
|
||||
"password": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
46
translations/i18n.js
Normal file
46
translations/i18n.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import Localization from "expo-localization";
|
||||
import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import en_Translation from "./en-US/common.json";
|
||||
import es_Translation from "./es-MX/common.json";
|
||||
import fr_Translation from "./fr-CA/common.json";
|
||||
|
||||
// the translations
|
||||
// (tip move them in a JSON file and import them)
|
||||
const resources = {
|
||||
"en-US": en_Translation,
|
||||
"fr-CA": fr_Translation,
|
||||
"es-MX": es_Translation,
|
||||
};
|
||||
|
||||
// creating a language detection plugin using expo
|
||||
// http://i18next.com/docs/ownplugin/#languagedetector
|
||||
const languageDetector = {
|
||||
type: "languageDetector",
|
||||
async: true, // flags below detection to be async
|
||||
detect: (callback) => {
|
||||
return Localization.getLocalizationAsync().then(({ locale }) => {
|
||||
callback(locale);
|
||||
});
|
||||
},
|
||||
init: () => {},
|
||||
cacheUserLanguage: () => {},
|
||||
};
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
lng: "en-US",
|
||||
fallbackLng: "en-US",
|
||||
resources,
|
||||
// have a common namespace used around the full app
|
||||
// ns: ["common"],
|
||||
// defaultNS: "common",
|
||||
debug: true,
|
||||
// cache: {
|
||||
// enabled: true
|
||||
// },
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it does escape per default to prevent xss!
|
||||
},
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Reference in New Issue
Block a user