Skip to content

Commit b1b7843

Browse files
authored
Merge pull request #3508 from LiteFarmOrg/patch/translations
Patch/3.6.8
2 parents 191024b + 22adeb8 commit b1b7843

File tree

142 files changed

+9169
-2485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+9169
-2485
lines changed

.github/workflows/automated_tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ on:
44
pull_request:
55
branches:
66
- integration
7+
- "patch/**"
78

89
jobs:
910
automated_tests:
1011
runs-on: ubuntu-20.04
11-
container: node:16.15.0
12+
container: node:18.16.1
1213
services:
1314
postgres:
1415
image: postgres:13

packages/api/babel.config.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
],
1111
"plugins": [
1212
"transform-es2015-modules-commonjs",
13-
"babel-plugin-transform-import-meta"
13+
"babel-plugin-transform-import-meta",
14+
"@babel/plugin-syntax-import-assertions"
1415
]
1516
}

packages/api/package-lock.json

Lines changed: 5956 additions & 498 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "litefarm-api",
3-
"version": "3.6.7",
3+
"version": "3.6.8",
44
"description": "LiteFarm API server",
55
"main": "./api/src/server.js",
66
"type": "module",

packages/api/src/controllers/managementPlanController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const managementPlanController = {
5858
const managementPlanGraph = await ManagementPlanModel.query(trx)
5959
.where('management_plan_id', management_plan_id)
6060
.withGraphFetched(
61-
'crop_management_plan.[planting_management_plans.[managementTasks.[task.[pest_control_task, irrigation_task, scouting_task, soil_task, soil_amendment_task, soil_amendment_task_products.[purpose_relationships], field_work_task, harvest_task, cleaning_task, locationTasks]], plant_task.[task.[locationTasks]], transplant_task.[task.[locationTasks]], bed_method, container_method, broadcast_method, row_method]]',
61+
'crop_management_plan.[planting_management_plans.[managementTasks.[task.[pest_control_task, irrigation_task, scouting_task, soil_task, soil_amendment_task, soil_amendment_task_products(filterDeleted).[purpose_relationships], field_work_task, harvest_task, cleaning_task, locationTasks]], plant_task.[task.[locationTasks]], transplant_task.[task.[locationTasks]], bed_method, container_method, broadcast_method, row_method]]',
6262
)
6363
.modifyGraph(
6464
'crop_management_plan.[planting_management_plans.managementTasks]',

packages/api/src/controllers/sensorController.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ import knex from '../util/knex.js';
4343
const getSensorTranslations = async (language) => {
4444
// Remove country identifier from language preference
4545
const parsedLanguage = language.includes('-') ? language.split('-')[0] : language;
46-
let translations = await import(`../../../shared/locales/${parsedLanguage}/sensorCSV.json`, {
47-
assert: { type: 'json' },
48-
});
49-
// Default to english in case where user language not supported
50-
if (!translations) {
46+
let translations;
47+
try {
48+
translations = await import(`../../../shared/locales/${parsedLanguage}/sensorCSV.json`, {
49+
assert: { type: 'json' },
50+
});
51+
// Default to english in case where user language not supported
52+
if (!translations) {
53+
throw 'Translations not found';
54+
}
55+
} catch (error) {
56+
console.log(error);
5157
translations = await import(`../../../shared/locales/en/sensorCSV.json`, {
5258
assert: { type: 'json' },
5359
});

packages/api/src/jobs/locales/i18n.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ import Backend from 'i18next-fs-backend';
44
i18n.use(Backend).init(
55
{
66
fallbackLng: 'en',
7-
preload: [
8-
'en',
9-
'es',
10-
'pt',
11-
'fr',
12-
'de',
13-
// 'hi', 'pa', 'ml'
14-
],
7+
preload: ['en', 'es', 'pt', 'fr', 'de', 'hi', 'pa', 'ml'],
158
ns: ['translation', 'crop'],
169
defaultNS: 'translation',
1710
nsSeparator: ':',

packages/api/src/jobs/locales/i18next-parser.config.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,5 @@ export default {
22
output: 'src/jobs/locales/$LOCALE/$NAMESPACE.json',
33
sort: true,
44
defaultValue: 'MISSING',
5-
locales: [
6-
'en',
7-
'es',
8-
'pt',
9-
'fr',
10-
'de',
11-
// 'hi', 'pa', 'ml'
12-
],
5+
locales: ['en', 'es', 'pt', 'fr', 'de', 'hi', 'pa', 'ml'],
136
};
396 KB
Binary file not shown.

packages/api/src/jobs/locales/ml/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"EXPORT_README_TITLE": "നിങ്ങളുടെ സർട്ടിഫിക്കേഷൻ എക്സ്പോർറ്റ് മനസ്സിലാക്കുന്നു",
2+
"EXPORT_README_TITLE": "നിങ്ങളുടെ സർട്ടിഫിക്കേഷൻ എക്സ്‌പോർട്ട് മനസ്സിലാക്കുന്നു",
33
"N": "ഇല്ല",
44
"N/A": "ബാധകമല്ല",
55
"NO": "ഇല്ല",

packages/api/src/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (process.env.SENTRY_DSN && environment !== 'development') {
3939
// Automatically instrument Node.js libraries and frameworks
4040
...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
4141
],
42-
release: '3.6.7',
42+
release: '3.6.8',
4343
// Set tracesSampleRate to 1.0 to capture 100%
4444
// of transactions for performance monitoring.
4545
// We recommend adjusting this value in production
Lines changed: 63 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,108 @@
11
.background {
2-
font-family: "Open Sans", "SansSerif", sans-serif !important;
3-
background: #FAFAFD !important;
4-
margin: 0 !important;
5-
padding-bottom: 34px !important;
2+
font-family: 'Open Sans', 'SansSerif', sans-serif, 'Manjari' !important;
3+
background: #fafafd !important;
4+
margin: 0 !important;
5+
padding-bottom: 34px !important;
66
}
77

88
.header {
9-
background: #C7EFD3 !important;
9+
background: #c7efd3 !important;
1010
}
1111

1212
#logo {
13-
height: 48px !important;
14-
display: block !important;
15-
margin: auto !important;
16-
padding: 0px 28px !important;
17-
background: white !important;
13+
height: 48px !important;
14+
display: block !important;
15+
margin: auto !important;
16+
padding: 0px 28px !important;
17+
background: white !important;
1818
}
1919

2020
.main-container {
21-
background: white !important;
22-
margin: auto !important;
23-
width: 95% !important;
24-
max-width: 568px !important;
25-
border-bottom: 4px solid #C7EFD3 !important;
21+
background: white !important;
22+
margin: auto !important;
23+
width: 95% !important;
24+
max-width: 568px !important;
25+
border-bottom: 4px solid #c7efd3 !important;
2626
}
2727

2828
.main-content {
29-
padding: 2vw 4vw !important;
29+
padding: 2vw 4vw !important;
3030
}
3131

3232
.main-content p {
33-
font-style: normal !important;
34-
font-weight: normal !important;
35-
font-size: 16px !important;
36-
line-height: 24px !important;
37-
color: #262422 !important;
33+
font-style: normal !important;
34+
font-weight: normal !important;
35+
font-size: 16px !important;
36+
line-height: 24px !important;
37+
color: #262422 !important;
3838
}
3939

4040
.support-header {
41-
font-weight: 600 !important;
42-
font-style: normal !important;
43-
font-size: 16px !important;
44-
line-height: 24px !important;
45-
color: #262422 !important;
41+
font-weight: 600 !important;
42+
font-style: normal !important;
43+
font-size: 16px !important;
44+
line-height: 24px !important;
45+
color: #262422 !important;
4646
}
4747

4848
.support-content {
49-
font-style: normal !important;
50-
font-weight: normal !important;
51-
font-size: 16px !important;
52-
line-height: 24px !important;
53-
color: #262422 !important;
49+
font-style: normal !important;
50+
font-weight: normal !important;
51+
font-size: 16px !important;
52+
line-height: 24px !important;
53+
color: #262422 !important;
5454
}
5555

5656
.support-container {
57-
margin: 36px 0 !important;
57+
margin: 36px 0 !important;
5858
}
5959

6060
.button-aligner {
61-
text-align: center !important;
61+
text-align: center !important;
6262
}
6363

6464
.button {
65-
text-decoration: none !important;
66-
color: #282B36 !important;
67-
background: #FCE38D !important;
68-
border-radius: 4px !important;
69-
padding: 12px 12px !important;
70-
width: 90% !important;
71-
max-width: 248px !important;
72-
cursor: pointer !important;
73-
border: none !important;
74-
box-shadow: 0px 2px 8px rgba(102, 115, 138, 0.3) !important;
75-
font-style: normal !important;
76-
font-weight: 600 !important;
77-
font-size: 16px !important;
78-
line-height: 24px !important;
65+
text-decoration: none !important;
66+
color: #282b36 !important;
67+
background: #fce38d !important;
68+
border-radius: 4px !important;
69+
padding: 12px 12px !important;
70+
width: 90% !important;
71+
max-width: 248px !important;
72+
cursor: pointer !important;
73+
border: none !important;
74+
box-shadow: 0px 2px 8px rgba(102, 115, 138, 0.3) !important;
75+
font-style: normal !important;
76+
font-weight: 600 !important;
77+
font-size: 16px !important;
78+
line-height: 24px !important;
7979
}
8080

8181
p {
82-
font-size: 20px !important;
82+
font-size: 20px !important;
8383
}
8484

8585
.footer {
86-
text-align: center !important;
87-
margin-top: 34px !important;
86+
text-align: center !important;
87+
margin-top: 34px !important;
8888
}
8989

9090
.footer p {
91-
font-style: normal !important;
92-
font-weight: normal !important;
93-
font-size: 12px !important;
94-
line-height: 24px !important;
95-
color: #9FAABE !important;
91+
font-style: normal !important;
92+
font-weight: normal !important;
93+
font-size: 12px !important;
94+
line-height: 24px !important;
95+
color: #9faabe !important;
9696
}
9797

98-
.main-content p a, .footer a {
99-
color: #38AA92 !important;
100-
text-decoration: none !important;
98+
.main-content p a,
99+
.footer a {
100+
color: #38aa92 !important;
101+
text-decoration: none !important;
101102
}
102103

103-
.main-content p a:hover, .footer a:hover {
104-
color: #38AA92 !important;
105-
text-decoration: underline !important;
104+
.main-content p a:hover,
105+
.footer a:hover {
106+
color: #38aa92 !important;
107+
text-decoration: underline !important;
106108
}

packages/api/src/templates/locales/ml.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@
9191
"PRIVACY": "ലൈറ്റ്ഫാമിൽ, ഞങ്ങൾ നിങ്ങളുടെ സ്വകാര്യത ഗൗരവമായി കാണുന്നു, അതിനാൽ നിങ്ങളുടെ എക്സ്പോർറ്റ് ആക്‌സസ് ചെയ്യുന്നതിന് മുമ്പ് നിങ്ങൾ ലോഗിൻ ചെയ്യേണ്ടതുണ്ട്. എന്തെങ്കിലും അസൗകര്യം ഉണ്ടായതിൽ ഖേദിക്കുന്നു. നിങ്ങളുടെ സമർപ്പണത്തിന് ആശംസകൾ, ലൈറ്റ്ഫാം ഉപയോഗിച്ചതിന് നന്ദി!",
9292
"SUBJECT": "ലൈറ്റ്ഫാമിൽ നിന്ന് നിങ്ങളുടെ സർട്ടിഫിക്കേഷൻ രേഖകൾ എക്സ്പോർറ്റ് ചെയ്യുന്നു",
9393
"HI": "നമസ്തേ",
94-
"GET_YOUR_EXPORT": "രേഖകൾ നേടുക",
95-
"LANGUAGE_DELAY": ""
94+
"GET_YOUR_EXPORT": "രേഖകൾ നേടുക"
9695
},
9796
"COMMON": {
9897
"JOIN": "ചേരുക",
@@ -102,4 +101,4 @@
102101
"WORKER": "തൊഴിലാളി",
103102
"EXTENSION_OFFICER": "എക്സ്റ്റൻഷൻ ഓഫീസർ"
104103
}
105-
}
104+
}

packages/api/src/templates/sendEmailTemplate.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,7 @@ const emailTransporter = new EmailTemplates({
7171
root: path.join(dir, 'emails'),
7272
},
7373
i18n: {
74-
locales: [
75-
'en',
76-
'es',
77-
'fr',
78-
'pt',
79-
'de',
80-
// 'hi', 'pa', 'ml'
81-
],
74+
locales: ['en', 'es', 'fr', 'pt', 'de', 'hi', 'pa', 'ml'],
8275
directory: path.join(dir, 'locales'),
8376
objectNotation: true,
8477
},
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"CSV_HEADER_TRANSLATIONS": {
3+
"name": "नाम",
4+
"latitude": "अक्षांश",
5+
"longitude": "देशांतर",
6+
"reading_types": "पठन_प्रकार",
7+
"external_id": "बाह्य_ID",
8+
"depth": "गहराई_सेमी",
9+
"brand": "ब्रांड",
10+
"model": "मॉडल"
11+
},
12+
"READING_TYPE_TRANSLATIONS": {
13+
"soil_water_content": "मृदा_जल_सामग्री",
14+
"soil_water_potential": "मृदा_जल_क्षमता",
15+
"temperature": "तापमान"
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"CSV_HEADER_TRANSLATIONS": {
3+
"name": "പേര്",
4+
"latitude": "അക്ഷാംശം",
5+
"longitude": "രേഖാംശം",
6+
"reading_types": "വായന_തരങ്ങൾ",
7+
"external_id": "ബാഹ്യ_ഐഡി",
8+
"depth": "ആഴം_സെ.മീ",
9+
"brand": "ബ്രാൻഡ്",
10+
"model": "മോഡൽ"
11+
},
12+
"READING_TYPE_TRANSLATIONS": {
13+
"soil_water_content": "മണ്ണ്_ജലം_ഉള്ളടക്കം",
14+
"soil_water_potential": "മണ്ണ്_ജലം_ ശേഷി",
15+
"temperature": "താപനില"
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"CSV_HEADER_TRANSLATIONS": {
3+
"name": "ਨਾਮ",
4+
"latitude": "ਵਿਥਕਾਰ",
5+
"longitude": "ਲੰਬਕਾਰ",
6+
"reading_types": "ਪੜ੍ਹਨਾ_ਕਿਸਮਾਂ",
7+
"external_id": "ਬਾਹਰੀ_ID",
8+
"depth": "ਡੂੰਘਾਈ_ਸੈ.ਮੀ",
9+
"brand": "ਬ੍ਰਾਂਡ",
10+
"model": "ਮਾਡਲ"
11+
},
12+
"READING_TYPE_TRANSLATIONS": {
13+
"soil_water_content": "ਮਿੱਟੀ_ਪਾਣੀ_ਸਮੱਗਰੀ",
14+
"soil_water_potential": "ਮਿੱਟੀ_ਪਾਣੀ_ਸੰਭਾਵੀ",
15+
"temperature": "ਤਾਪਮਾਨ"
16+
}
17+
}

0 commit comments

Comments
 (0)