@jjlmoya/utils-nature 1.23.0 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/package.json +2 -2
  2. package/src/category/i18n/es.ts +1 -1
  3. package/src/category/i18n/fr.ts +110 -110
  4. package/src/category/i18n/it.ts +1 -1
  5. package/src/category/i18n/pl.ts +1 -1
  6. package/src/category/i18n/pt.ts +1 -1
  7. package/src/category/i18n/ru.ts +110 -110
  8. package/src/category/seo.astro +1 -1
  9. package/src/components/PreviewNavSidebar.astro +1 -1
  10. package/src/components/PreviewToolbar.astro +1 -1
  11. package/src/data.ts +1 -1
  12. package/src/env.d.ts +1 -1
  13. package/src/layouts/PreviewLayout.astro +117 -117
  14. package/src/pages/[locale]/[slug].astro +164 -164
  15. package/src/pages/index.astro +1 -1
  16. package/src/tests/category_seo_quality.test.ts +74 -0
  17. package/src/tests/faq_count.test.ts +19 -19
  18. package/src/tests/mocks/astro_mock.js +1 -1
  19. package/src/tests/no_en_dash.test.ts +71 -71
  20. package/src/tests/no_h1_in_components.test.ts +1 -1
  21. package/src/tests/seo_length.test.ts +23 -23
  22. package/src/tests/seo_parity.test.ts +2 -2
  23. package/src/tests/spanish_leakage.test.ts +175 -175
  24. package/src/tool/cricketThermometer/i18n/de.ts +169 -169
  25. package/src/tool/cricketThermometer/i18n/en.ts +169 -169
  26. package/src/tool/cricketThermometer/i18n/es.ts +169 -169
  27. package/src/tool/cricketThermometer/i18n/fr.ts +169 -169
  28. package/src/tool/cricketThermometer/i18n/id.ts +169 -169
  29. package/src/tool/cricketThermometer/i18n/it.ts +169 -169
  30. package/src/tool/cricketThermometer/i18n/ja.ts +169 -169
  31. package/src/tool/cricketThermometer/i18n/ko.ts +169 -169
  32. package/src/tool/cricketThermometer/i18n/nl.ts +169 -169
  33. package/src/tool/cricketThermometer/i18n/pl.ts +169 -169
  34. package/src/tool/cricketThermometer/i18n/pt.ts +169 -169
  35. package/src/tool/cricketThermometer/i18n/ru.ts +169 -169
  36. package/src/tool/cricketThermometer/i18n/sv.ts +169 -169
  37. package/src/tool/cricketThermometer/i18n/tr.ts +169 -169
  38. package/src/tool/cricketThermometer/i18n/zh.ts +169 -169
  39. package/src/tool/cricketThermometer/seo.astro +15 -15
  40. package/src/tool/digitalCarbon/i18n/de.ts +229 -229
  41. package/src/tool/digitalCarbon/i18n/fr.ts +229 -229
  42. package/src/tool/digitalCarbon/i18n/ru.ts +229 -229
  43. package/src/tool/digitalCarbon/seo.astro +15 -15
  44. package/src/tool/rainHarvester/i18n/de.ts +167 -167
  45. package/src/tool/rainHarvester/i18n/en.ts +167 -167
  46. package/src/tool/rainHarvester/i18n/es.ts +167 -167
  47. package/src/tool/rainHarvester/i18n/fr.ts +167 -167
  48. package/src/tool/rainHarvester/i18n/id.ts +167 -167
  49. package/src/tool/rainHarvester/i18n/it.ts +167 -167
  50. package/src/tool/rainHarvester/i18n/ja.ts +167 -167
  51. package/src/tool/rainHarvester/i18n/ko.ts +167 -167
  52. package/src/tool/rainHarvester/i18n/nl.ts +167 -167
  53. package/src/tool/rainHarvester/i18n/pl.ts +167 -167
  54. package/src/tool/rainHarvester/i18n/pt.ts +167 -167
  55. package/src/tool/rainHarvester/i18n/ru.ts +167 -167
  56. package/src/tool/rainHarvester/i18n/sv.ts +167 -167
  57. package/src/tool/rainHarvester/i18n/tr.ts +167 -167
  58. package/src/tool/rainHarvester/i18n/zh.ts +167 -167
  59. package/src/tool/rainHarvester/seo.astro +15 -15
  60. package/src/tool/seedCalculator/i18n/fr.ts +197 -197
  61. package/src/tool/seedCalculator/i18n/pl.ts +197 -197
  62. package/src/tool/seedCalculator/i18n/ru.ts +197 -197
  63. package/src/tool/seedCalculator/seo.astro +15 -15
  64. package/src/types.ts +1 -1
