|
1 | | -import { CycleName } from 'meta/assessment/cycle' |
| 1 | +import type { CycleName } from 'meta/assessment/cycle' |
| 2 | +import { CycleNames } from 'meta/assessment/cycle/names' |
2 | 3 | import { Lang } from 'meta/lang' |
3 | 4 |
|
| 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 | + |
4 | 13 | type Props = { |
5 | 14 | cycleName: CycleName |
6 | | - yearRange: string |
7 | | - years: string |
| 15 | + lang: Lang |
8 | 16 | } |
9 | 17 |
|
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 | +} |
55 | 26 |
|
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] |
57 | 31 |
|
58 | | -Contact: fra@fao.org`, |
59 | | - } |
| 32 | + return getReadmeForLanguage({ cycleName: readmeCycleName }) |
60 | 33 | } |
0 commit comments