Skip to content

Commit 16d98db

Browse files
authored
6141 - Bulk Upload README translations (#6143)
* 6141 - Add bulkdownload readme translations * 6141 - Fix bulkDownload.json not being imported
1 parent 523b5a1 commit 16d98db

15 files changed

Lines changed: 404 additions & 66 deletions

File tree

src/client/pages/DataDownload/LinkBulkDownload/hooks/useBulkDownloadProps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import axios from 'axios'
33

44
import { ApiEndPoint } from 'meta/api/endpoint'
55

6+
import { useLanguage } from 'client/hooks/language'
67
import { useCountryRouteParams } from 'client/hooks/routeParams'
78

89
type Props = {
@@ -19,13 +20,15 @@ export const useBulkDownloadProps = (props: Props): Returned => {
1920
const { includeClimaticDomain, linkRef } = props
2021

2122
const { assessmentName, countryIso, cycleName } = useCountryRouteParams()
23+
const lang = useLanguage()
2224
const [downloading, setDownloading] = useState<boolean>()
2325

2426
const fileLinkParams = new URLSearchParams({
2527
assessmentName,
2628
countryIso,
2729
cycleName,
2830
includeClimaticDomain: String(includeClimaticDomain),
31+
lang,
2932
})
3033

3134
const fileLink = `${ApiEndPoint.File.bulkDownload()}?${fileLinkParams.toString()}`

src/i18n/resources/ar.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import admin from './ar/admin.json'
22
import anchors from './ar/anchors.json'
33
import area from './ar/area.json'
44
import assessmentSection from './ar/assessmentSection.json'
5+
import bulkDownload from './ar/bulkDownload.json'
56
import common from './ar/common.json'
67
import contentCheck from './ar/contentCheck.json'
78
import dataDownload from './ar/dataDownload.json'
@@ -27,6 +28,7 @@ export const arTranslation = {
2728
admin,
2829
anchors,
2930
area,
31+
bulkDownload,
3032
common,
3133
contentCheck,
3234
dataDownload,

src/i18n/resources/es.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import admin from './es/admin.json'
22
import area from './es/area.json'
33
import assessmentSection from './es/assessmentSection.json'
4+
import bulkDownload from './es/bulkDownload.json'
45
import common from './es/common.json'
56
import contentCheck from './es/contentCheck.json'
67
import dataDownload from './es/dataDownload.json'
@@ -26,6 +27,7 @@ import user from './es/user.json'
2627
export const esTranslation = {
2728
admin,
2829
area,
30+
bulkDownload,
2931
common,
3032
contentCheck,
3133
dataDownload,

src/i18n/resources/fr.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import admin from './fr/admin.json'
22
import area from './fr/area.json'
33
import assessmentSection from './fr/assessmentSection.json'
4+
import bulkDownload from './fr/bulkDownload.json'
45
import common from './fr/common.json'
56
import contentCheck from './fr/contentCheck.json'
67
import dataDownload from './fr/dataDownload.json'
@@ -26,6 +27,7 @@ import user from './fr/user.json'
2627
export const frTranslation = {
2728
admin,
2829
area,
30+
bulkDownload,
2931
common,
3032
contentCheck,
3133
dataDownload,

src/i18n/resources/ru.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import admin from './ru/admin.json'
22
import area from './ru/area.json'
33
import assessmentSection from './ru/assessmentSection.json'
4+
import bulkDownload from './ru/bulkDownload.json'
45
import common from './ru/common.json'
56
import contentCheck from './ru/contentCheck.json'
67
import dataDownload from './ru/dataDownload.json'
@@ -25,6 +26,7 @@ import user from './ru/user.json'
2526
export const ruTranslation = {
2627
admin,
2728
area,
29+
bulkDownload,
2830
common,
2931
contentCheck,
3032
dataDownload,

src/i18n/resources/zh.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import admin from './zh/admin.json'
22
import area from './zh/area.json'
33
import assessmentSection from './zh/assessmentSection.json'
4+
import bulkDownload from './zh/bulkDownload.json'
45
import common from './zh/common.json'
56
import contentCheck from './zh/contentCheck.json'
67
import dataDownload from './zh/dataDownload.json'
@@ -25,6 +26,7 @@ import user from './zh/user.json'
2526
export const zhTranslation = {
2627
admin,
2728
area,
29+
bulkDownload,
2830
common,
2931
contentCheck,
3032
dataDownload,
Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,33 @@
1-
import { CycleName } from 'meta/assessment/cycle'
1+
import type { CycleName } from 'meta/assessment/cycle'
2+
import { CycleNames } from 'meta/assessment/cycle/names'
23
import { Lang } from 'meta/lang'
34

5+
import { getReadmeAr } from './templates/ar'
6+
import { getReadmeEn } from './templates/en'
7+
import { getReadmeEs } from './templates/es'
8+
import { getReadmeFr } from './templates/fr'
9+
import { getReadmeRu } from './templates/ru'
10+
import { getReadmeZh } from './templates/zh'
11+
import type { GetReadmeTemplate } from './types'
12+
413
type Props = {
514
cycleName: CycleName
6-
yearRange: string
7-
years: string
15+
lang: Lang
816
}
917

10-
export const getReadme = (props: Props): Partial<Record<Lang, string>> => {
11-
const { cycleName, yearRange, years } = props
12-
13-
return {
14-
[Lang.en]: `README
15-
16-
The bulk download zip archive contains three folders:
17-
18-
1. “Annual_variables”, which contains annual data on forest disturbances by variable (Diseases, Insects, Weather, Other and Fire).
19-
The data are structured as annual columns and available for the period 2000-until the last reporting year.
20-
Each file is named according to the structure of the FRA reports: [Section][SubSection]_[yyyy]-[mm]-[dd].csv.
21-
The date component refers to the date of data download here and elsewhere is this document.
22-
23-
2. ”FRA_Years_variables”, most of the reported data are found in this folder and typically, the data are structured by separate file for each variable.
24-
Each file typically has separate columns for the FRA reporting years: ${years}.
25-
Files are named according to convention [Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv
26-
27-
3. “Intervals_variables” -folder contains separate files for annual average change data on Forest expansion, Afforestation, Natural expansion, Deforestation and Reforestation.
28-
Each data record contains information for one country and intervals ${yearRange}.
29-
Each file is named according to convention [Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv.
30-
31-
In addition to the sub-folders the bulk download contains a number of files:
32-
33-
File “Annual_[yyyy]-[mm]-[dd].csv” contain data in one Excel worksheet for all variables in the folder “Annual_variables”.
34-
In addition, this file contains observations status codes (“flags”) for each data point.
35-
Flag descriptions are found in column U.
36-
37-
File “DegradedForest_[yyyy]-[mm]-[dd].csv” contains descriptive data reported on degraded forest reporting.
38-
39-
File “ForestPolicy_[yyyy]-[mm]-[dd].csv” contain descriptive data reported on forest policy.
40-
41-
File “ForestRestoration_[yyyy]-[mm]-[dd].csv ” contain descriptive reported on forest restoration
42-
File “FRA_years_[yyyy]-[mm]-[dd].csv” contain data in one Excel worksheet for all variables in the folder “FRA_Years_variables”.
43-
In addition, this file contains “flags” for each data point, flag descriptions are found in column IE.
44-
File “Intervals_[yyyy]-[mm]-[dd].csv ” contain data in one Excel worksheet for all variables in the folder “Intervals_variables”.
45-
In addition, this file contains “flags” for each data point, flag descriptions are found in column Q.
46-
47-
File “NDPYear_[yyyy]-[mm]-[dd].csv” contain data on the earliest and latest year of “National Data Point” used by countries/areas using the national data point approach for reporting on forest area.
48-
49-
File “NWFP_[yyyy]-[mm]-[dd].csv” contain data on the top 10 Non Wood Forest Products (NWFP) reported by: name, value in 1000 local currency, NWFP categories (for more information on the different categories please see the FRA platform for table 7)
50-
51-
File “Tiers_[yyyy]-[mm]-[dd].csv” contain information on Tiers reported for table 1a Forest area (status and trend), 2a Growing stock (status) and 2c Carbon stock (status).
52-
For more information on the criteria for the different tiers please see FRA platform Tier criteria sections 1a, 2a and 2c.
53-
54-
The reporting units can be found in each of the files or at the FRA platform.
18+
const readmeTemplatesByLanguage: Record<Lang, GetReadmeTemplate> = {
19+
[Lang.ar]: getReadmeAr,
20+
[Lang.en]: getReadmeEn,
21+
[Lang.es]: getReadmeEs,
22+
[Lang.fr]: getReadmeFr,
23+
[Lang.ru]: getReadmeRu,
24+
[Lang.zh]: getReadmeZh,
25+
}
5526

56-
Required citation: FAO. ${cycleName}. Global Forest Resources Assessment ${cycleName}
27+
export const getReadme = (props: Props): string => {
28+
const { cycleName, lang } = props
29+
const readmeCycleName = cycleName === CycleNames._2020 ? CycleNames._2020 : CycleNames._2025
30+
const getReadmeForLanguage = readmeTemplatesByLanguage[lang]
5731

58-
Contact: fra@fao.org`,
59-
}
32+
return getReadmeForLanguage({ cycleName: readmeCycleName })
6033
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { CycleNames } from 'meta/assessment/cycle/names'
2+
3+
import type { GetReadmeTemplate, ReadmeYearsByCycle } from '../types'
4+
5+
const readmeYearsByCycle: ReadmeYearsByCycle = {
6+
[CycleNames._2020]: {
7+
yearRange: '1990-2000، 2000-2010، 2010-2015 أو 2015-2020',
8+
years: '1990، 2000، 2010، 2015 و2020',
9+
},
10+
[CycleNames._2025]: {
11+
yearRange: '1990-2000، 2000-2010، 2010-2015، 2015-2020 أو 2020-2025',
12+
years: '1990، 2000، 2010، 2015، 2020 و2025',
13+
},
14+
}
15+
16+
export const getReadmeAr: GetReadmeTemplate = (props) => {
17+
const { cycleName } = props
18+
const { yearRange, years } = readmeYearsByCycle[cycleName]
19+
20+
return `README
21+
22+
تحتوي حزمة التنزيل المجمّع بصيغة ZIP على ثلاثة مجلدات:
23+
24+
“Annual_variables”، يحتوي هذا المجلد على بيانات سنوية حول اضطرابات الغابات حسب المتغير (الأمراض، الحشرات، الأحوال الجوية، عوامل أخرى، والحرائق). يتم تنظيم البيانات على شكل أعمدة سنوية، وهي متاحة للفترة من عام 2000 وحتى أحدث سنة إبلاغ. يتم تسمية كل ملف وفقًا لبنية تقارير FRA:
25+
[Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv.
26+
يشير مكوّن التاريخ إلى تاريخ تنزيل البيانات هنا وفي أماكن أخرى من هذا المستند.
27+
28+
“FRA_Years_variables”، توجد معظم البيانات المُبلَّغ عنها في هذا المجلد، وعادةً ما يتم تنظيم البيانات في ملفات منفصلة لكل متغير. يحتوي كل ملف عادةً على أعمدة منفصلة لسنوات الإبلاغ الخاصة بـ FRA: ${years}. يتم تسمية الملفات وفقًا للاصطلاح التالي:
29+
[Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv
30+
31+
“Intervals_variables”، يحتوي هذا المجلد على ملفات منفصلة لبيانات متوسط التغير السنوي المتعلقة بتوسّع الغابات، والتشجير، والتوسّع الطبيعي، وإزالة الغابات، وإعادة التشجير. يحتوي كل سجل بيانات على معلومات تخص بلدًا واحدًا وفترات زمنية هي:
32+
${yearRange}. يتم تسمية كل ملف وفقًا للاصطلاح التالي:
33+
[Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv
34+
35+
بالإضافة إلى المجلدات الفرعية، يحتوي التنزيل المجمّع على عدد من الملفات:
36+
37+
الملف “Annual_[yyyy]-[mm]-[dd].csv” يحتوي على البيانات في ورقة Excel واحدة لجميع المتغيرات الموجودة في مجلد “Annual_variables”. بالإضافة إلى ذلك، يحتوي هذا الملف على رموز حالة الملاحظات (“flags”) لكل نقطة بيانات. يمكن العثور على وصف هذه الرموز في العمود U.
38+
39+
الملف “DegradedForest_[yyyy]-[mm]-[dd].csv” يحتوي على بيانات وصفية مُبلَّغ عنها حول الغابات المتدهورة.
40+
41+
الملف “ForestPolicy_[yyyy]-[mm]-[dd].csv” يحتوي على بيانات وصفية مُبلَّغ عنها حول السياسة الحرجية.
42+
43+
الملف “ForestRestoration_[yyyy]-[mm]-[dd].csv” يحتوي على بيانات وصفية مُبلَّغ عنها حول استعادة الغابات.
44+
45+
الملف “FRA_years_[yyyy]-[mm]-[dd].csv” يحتوي على البيانات في ورقة Excel واحدة لجميع المتغيرات الموجودة في مجلد “FRA_Years_variables”. بالإضافة إلى ذلك، يحتوي هذا الملف على “flags” لكل نقطة بيانات؛ يمكن العثور على وصف هذه الرموز في العمود IA.
46+
47+
الملف “Intervals_[yyyy]-[mm]-[dd].csv” يحتوي على البيانات في ورقة Excel واحدة لجميع المتغيرات الموجودة في مجلد “Intervals_variables”. بالإضافة إلى ذلك، يحتوي هذا الملف على “flags” لكل نقطة بيانات؛ يمكن العثور على وصف هذه الرموز في العمود Q.
48+
49+
الملف “NDPYear_[yyyy]-[mm]-[dd].csv” يحتوي على بيانات عن أقدم وأحدث سنة من “نقطة البيانات الوطنية” (National Data Point) المستخدمة من قبل البلدان/المناطق التي تعتمد هذا النهج في الإبلاغ عن مساحة الغابات.
50+
51+
الملف “NWFP_[yyyy]-[mm]-[dd].csv” يحتوي على بيانات عن أهم 10 منتجات حرجية غير خشبية (NWFP) كما تم الإبلاغ عنها، وتشمل: الاسم، والقيمة بوحدة آلاف العملة المحلية، وفئات منتجات الغابات غير الخشبية (للمزيد من المعلومات حول الفئات المختلفة، يرجى الرجوع إلى منصة FRA، الجدول 7).
52+
53+
الملف “Tiers_[yyyy]-[mm]-[dd].csv” يحتوي على معلومات حول المستويات (“Tiers”) المُبلَّغ عنها للجداول التالية:
54+
الجدول 1a: مساحة الغابات (الحالة والاتجاه)،
55+
الجدول 2a: المخزون القائم (الحالة)،
56+
الجدول 2c: مخزون الكتلة الحيوية (الحالة).
57+
للمزيد من المعلومات حول معايير المستويات المختلفة، يرجى الرجوع إلى أقسام معايير المستويات في منصة FRA للجداول 1a و2a و2c.
58+
59+
يمكن العثور على وحدات الإبلاغ في كل ملف من الملفات أو على منصة FRA.
60+
61+
ا منظمة الأغذية والزراعة (الفاو). سنة التنزيل. تقييم الموارد الحرجية العالمية. الرابط. تم الوصول إليه في : تاريخ التنزيل
62+
63+
جهة الاتصال: fra@fao.org`
64+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { CycleNames } from 'meta/assessment/cycle/names'
2+
3+
import type { GetReadmeTemplate, ReadmeYearsByCycle } from '../types'
4+
5+
const readmeYearsByCycle: ReadmeYearsByCycle = {
6+
[CycleNames._2020]: {
7+
yearRange: '1990-2000, 2000-2010, 2010-2015 or 2015-2020',
8+
years: '1990, 2000, 2010, 2015 and 2020',
9+
},
10+
[CycleNames._2025]: {
11+
yearRange: '1990-2000, 2000-2010, 2010-2015, 2015-2020 or 2020-2025',
12+
years: '1990, 2000, 2010, 2015, 2020 and 2025',
13+
},
14+
}
15+
16+
export const getReadmeEn: GetReadmeTemplate = (props) => {
17+
const { cycleName } = props
18+
const { yearRange, years } = readmeYearsByCycle[cycleName]
19+
20+
return `README
21+
22+
The bulk download zip archive contains three folders:
23+
24+
1. “Annual_variables”, which contains annual data on forest disturbances by variable (Diseases, Insects, Weather, Other and Fire). The data are structured as annual columns and available for the period 2000-until the last reporting year. Each file is named according to the structure of the FRA reports: [Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv. The date component refers to the date of data download here and elsewhere is this document.
25+
26+
2. ”FRA_Years_variables”, most of the reported data are found in this folder and typically, the data are structured by separate file for each variable. Each file typically has separate columns for the FRA reporting years: ${years}. Files are named according to convention [Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv
27+
28+
3. “Intervals_variables” -folder contains separate files for annual average change data on Forest expansion, Afforestation, Natural expansion, Deforestation and Reforestation. Each data record contains information for one country and intervals ${yearRange}. Each file is named according to convention [Section][SubSection]_[variable]_[yyyy]-[mm]-[dd].csv.
29+
30+
In addition to the sub-folders the bulk download contains a number of files:
31+
32+
File “Annual_[yyyy]-[mm]-[dd].csv” contain data in one Excel worksheet for all variables in the folder “Annual_variables”. In addition, this file contains observations status codes (“flags”) for each data point. Flag descriptions are found in column U.
33+
34+
File “DegradedForest_[yyyy]-[mm]-[dd].csv” contains descriptive data reported on degraded forest reporting.
35+
36+
File “ForestPolicy_[yyyy]-[mm]-[dd].csv” contain descriptive data reported on forest policy.
37+
38+
File “ForestRestoration_[yyyy]-[mm]-[dd].csv ” contain descriptive data reported on forest restoration
39+
40+
File “FRA_years_[yyyy]-[mm]-[dd].csv” contain data in one Excel worksheet for all variables in the folder “FRA_Years_variables”. In addition, this file contains “flags” for each data point, flag descriptions are found in column IA.
41+
42+
File “Intervals_[yyyy]-[mm]-[dd].csv ” contain data in one Excel worksheet for all variables in the folder “Intervals_variables”. In addition, this file contains “flags” for each data point, flag descriptions are found in column Q.
43+
44+
File “NDPYear_[yyyy]-[mm]-[dd].csv” contain data on the earliest and latest year of “National Data Point” used by countries/areas using the national data point approach for reporting on forest area.
45+
46+
File “NWFP_[yyyy]-[mm]-[dd].csv” contain data on the top 10 Non Wood Forest Products (NWFP) reported by: name, value in 1000 local currency, NWFP categories (for more information on the different categories please see the FRA platform for table 7)
47+
48+
File “Tiers_[yyyy]-[mm]-[dd].csv” contain information on Tiers reported for table 1a Forest area (status and trend), 2a Growing stock (status) and 2c Biomass (status). For more information on the criteria for the different tiers please see FRA platform Tier criteria sections 1a, 2a and 2c.
49+
50+
The reporting units can be found in each of the files or at the FRA platform.
51+
52+
Required citation: [FAO. Year of the download. Global Forest Resources Assessment. URL. Accessed on: date-of-the-download]
53+
54+
Contact: fra@fao.org`
55+
}

0 commit comments

Comments
 (0)