Added navigation to application, internationalization, and sign in screen.

This commit is contained in:
Patrick Fic
2020-08-11 16:42:26 -07:00
parent c7344dd7a2
commit 767233cea3
19 changed files with 1258 additions and 161 deletions

View 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"
}
}
}
}

View 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": ""
}
}
}
}

View 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
View 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;