Skip to content

Commit

Permalink
feat: common weather data
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Jan 21, 2024
1 parent 6ff12e0 commit 1d2eaca
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 153 deletions.
1 change: 1 addition & 0 deletions libs/data/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './crops';
export * from './days';
export * from './months';
export * from './weather';
17 changes: 17 additions & 0 deletions libs/data/weather.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// List of permissable weather names with labels
enum WeatherNameLabels {
clear = 'Clear',
cloudy = 'Cloudy',
rain_low = 'Light Rain',
rain_medium = 'Rain',
rain_high = 'Heavy Rain',
}

// Extract list of available weather names
type IWeatherName = keyof typeof WeatherNameLabels;

export const WEATHER_DATA = Object.entries(WeatherNameLabels).map(([name, label]) => ({
name: name as IWeatherName,
label,
icon: `assets/svgs/weather/${name}.svg`,
}));
24 changes: 10 additions & 14 deletions libs/i18n/assets/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
"build housing": "•build housing•",
"Calculated by using FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station.": "•Calculated by using FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station.•",
"Calculated with the date range of Start of rains and End of the rains": "•Calculated with the date range of Start of rains and End of the rains•",
"Calendar Lists": "•Calendar Lists•",
"Calendar Time": "•Calendar Time•",
"Calender name": "•Calender name•",
"Cancel": "•Cancel•",
"Capacity of 100mm on 1st March reduces 0.5 with evaporation rate of 5mm per day": "•Capacity of 100mm on 1st March reduces 0.5 with evaporation rate of 5mm per day•",
"Cassava": "•Cassava•",
"Categories": "•Categories•",
"cattle": "•cattle•",
"Chance of receiving the water requirement in the days to maturity for this crop variety": "•Chance of receiving the water requirement in the days to maturity for this crop variety•",
"Chart": "•Chart•",
"chemicals": "•chemicals•",
"chicken": "•chicken•",
"Clear": "•Clear•",
"Click on the button below to retry": "•Click on the button below to retry•",
"Climate": "•Climate•",
"Close": "•Close•",
"Cloudy": "•Cloudy•",
"Collection not found": "•Collection not found•",
"Collections": "•Collections•",
"Compare different options and plans": "•Compare different options and plans•",
Expand All @@ -66,18 +66,16 @@
"Cotton": "•Cotton•",
"Cowpeas": "•Cowpeas•",
"cowpeas": "•cowpeas•",
"Create Calendar": "•Create Calendar•",
"Create calender ": "•Create calender •",
"Create New": "•Create New•",
"Create New Budget": "•Create New Budget•",
"Create new calender": "•Create new calender•",
"Crop": "•Crop•",
"crop": "•crop•",
"Crop Info": "•Crop Info•",
"Crop Information": "•Crop Information•",
"Crop probabilities depend on when the season starts.\nHere you can see the probabilities of the season starting at different dates": "•Crop probabilities depend on when the season starts.\nHere you can see the probabilities of the season starting at different dates•",
"Crop water requirement (mm)": "•Crop water requirement (mm)•",
"Crops": "•Crops•",
"Crops Seasonal calender": "•Crops Seasonal calender•",
"Days": "•Days•",
"Days to maturity": "•Days to maturity•",
"Dec": "•Dec•",
Expand All @@ -101,8 +99,8 @@
"End": "•End•",
"End of Season": "•End of Season•",
"End of season is defined as the last day in the season (1st October - 30th April) with more than 10mm of rainfall.": "•End of season is defined as the last day in the season (1st October - 30th April) with more than 10mm of rainfall.•",
"Enter the selected month's weather condition": "•Enter the selected month's weather condition•",
"Enterprise": "•Enterprise•",
"Example Calendar": "•Example Calendar•",
"Extension": "•Extension•",
"Extra information": "•Extra information•",
"Extreme": "•Extreme•",
Expand Down Expand Up @@ -138,6 +136,7 @@
"guinea fowl": "•guinea fowl•",
"Harvesting": "•Harvesting•",
"harvesting": "•harvesting•",
"Heavy Rain": "•Heavy Rain•",
"Here we can see information for a specific crop variety": "•Here we can see information for a specific crop variety•",
"Hide Options": "•Hide Options•",
"High": "•High•",
Expand Down Expand Up @@ -169,6 +168,7 @@
"Length": "•Length•",
"Length of Season": "•Length of Season•",
"Length of season is defined as the total days from the start of the season until the end of the season as defined": "•Length of season is defined as the total days from the start of the season until the end of the season as defined•",
"Light Rain": "•Light Rain•",
"Line": "•Line•",
"Links": "•Links•",
"Livelihood Info": "•Livelihood Info•",
Expand Down Expand Up @@ -208,12 +208,12 @@
"New Budget": "•New Budget•",
"New Profile": "•New Profile•",
"Next": "•Next•",
"No available calendars": "•No available calendars•",
"No outputs produce for consumption": "•No outputs produce for consumption•",
"No saved calendars": "•No saved calendars•",
"Nov": "•Nov•",
"November": "•November•",
"Now you are ready to explore the crop information tool": "•Now you are ready to explore the crop information tool•",
"Number of Months Needed": "•Number of Months Needed",
"Number of Months": "•Number of Months•",
"Oct": "•Oct•",
"October": "•October•",
"onions": "•onions•",
Expand All @@ -231,8 +231,7 @@
"Pigeon Peas": "•Pigeon Peas•",
"pigeon peas": "•pigeon peas•",
"pigs": "•pigs•",
"Please enter the required number of months": "•Please enter the required number of months•",
"Please select a start month": "•Please select a start month•",
"Please add the calender title": "•Please add the calender title•",
"ploughing": "•ploughing•",
"post-harvest handling": "•post-harvest handling•",
"pot for storage": "•pot for storage•",
Expand Down Expand Up @@ -271,8 +270,8 @@
"Save": "•Save•",
"Save your budget": "•Save your budget•",
"Saved Budgets": "•Saved Budgets•",
"Saved Calendars": "•Saved Calendars•",
"Season Crops": "•Season Crops•",
"Season of 85": "•Season of 85•",
"Seasonal Calendar": "•Seasonal Calendar•",
"Seasonal forecast": "•Seasonal forecast•",
"Seasonal Rainfall": "•Seasonal Rainfall•",
Expand All @@ -287,7 +286,6 @@
"Select Country": "•Select Country•",
"Select Enterprise": "•Select Enterprise•",
"Select Language": "•Select Language•",
"Select start month": "•Select start month•",
"Sep": "•Sep•",
"September": "•September•",
"Share": "•Share•",
Expand Down Expand Up @@ -365,7 +363,6 @@
"Tuesday": "•Tuesday•",
"Type": "•Type•",
"Type other activity": "•Type other activity•",
"Update Crops": "•Update Crops•",
"vaccinate": "•vaccinate•",
"vaccine": "•vaccine•",
"value addition": "•value addition•",
Expand All @@ -378,7 +375,6 @@
"Weeding": "•Weeding•",
"weeding": "•weeding•",
"Weeks": "•Weeks•",
"wet,dry...": "•wet,dry...•",
"What are the opportunities and risks?": "•What are the opportunities and risks?•",
"What are the options for the farmer?": "•What are the options for the farmer?•",
"What are the probabilities and risks?": "•What are the probabilities and risks?•",
Expand Down
28 changes: 12 additions & 16 deletions libs/i18n/assets/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@
"Length": "Length",
"Length of Season": "Length of Season",
"Length of season is defined as the total days from the start of the season until the end of the season as defined": "Length of season is defined as the total days from the start of the season until the end of the season as defined",
"Rain": "Rain",
"Seasonal Rainfall": "Seasonal Rainfall",
"Seasonal Total Rainfall (mm)": "Seasonal Total Rainfall (mm)",
"Seasonal rainfall is defined as the total rain recorded from the start of the season until the end of the season": "Seasonal rainfall is defined as the total rain recorded from the start of the season until the end of the season",
Expand Down Expand Up @@ -226,6 +225,11 @@
"Oct": "Oct",
"Nov": "Nov",
"Dec": "Dec",
"Clear": "Clear",
"Cloudy": "Cloudy",
"Heavy Rain": "Heavy Rain",
"Light Rain": "Light Rain",
"Rain": "Rain",
"All": "All",
"Calculated by using FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station.": "Calculated by using FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station.",
"Chance of receiving the water requirement in the days to maturity for this crop variety": "Chance of receiving the water requirement in the days to maturity for this crop variety",
Expand Down Expand Up @@ -362,32 +366,24 @@
"Type": "Type",
"Add": "Add",
"Add Activity": "Add Activity",
"Calendar Lists": "Calendar Lists",
"Calendar Time": "Calendar Time",
"Calender name": "Calender name",
"Categories": "Categories",
"Create Calendar": "Create Calendar",
"Create calender ": "Create calender ",
"Create new calender": "Create new calender",
"Crops": "Crops",
"Crops Seasonal calender": "Crops Seasonal calender",
"Drying": "Drying",
"Enter the selected month's weather condition": "Enter the selected month's weather condition",
"Example Calendar": "Example Calendar",
"Extra information": "Extra information",
"Harvesting": "Harvesting",
"No available calendars": "No available calendars",
"Number of Months Needed": "Number of Months Needed",
"No saved calendars": "No saved calendars",
"Number of Months": "Number of Months",
"Other": "Other",
"Please enter the required number of months": "Please enter the required number of months",
"Please select a start month": "Please select a start month",
"Please add the calender title": "Please add the calender title",
"Preparation": "Preparation",
"Saved Calendars": "Saved Calendars",
"Season Crops": "Season Crops",
"Season of 85": "Season of 85",
"Select Activity": "Select Activity",
"Select start month": "Select start month",
"Start Month ": "Start Month ",
"Type other activity": "Type other activity",
"Update Crops": "Update Crops",
"Weeding": "Weeding",
"weather condition": "weather condition",
"wet,dry...": "wet,dry..."
"weather condition": "weather condition"
}
24 changes: 10 additions & 14 deletions libs/i18n/assets/mw_ny.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
"build housing": "kumanga makola",
"Calculated by using FAO CLIMWAT 2.0 for Cropwat and Cropwat 8.0 and climate data for Nkhotakota Met Station.": "Kuwerengeredwa pogwiritsa ntchito FAO CLIMWAT 2.0 ya Cropwat ndi Cropwat 8.0 ndi uthenga wa zanyengo ya Nkhotakota Met Station.",
"Calculated with the date range of Start of rains and End of the rains": "•Calculated with the date range of Start of rains and End of the rains•",
"Calendar Lists": "•Calendar Lists•",
"Calendar Time": "•Calendar Time•",
"Calender name": "•Calender name•",
"Cancel": "thetsani",
"Capacity of 100mm on 1st March reduces 0.5 with evaporation rate of 5mm per day": "•Capacity of 100mm on 1st March reduces 0.5 with evaporation rate of 5mm per day•",
"Cassava": "Chinangwa",
"Categories": "•Categories•",
"cattle": "ng'ombe",
"Chance of receiving the water requirement in the days to maturity for this crop variety": "Mwayi olandira madzi amene mbewu imafunikira mu masiku amene mbewu imatenga kuti ikhwime pa mbewu zosiyanasiyana",
"Chart": "Galafu",
"chemicals": "mankhwala",
"chicken": "nkhuku",
"Clear": "•Clear•",
"Click on the button below to retry": "dinani pa batani pansipa kuti muyesenso",
"Climate": "Nyengo",
"Close": "Tsekani",
"Cloudy": "•Cloudy•",
"Collection not found": "Kutolera sizikupezeka",
"Collections": "•Collections•",
"Compare different options and plans": "Siyanitsani zisankho ndi ma pulani osiyanasiyana",
Expand All @@ -66,18 +66,16 @@
"Cotton": "•Cotton•",
"Cowpeas": "•Cowpeas•",
"cowpeas": "khobwe",
"Create Calendar": "•Create Calendar•",
"Create calender ": "•Create calender •",
"Create New": "•Create New•",
"Create New Budget": "Pangani bajeti yatsopano",
"Create new calender": "•Create new calender•",
"Crop": "•Crop•",
"crop": "mbewu",
"Crop Info": "Zokhudza mbeu",
"Crop Information": "•Crop Information•",
"Crop probabilities depend on when the season starts.\nHere you can see the probabilities of the season starting at different dates": "•Crop probabilities depend on when the season starts.\nHere you can see the probabilities of the season starting at different dates•",
"Crop water requirement (mm)": "Kuchuluka kwa madzi amene mbewu imafuna",
"Crops": "•Crops•",
"Crops Seasonal calender": "•Crops Seasonal calender•",
"Days": "Masiku",
"Days to maturity": "Masiku omwe zimatenga kuti ziche",
"Dec": "•Dec•",
Expand All @@ -101,8 +99,8 @@
"End": "Pothera",
"End of Season": "Mapeto a nyengo",
"End of season is defined as the last day in the season (1st October - 30th April) with more than 10mm of rainfall.": "Mapeto a nyengo akutanthauza tsiku lomaliza mu nyengo (1 okotobala mpaka 30 epulo) lomwe kwagwa mvula yoposa 10mm",
"Enter the selected month's weather condition": "•Enter the selected month's weather condition•",
"Enterprise": "bizinesi",
"Example Calendar": "•Example Calendar•",
"Extension": "Ulangizi",
"Extra information": "•Extra information•",
"Extreme": "•Extreme•",
Expand Down Expand Up @@ -138,6 +136,7 @@
"guinea fowl": "nkhanga",
"Harvesting": "•Harvesting•",
"harvesting": "kukolola",
"Heavy Rain": "•Heavy Rain•",
"Here we can see information for a specific crop variety": "•Here we can see information for a specific crop variety•",
"Hide Options": "Bisani Zipangizo",
"High": "•High•",
Expand Down Expand Up @@ -169,6 +168,7 @@
"Length": "kutalika",
"Length of Season": "Kutalika kwa nyengo",
"Length of season is defined as the total days from the start of the season until the end of the season as defined": "Lutalika kwa nyengo kutanthauza masiku onse kuyambira pachiyambi mpaka pamapeto a nyengo monga momwe zafotokozedwa",
"Light Rain": "•Light Rain•",
"Line": "Mzere",
"Links": "•Links•",
"Livelihood Info": "Zokhudza njira zopezera ndalama",
Expand Down Expand Up @@ -208,12 +208,12 @@
"New Budget": "•New Budget•",
"New Profile": "Mbiri yatsopano",
"Next": "pitani tsamba lina",
"No available calendars": "•No available calendars•",
"No outputs produce for consumption": "Palibe zokolora zomwe zagwiritsidwa (zadyedwa) ntchito pakhomo",
"No saved calendars": "•No saved calendars•",
"Nov": "•Nov•",
"November": "•November•",
"Now you are ready to explore the crop information tool": "•Now you are ready to explore the crop information tool•",
"Number of Months Needed": "•Number of Months Needed",
"Number of Months": "•Number of Months•",
"Oct": "•Oct•",
"October": "•October•",
"onions": "anyezi",
Expand All @@ -231,8 +231,7 @@
"Pigeon Peas": "•Pigeon Peas•",
"pigeon peas": "nandolo",
"pigs": "nkhumba",
"Please enter the required number of months": "•Please enter the required number of months•",
"Please select a start month": "•Please select a start month•",
"Please add the calender title": "•Please add the calender title•",
"ploughing": "kugalauza",
"post-harvest handling": "kusamala zokolora",
"pot for storage": "mphika wongula zinthu",
Expand Down Expand Up @@ -271,8 +270,8 @@
"Save": "sungani",
"Save your budget": "sungani bajeti yanu",
"Saved Budgets": "bajeti zosungidwa",
"Saved Calendars": "•Saved Calendars•",
"Season Crops": "•Season Crops•",
"Season of 85": "•Season of 85•",
"Seasonal Calendar": "Kalendala ya nyengo",
"Seasonal forecast": "ulosi wa nyengo",
"Seasonal Rainfall": "Mvula ya mu nyengo",
Expand All @@ -287,7 +286,6 @@
"Select Country": "Sankhani Dziko",
"Select Enterprise": "sankhani mtundu wa bizinezi",
"Select Language": "Sankhani chilankhulo",
"Select start month": "•Select start month•",
"Sep": "•Sep•",
"September": "•September•",
"Share": "tumizani",
Expand Down Expand Up @@ -365,7 +363,6 @@
"Tuesday": "Lachiwiri",
"Type": "•Type•",
"Type other activity": "•Type other activity•",
"Update Crops": "•Update Crops•",
"vaccinate": "kupereka katemela",
"vaccine": "katemera",
"value addition": "kuwonjezera phindu",
Expand All @@ -378,7 +375,6 @@
"Weeding": "•Weeding•",
"weeding": "kupalira",
"Weeks": "•Weeks•",
"wet,dry...": "•wet,dry...•",
"What are the opportunities and risks?": "•What are the opportunities and risks?•",
"What are the options for the farmer?": "Zisankho zomwe mulimi alinazo ndi ziti?",
"What are the probabilities and risks?": "Kodi kuthera koti zikhoza kuchitika komanso ziopzezo zake ndi ziti?",
Expand Down
Loading

0 comments on commit 1d2eaca

Please sign in to comment.