@@ -1,167 +1,167 @@
1
- import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
- import { bibliography } from '../bibliography';
3
- import type { RainHarvesterLocaleContent } from '../index';
4
-
5
- const slug = 'rainwater-calculator';
6
- const title = '雨水收集计算器';
7
- const description = '计算您可以从屋顶收集多少雨水,并确定储水箱的大小。';
8
-
9
- const faqData = [
10
- {
11
- question: '我实际上能从屋顶收集多少水?',
12
- answer: '一般规则是,屋顶每平方米面积在每毫米降雨下大约可以收集 1 升水。但由于蒸发和过滤的影响,需要通过"径流系数"进行调整。',
13
- },
14
- {
15
- question: '什么是径流系数?',
16
- answer: '这是一个百分比,表示根据屋顶材料的不同会损失多少水。金属或瓦片屋顶效率很高 (0.85-0.95),而碎石或泥土屋顶的效率则低得多 (0.1-0.3)。',
17
- },
18
- {
19
- question: '如何确定储水箱的大小?',
20
- answer: '您应该计算一个月内的最大预期降雨量,并将其与您的估计月用水量联系起来。如果水箱太小,遇到暴雨会溢出;如果太大,则会造成不必要的浪费。',
21
- },
22
- {
23
- question: '收集的雨水可以直接引用吗?',
24
- answer: '不能直接饮用。雨水会携带灰尘、鸟粪和空气中的颗粒物。由于人类饮用,必须通过沉积过滤器、活性炭过滤,并使用紫外线或氯进行消毒。',
25
- },
26
- ];
27
-
28
- const howToData = [
29
- {
30
- name: '测量水平投影面积',
31
- text: '测量屋顶底部的长度和宽度(不是斜面面积,而是投影到地面的面积)。',
32
- },
33
- {
34
- name: '查询当地降雨量',
35
- text: '在国家气象服务机构查询您所在地区以毫米 (mm) 为单位的年平均或月平均降水量。',
36
- },
37
- {
38
- name: '应用材料效率',
39
- text: '在我们的计算器中选择您的屋顶材料,以扣除因吸收或热量而损失的水量。',
40
- },
41
- {
42
- name: '计算所需容量',
43
- text: '根据年产水量结果,选择一个能够至少储存总收集量 20-30% 的水箱,以应对干旱季节。',
44
- },
45
- ];
46
-
47
- const faqSchema: WithContext<FAQPage> = {
48
- '@context': 'https://schema.org',
49
- '@type': 'FAQPage',
50
- mainEntity: faqData.map((item) => ({
51
- '@type': 'Question',
52
- name: item.question,
53
- acceptedAnswer: { '@type': 'Answer', text: item.answer },
54
- })),
55
- };
56
-
57
- const howToSchema: WithContext<HowTo> = {
58
- '@context': 'https://schema.org',
59
- '@type': 'HowTo',
60
- name: title,
61
- description,
62
- step: howToData.map((step, i) => ({
63
- '@type': 'HowToStep',
64
- position: i + 1,
65
- name: step.name,
66
- text: step.text,
67
- })),
68
- };
69
-
70
- const appSchema: WithContext<SoftwareApplication> = {
71
- '@context': 'https://schema.org',
72
- '@type': 'SoftwareApplication',
73
- name: title,
74
- description,
75
- applicationCategory: 'UtilityApplication',
76
- operatingSystem: 'All',
77
- offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
78
- inLanguage: 'zh',
79
- };
80
-
81
- export const content: RainHarvesterLocaleContent = {
82
- slug,
83
- title,
84
- description,
85
- ui: {
86
- headInputs: '屋顶设置',
87
- headResults: '收集潜力',
88
- labelArea: '屋顶面积',
89
- labelRainfall: '年降雨量',
90
- labelMaterial: '屋顶材料',
91
- unitM2: 'm²',
92
- unitMm: 'mm',
93
- unitLiters: '升',
94
- helpRainfall: '不知道?在 Google 上搜索"(您所在的城市)年平均降水量"。',
95
- efficiencyTitle: '效率系数',
96
- efficiencyNote: '考虑到过滤器和蒸发,已应用 10% 的损失率。',
97
- resultTitle: '年收集潜力',
98
- equivalenciesTitle: '实用等价值',
99
- labelFlushes: '冲厕次数',
100
- labelShowers: '淋浴次数 (10分钟计)',
101
- labelGarden: '浇灌花园',
102
- gardenArea: '(50m²)',
103
- materialMetal: '金属 / 琉璃瓦',
104
- materialClay: '陶瓦 / 粘土',
105
- materialConcrete: '混凝土 / 沥青',
106
- materialGravel: '碎石 / 绿色屋顶',
107
- },
108
- seo: [
109
- {
110
- type: 'title',
111
- text: '雨水收集:自主性与可持续性',
112
- level: 2,
113
- },
114
- {
115
- type: 'paragraph',
116
- html: '大多数房主并未意识到自家屋顶的潜力。一个标准屋顶每年可以捕获数千升免费水。此工具将这种潜力具象化,让您能够精确计算可以"收获"多少水,并确定最理想的储水箱尺寸。',
117
- },
118
- {
119
- type: 'title',
120
- text: '计算逻辑',
121
- level: 3,
122
- },
123
- {
124
- type: 'paragraph',
125
- html: '雨水收集的基础公式简单而有效:',
126
- },
127
- {
128
- type: 'paragraph',
129
- html: '<code style="display:block;padding:1rem;background:var(-bg-alt);border-radius:0.5rem;margin:1rem 0;font-family:monospace;">容量 = 面积 × 降雨量 × 径流系数 × 过滤效率</code>',
130
- },
131
- {
132
- type: 'list',
133
- items: [
134
- '<strong>面积:</strong> 您的屋顶投影面积(长 × 宽)。',
135
- '<strong>降雨量:</strong> 以毫米为单位的降雨量。',
136
- '<strong>系数:</strong> 屋顶损失的水量(例如吸收)。',
137
- '<strong>效率:</strong> 进入水箱前过滤环节的损失(约 10%)。',
138
- ],
139
- },
140
- {
141
- type: 'title',
142
- text: '为什么要收集雨水?',
143
- level: 3,
144
- },
145
- {
146
- type: 'list',
147
- items: [
148
- '<strong>节约开支:</strong> 显著降低您的水费账单。',
149
- '<strong>园艺:</strong> 植物更喜欢不含氯或石灰的水。',
150
- '<strong>应对能力:</strong> 在断水情况下保持应急储备。',
151
- ],
152
- },
153
- {
154
- type: 'title',
155
- text: '水箱选型',
156
- level: 2,
157
- },
158
- {
159
- type: 'paragraph',
160
- html: '最常见的错误是仅根据预算购买水箱。如果太小,会因溢出浪费数千升水;如果太大,则会造成不必要的资金支出。一般规则是拥有能储存当地 <strong>3 个月</strong>平均降雨量的容量,以帮助您平稳度过旱季。',
161
- },
162
- ],
163
- faq: faqData,
164
- howTo: howToData,
165
- bibliography,
166
- schemas: [faqSchema, howToSchema, appSchema],
167
- };
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import { bibliography } from '../bibliography';
3
+ import type { RainHarvesterLocaleContent } from '../index';
4
+
5
+ const slug = 'rainwater-calculator';
6
+ const title = '雨水收集计算器';
7
+ const description = '计算您可以从屋顶收集多少雨水,并确定储水箱的大小。';
8
+
9
+ const faqData = [
10
+ {
11
+ question: '我实际上能从屋顶收集多少水?',
12
+ answer: '一般规则是,屋顶每平方米面积在每毫米降雨下大约可以收集 1 升水。但由于蒸发和过滤的影响,需要通过"径流系数"进行调整。',
13
+ },
14
+ {
15
+ question: '什么是径流系数?',
16
+ answer: '这是一个百分比,表示根据屋顶材料的不同会损失多少水。金属或瓦片屋顶效率很高 (0.85-0.95),而碎石或泥土屋顶的效率则低得多 (0.1-0.3)。',
17
+ },
18
+ {
19
+ question: '如何确定储水箱的大小?',
20
+ answer: '您应该计算一个月内的最大预期降雨量,并将其与您的估计月用水量联系起来。如果水箱太小,遇到暴雨会溢出;如果太大,则会造成不必要的浪费。',
21
+ },
22
+ {
23
+ question: '收集的雨水可以直接引用吗?',
24
+ answer: '不能直接饮用。雨水会携带灰尘、鸟粪和空气中的颗粒物。由于人类饮用,必须通过沉积过滤器、活性炭过滤,并使用紫外线或氯进行消毒。',
25
+ },
26
+ ];
27
+
28
+ const howToData = [
29
+ {
30
+ name: '测量水平投影面积',
31
+ text: '测量屋顶底部的长度和宽度(不是斜面面积,而是投影到地面的面积)。',
32
+ },
33
+ {
34
+ name: '查询当地降雨量',
35
+ text: '在国家气象服务机构查询您所在地区以毫米 (mm) 为单位的年平均或月平均降水量。',
36
+ },
37
+ {
38
+ name: '应用材料效率',
39
+ text: '在我们的计算器中选择您的屋顶材料,以扣除因吸收或热量而损失的水量。',
40
+ },
41
+ {
42
+ name: '计算所需容量',
43
+ text: '根据年产水量结果,选择一个能够至少储存总收集量 20-30% 的水箱,以应对干旱季节。',
44
+ },
45
+ ];
46
+
47
+ const faqSchema: WithContext<FAQPage> = {
48
+ '@context': 'https://schema.org',
49
+ '@type': 'FAQPage',
50
+ mainEntity: faqData.map((item) => ({
51
+ '@type': 'Question',
52
+ name: item.question,
53
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
54
+ })),
55
+ };
56
+
57
+ const howToSchema: WithContext<HowTo> = {
58
+ '@context': 'https://schema.org',
59
+ '@type': 'HowTo',
60
+ name: title,
61
+ description,
62
+ step: howToData.map((step, i) => ({
63
+ '@type': 'HowToStep',
64
+ position: i + 1,
65
+ name: step.name,
66
+ text: step.text,
67
+ })),
68
+ };
69
+
70
+ const appSchema: WithContext<SoftwareApplication> = {
71
+ '@context': 'https://schema.org',
72
+ '@type': 'SoftwareApplication',
73
+ name: title,
74
+ description,
75
+ applicationCategory: 'UtilityApplication',
76
+ operatingSystem: 'All',
77
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
78
+ inLanguage: 'zh',
79
+ };
80
+
81
+ export const content: RainHarvesterLocaleContent = {
82
+ slug,
83
+ title,
84
+ description,
85
+ ui: {
86
+ headInputs: '屋顶设置',
87
+ headResults: '收集潜力',
88
+ labelArea: '屋顶面积',
89
+ labelRainfall: '年降雨量',
90
+ labelMaterial: '屋顶材料',
91
+ unitM2: 'm²',
92
+ unitMm: 'mm',
93
+ unitLiters: '升',
94
+ helpRainfall: '不知道?在 Google 上搜索"(您所在的城市)年平均降水量"。',
95
+ efficiencyTitle: '效率系数',
96
+ efficiencyNote: '考虑到过滤器和蒸发,已应用 10% 的损失率。',
97
+ resultTitle: '年收集潜力',
98
+ equivalenciesTitle: '实用等价值',
99
+ labelFlushes: '冲厕次数',
100
+ labelShowers: '淋浴次数 (10分钟计)',
101
+ labelGarden: '浇灌花园',
102
+ gardenArea: '(50m²)',
103
+ materialMetal: '金属 / 琉璃瓦',
104
+ materialClay: '陶瓦 / 粘土',
105
+ materialConcrete: '混凝土 / 沥青',
106
+ materialGravel: '碎石 / 绿色屋顶',
107
+ },
108
+ seo: [
109
+ {
110
+ type: 'title',
111
+ text: '雨水收集:自主性与可持续性',
112
+ level: 2,
113
+ },
114
+ {
115
+ type: 'paragraph',
116
+ html: '大多数房主并未意识到自家屋顶的潜力。一个标准屋顶每年可以捕获数千升免费水。此工具将这种潜力具象化,让您能够精确计算可以"收获"多少水,并确定最理想的储水箱尺寸。',
117
+ },
118
+ {
119
+ type: 'title',
120
+ text: '计算逻辑',
121
+ level: 3,
122
+ },
123
+ {
124
+ type: 'paragraph',
125
+ html: '雨水收集的基础公式简单而有效:',
126
+ },
127
+ {
128
+ type: 'paragraph',
129
+ html: '<code style="display:block;padding:1rem;background:var(-bg-alt);border-radius:0.5rem;margin:1rem 0;font-family:monospace;">容量 = 面积 × 降雨量 × 径流系数 × 过滤效率</code>',
130
+ },
131
+ {
132
+ type: 'list',
133
+ items: [
134
+ '<strong>面积:</strong> 您的屋顶投影面积(长 × 宽)。',
135
+ '<strong>降雨量:</strong> 以毫米为单位的降雨量。',
136
+ '<strong>系数:</strong> 屋顶损失的水量(例如吸收)。',
137
+ '<strong>效率:</strong> 进入水箱前过滤环节的损失(约 10%)。',
138
+ ],
139
+ },
140
+ {
141
+ type: 'title',
142
+ text: '为什么要收集雨水?',
143
+ level: 3,
144
+ },
145
+ {
146
+ type: 'list',
147
+ items: [
148
+ '<strong>节约开支:</strong> 显著降低您的水费账单。',
149
+ '<strong>园艺:</strong> 植物更喜欢不含氯或石灰的水。',
150
+ '<strong>应对能力:</strong> 在断水情况下保持应急储备。',
151
+ ],
152
+ },
153
+ {
154
+ type: 'title',
155
+ text: '水箱选型',
156
+ level: 2,
157
+ },
158
+ {
159
+ type: 'paragraph',
160
+ html: '最常见的错误是仅根据预算购买水箱。如果太小,会因溢出浪费数千升水;如果太大,则会造成不必要的资金支出。一般规则是拥有能储存当地 <strong>3 个月</strong>平均降雨量的容量,以帮助您平稳度过旱季。',
161
+ },
162
+ ],
163
+ faq: faqData,
164
+ howTo: howToData,
165
+ bibliography,
166
+ schemas: [faqSchema, howToSchema, appSchema],
167
+ };
@@ -1,15 +1,15 @@
1
- ---
2
- import { SEORenderer } from '@jjlmoya/utils-shared';
3
- import { rainHarvester } from './index';
4
- import type { KnownLocale } from '../../types';
5
-
6
- interface Props {
7
- locale?: KnownLocale;
8
- }
9
-
10
- const { locale = 'es' } = Astro.props;
11
- const content = await rainHarvester.i18n[locale]?.();
12
- if (!content) return null;
13
- ---
14
-
15
- {content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { rainHarvester } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await rainHarvester.i18n[locale]?.();
12
+ if (!content) return null;
13
+ ---
14
+
15
+ {content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}