Skip to content

Commit

Permalink
feat: added Haitian Creole translation 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
hopetambala committed Mar 3, 2021
1 parent f2296b9 commit 9a2479e
Show file tree
Hide file tree
Showing 8 changed files with 453 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const HouseholdManager = (props) => {
]);
const [relationship, setRelationship] = useState('');
const [selectPerson, setSelectPerson] = useState();
// const [, setHouseholdRelationship] = useState();
const [modalView, setModalView] = useState('unset');
const [householdSet, setHouseholdSet] = useState(false);

Expand Down
3 changes: 3 additions & 0 deletions components/LanguagePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const languages = [
},
{
key: 'es', label: I18n.t('languagePicker.spanish')
},
{
key: 'hk', label: I18n.t('languagePicker.creole')
}
];

Expand Down
13 changes: 8 additions & 5 deletions domains/Auth/SignIn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@ import {
import * as yup from 'yup';

import BlackLogo from '../../../assets/graphics/static/Logo-Black.svg';

import FormInput from '../../../components/FormikFields/FormInput';
import LanguagePicker from '../../../components/LanguagePicker';
import TermsModal from '../../../components/TermsModal';

import { deleteData, getData, storeData } from '../../../modules/async-storage';
import { populateCache } from '../../../modules/cached-resources';
import I18n from '../../../modules/i18n';
import checkOnlineStatus from '../../../modules/offline';
import { theme } from '../../../modules/theme';

import { retrieveSignInFunction } from '../../../services/parse/auth';

import CredentialsModal from './CredentialsModal';
import ForgotPassword from './ForgotPassword';

// components/FormikFields/PaperInputPicker';
const validationSchema = yup.object().shape({
username: yup
.string()
Expand Down Expand Up @@ -71,8 +74,8 @@ const SignIn = ({ navigation }) => {
Alert.alert(
I18n.t('signIn.unableLogin'),
I18n.t('signIn.usernamePasswordIncorrect'), [
{ text: 'OK' }
],
{ text: 'OK' }
],
{ cancelable: true }
);
};
Expand Down Expand Up @@ -243,8 +246,8 @@ const SignIn = ({ navigation }) => {
{formikProps.isSubmitting ? (
<ActivityIndicator />
) : (
<Button mode="contained" theme={theme} style={styles.submitButton} onPress={formikProps.handleSubmit}>{I18n.t('signIn.login')}</Button>
)}
<Button mode="contained" theme={theme} style={styles.submitButton} onPress={formikProps.handleSubmit}>{I18n.t('signIn.login')}</Button>
)}
<CredentialsModal
modalVisible={modalVisible}
formikProps={formikProps}
Expand Down
32 changes: 18 additions & 14 deletions domains/DataCollection/Assets/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import React from 'react';
import { View } from 'react-native';
import { Keyboard, TouchableWithoutFeedback, View } from 'react-native';


import NewAssets from './NewAssets';
import ViewAssets from './ViewAssets';

const Assets = ({
selectedAsset, setSelectedAsset, surveyingOrganization
// navigateToNewAssets, navigateToViewAllAssets
}) => (
<View>
{selectedAsset && (
<NewAssets
setSelectedAsset={setSelectedAsset}
selectedAsset={selectedAsset}
surveyingOrganization={surveyingOrganization}
/>
)}
{selectedAsset === null && (
<ViewAssets />
)}
</View>
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<View>
{selectedAsset && (
<NewAssets
setSelectedAsset={setSelectedAsset}
selectedAsset={selectedAsset}
surveyingOrganization={surveyingOrganization}
/>
)}
{selectedAsset === null && (
<ViewAssets
organization={surveyingOrganization}
/>
)}
</View>
</TouchableWithoutFeedback>
);

export default Assets;
9 changes: 6 additions & 3 deletions modules/i18n/english/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"city": "City",
"commName": "Community Name",
"notes": "Notes",
"refresh": "Refresh"
"refresh": "Refresh",
"emptyForm": "Empty Form"
},
"signUp": {
"firstName": "First Name",
Expand Down Expand Up @@ -288,7 +289,8 @@
"attachResident": "Attach a Community Resident"
},
"assetForms": {
"attachForm": "Attach a Form to the Asset"
"attachForm": "Attach a Form to the Asset",
"createAsset": "Create an Asset"
},
"forms": {
"successfullySubmitted": "Form successfully submitted",
Expand Down Expand Up @@ -399,7 +401,8 @@
},
"languagePicker": {
"english": "English",
"spanish": "Spanish"
"spanish": "Spanish",
"creole": "Haitian Creole"
},
"residentIdSearchbar": {
"searchIndividual": "Search Individual"
Expand Down
3 changes: 3 additions & 0 deletions modules/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import I18n from 'i18n-js';

import english from './english/en.json';
import spanish from './spanish/es.json';
import haitian from './kreyol/hk.json';


I18n.translations = {
en: english,
es: spanish,
hk: haitian
};

I18n.locale = Localization.locale;
Expand Down
Loading

0 comments on commit 9a2479e

Please sign in to comment.