@jjlmoya/utils-home 1.16.0 → 1.17.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 (125) hide show
  1. package/package.json +1 -1
  2. package/src/pages/[locale]/[slug].astro +28 -12
  3. package/src/tests/locale_completeness.test.ts +2 -20
  4. package/src/tests/shared-test-helpers.ts +56 -0
  5. package/src/tests/tool_exports.test.ts +34 -0
  6. package/src/tool/dewPointCalculator/bibliography.ts +10 -0
  7. package/src/tool/dewPointCalculator/i18n/de.ts +2 -12
  8. package/src/tool/dewPointCalculator/i18n/en.ts +2 -12
  9. package/src/tool/dewPointCalculator/i18n/es.ts +2 -12
  10. package/src/tool/dewPointCalculator/i18n/fr.ts +2 -12
  11. package/src/tool/dewPointCalculator/i18n/id.ts +2 -12
  12. package/src/tool/dewPointCalculator/i18n/it.ts +2 -12
  13. package/src/tool/dewPointCalculator/i18n/ja.ts +2 -12
  14. package/src/tool/dewPointCalculator/i18n/ko.ts +2 -12
  15. package/src/tool/dewPointCalculator/i18n/nl.ts +2 -12
  16. package/src/tool/dewPointCalculator/i18n/pl.ts +2 -12
  17. package/src/tool/dewPointCalculator/i18n/pt.ts +2 -12
  18. package/src/tool/dewPointCalculator/i18n/ru.ts +2 -12
  19. package/src/tool/dewPointCalculator/i18n/sv.ts +2 -12
  20. package/src/tool/dewPointCalculator/i18n/tr.ts +2 -12
  21. package/src/tool/dewPointCalculator/i18n/zh.ts +2 -12
  22. package/src/tool/dewPointCalculator/seo.astro +2 -1
  23. package/src/tool/heatingComparator/bibliography.ts +14 -0
  24. package/src/tool/heatingComparator/i18n/de.ts +2 -16
  25. package/src/tool/heatingComparator/i18n/en.ts +2 -12
  26. package/src/tool/heatingComparator/i18n/es.ts +2 -16
  27. package/src/tool/heatingComparator/i18n/fr.ts +2 -12
  28. package/src/tool/heatingComparator/i18n/id.ts +2 -16
  29. package/src/tool/heatingComparator/i18n/it.ts +2 -16
  30. package/src/tool/heatingComparator/i18n/ja.ts +296 -310
  31. package/src/tool/heatingComparator/i18n/ko.ts +296 -306
  32. package/src/tool/heatingComparator/i18n/nl.ts +2 -16
  33. package/src/tool/heatingComparator/i18n/pl.ts +2 -16
  34. package/src/tool/heatingComparator/i18n/pt.ts +2 -16
  35. package/src/tool/heatingComparator/i18n/ru.ts +2 -12
  36. package/src/tool/heatingComparator/i18n/sv.ts +2 -16
  37. package/src/tool/heatingComparator/i18n/tr.ts +2 -16
  38. package/src/tool/heatingComparator/i18n/zh.ts +296 -306
  39. package/src/tool/heatingComparator/seo.astro +3 -3
  40. package/src/tool/ledSavingCalculator/bibliography.ts +14 -0
  41. package/src/tool/ledSavingCalculator/i18n/de.ts +2 -12
  42. package/src/tool/ledSavingCalculator/i18n/en.ts +2 -16
  43. package/src/tool/ledSavingCalculator/i18n/es.ts +2 -16
  44. package/src/tool/ledSavingCalculator/i18n/fr.ts +2 -16
  45. package/src/tool/ledSavingCalculator/i18n/id.ts +2 -12
  46. package/src/tool/ledSavingCalculator/i18n/it.ts +2 -12
  47. package/src/tool/ledSavingCalculator/i18n/ja.ts +2 -12
  48. package/src/tool/ledSavingCalculator/i18n/ko.ts +2 -12
  49. package/src/tool/ledSavingCalculator/i18n/nl.ts +2 -12
  50. package/src/tool/ledSavingCalculator/i18n/pl.ts +2 -12
  51. package/src/tool/ledSavingCalculator/i18n/pt.ts +2 -12
  52. package/src/tool/ledSavingCalculator/i18n/ru.ts +2 -12
  53. package/src/tool/ledSavingCalculator/i18n/sv.ts +2 -12
  54. package/src/tool/ledSavingCalculator/i18n/tr.ts +2 -12
  55. package/src/tool/ledSavingCalculator/i18n/zh.ts +2 -12
  56. package/src/tool/ledSavingCalculator/seo.astro +2 -1
  57. package/src/tool/projectorCalculator/bibliography.ts +5 -0
  58. package/src/tool/projectorCalculator/i18n/de.ts +2 -6
  59. package/src/tool/projectorCalculator/i18n/en.ts +2 -7
  60. package/src/tool/projectorCalculator/i18n/es.ts +2 -7
  61. package/src/tool/projectorCalculator/i18n/fr.ts +2 -7
  62. package/src/tool/projectorCalculator/i18n/id.ts +2 -7
  63. package/src/tool/projectorCalculator/i18n/it.ts +2 -6
  64. package/src/tool/projectorCalculator/i18n/ja.ts +175 -179
  65. package/src/tool/projectorCalculator/i18n/ko.ts +175 -179
  66. package/src/tool/projectorCalculator/i18n/nl.ts +2 -6
  67. package/src/tool/projectorCalculator/i18n/pl.ts +2 -6
  68. package/src/tool/projectorCalculator/i18n/pt.ts +2 -6
  69. package/src/tool/projectorCalculator/i18n/ru.ts +2 -6
  70. package/src/tool/projectorCalculator/i18n/sv.ts +2 -6
  71. package/src/tool/projectorCalculator/i18n/tr.ts +2 -6
  72. package/src/tool/projectorCalculator/i18n/zh.ts +175 -179
  73. package/src/tool/projectorCalculator/seo.astro +2 -1
  74. package/src/tool/qrGenerator/bibliography.ts +14 -0
  75. package/src/tool/qrGenerator/i18n/de.ts +192 -202
  76. package/src/tool/qrGenerator/i18n/en.ts +2 -16
  77. package/src/tool/qrGenerator/i18n/es.ts +2 -16
  78. package/src/tool/qrGenerator/i18n/fr.ts +2 -16
  79. package/src/tool/qrGenerator/i18n/id.ts +146 -150
  80. package/src/tool/qrGenerator/i18n/it.ts +169 -173
  81. package/src/tool/qrGenerator/i18n/ja.ts +146 -150
  82. package/src/tool/qrGenerator/i18n/ko.ts +146 -150
  83. package/src/tool/qrGenerator/i18n/nl.ts +146 -150
  84. package/src/tool/qrGenerator/i18n/pl.ts +146 -150
  85. package/src/tool/qrGenerator/i18n/pt.ts +146 -150
  86. package/src/tool/qrGenerator/i18n/ru.ts +146 -150
  87. package/src/tool/qrGenerator/i18n/sv.ts +146 -150
  88. package/src/tool/qrGenerator/i18n/tr.ts +146 -150
  89. package/src/tool/qrGenerator/i18n/zh.ts +146 -150
  90. package/src/tool/qrGenerator/seo.astro +2 -1
  91. package/src/tool/solarCalculator/bibliography.ts +5 -0
  92. package/src/tool/solarCalculator/i18n/de.ts +141 -145
  93. package/src/tool/solarCalculator/i18n/en.ts +2 -7
  94. package/src/tool/solarCalculator/i18n/es.ts +2 -7
  95. package/src/tool/solarCalculator/i18n/fr.ts +2 -7
  96. package/src/tool/solarCalculator/i18n/id.ts +2 -6
  97. package/src/tool/solarCalculator/i18n/it.ts +2 -6
  98. package/src/tool/solarCalculator/i18n/ja.ts +121 -125
  99. package/src/tool/solarCalculator/i18n/ko.ts +116 -120
  100. package/src/tool/solarCalculator/i18n/nl.ts +2 -5
  101. package/src/tool/solarCalculator/i18n/pl.ts +2 -6
  102. package/src/tool/solarCalculator/i18n/pt.ts +2 -6
  103. package/src/tool/solarCalculator/i18n/ru.ts +2 -5
  104. package/src/tool/solarCalculator/i18n/sv.ts +2 -5
  105. package/src/tool/solarCalculator/i18n/tr.ts +2 -5
  106. package/src/tool/solarCalculator/i18n/zh.ts +116 -120
  107. package/src/tool/solarCalculator/seo.astro +2 -1
  108. package/src/tool/tariffComparator/bibliography.ts +7 -0
  109. package/src/tool/tariffComparator/i18n/de.ts +129 -132
  110. package/src/tool/tariffComparator/i18n/en.ts +2 -9
  111. package/src/tool/tariffComparator/i18n/es.ts +2 -9
  112. package/src/tool/tariffComparator/i18n/fr.ts +2 -9
  113. package/src/tool/tariffComparator/i18n/id.ts +2 -5
  114. package/src/tool/tariffComparator/i18n/it.ts +2 -5
  115. package/src/tool/tariffComparator/i18n/ja.ts +129 -132
  116. package/src/tool/tariffComparator/i18n/ko.ts +129 -132
  117. package/src/tool/tariffComparator/i18n/nl.ts +2 -5
  118. package/src/tool/tariffComparator/i18n/pl.ts +2 -5
  119. package/src/tool/tariffComparator/i18n/pt.ts +2 -5
  120. package/src/tool/tariffComparator/i18n/ru.ts +2 -5
  121. package/src/tool/tariffComparator/i18n/sv.ts +2 -5
  122. package/src/tool/tariffComparator/i18n/tr.ts +2 -5
  123. package/src/tool/tariffComparator/i18n/zh.ts +129 -132
  124. package/src/tool/tariffComparator/seo.astro +2 -1
  125. package/src/types.ts +0 -2
@@ -1,6 +1,7 @@
1
1
  import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { TariffComparatorUI } from '../ui';
4
+ import { bibliography } from '../bibliography';
4
5
 
5
6
  const slug = 'sravnenie-tarifov-elektrichestva';
6
7
  const title = 'Сравнение тарифов ЖКХ: Свободный vs Регулируемый';
@@ -59,12 +60,8 @@ export const content: ToolLocaleContent<TariffComparatorUI> = {
59
60
  slug,
60
61
  title,
61
62
  description,
62
- faqTitle: 'Часто задаваемые вопросы',
63
63
  faq: faqData,
64
- bibliographyTitle: 'Библиография',
65
- bibliography: [
66
- { name: 'Федеральная антимонопольная служба — Тарифы', url: 'https://fas.gov.ru' },
67
- ],
64
+ bibliography,
68
65
  howTo: howToData,
69
66
  schemas: [faqSchema, howToSchema, appSchema],
70
67
  seo: [
@@ -1,6 +1,7 @@
1
1
  import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { TariffComparatorUI } from '../ui';
4
+ import { bibliography } from '../bibliography';
4
5
 
5
6
  const slug = 'jamfor-deltra-priser';
6
7
  const title = 'Jämför Elavtal: Rörligt vs Fast Pris';
@@ -64,12 +65,8 @@ export const content: ToolLocaleContent<TariffComparatorUI> = {
64
65
  slug,
65
66
  title,
66
67
  description,
67
- faqTitle: 'Vanliga Frågor',
68
68
  faq: faqData,
69
- bibliographyTitle: 'Referenser',
70
- bibliography: [
71
- { name: 'Energimarknadsinspektionen', url: 'https://www.ei.se' },
72
- ],
69
+ bibliography,
73
70
  howTo: howToData,
74
71
  schemas: [faqSchema, howToSchema, appSchema],
75
72
  seo: [
@@ -1,6 +1,7 @@
1
1
  import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { TariffComparatorUI } from '../ui';
4
+ import { bibliography } from '../bibliography';
4
5
 
5
6
  const slug = 'elektrik-tarifesi-karsilastirma';
6
7
  const title = 'Elektrik Tarifesi Karşılaştırıcı: Sabit vs Değişken';
@@ -77,12 +78,8 @@ export const content: ToolLocaleContent<TariffComparatorUI> = {
77
78
  slug,
78
79
  title,
79
80
  description,
80
- faqTitle: 'Sıkça Sorulan Sorular',
81
81
  faq: faqData,
82
- bibliographyTitle: 'Kaynakça',
83
- bibliography: [
84
- { name: 'EPDK — Enerji Piyasası Düzenleme Kurumu', url: 'https://www.epdk.gov.tr' },
85
- ],
82
+ bibliography,
86
83
  howTo: howToData,
87
84
  schemas: [faqSchema, howToSchema, appSchema],
88
85
  seo: [
@@ -1,133 +1,130 @@
1
- import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
- import type { ToolLocaleContent } from '../../../types';
3
- import type { TariffComparatorUI } from '../ui';
4
-
5
- const slug = 'electricity-tariff-comparator';
6
- const title = '电费套餐对比:自由市场 vs 监管市场';
7
- const description =
8
- '了解哪种电费套餐最适合您。根据您的实际用电量对比自由市场套餐与监管市场套餐。';
9
-
10
- const faqData = [
11
- {
12
- question: '固定价格和动态价格哪个更好?',
13
- answer:
14
- '固定价格提供可预测性。动态价格(如监管市场)在发电量充沛时可能极低,但存在波动风险。本计算器可帮您做出选择。',
15
- },
16
- {
17
- question: '如何获取我的年用电量?',
18
- answer:
19
- '您可以在最新的电费账单中找到“年用电量”(kWh) 这一数值。',
20
- },
21
- {
22
- question: '什么是合同功率?',
23
- answer:
24
- '指您可以同时使用的最大电力负荷 (kW)。',
25
- },
26
- ];
27
-
28
- const howToData = [
29
- {
30
- name: '查看账单',
31
- text: '查找年用电量 (kWh) 和合同功率 (kW)。',
32
- },
33
- {
34
- name: '调整数值',
35
- text: '根据您的实际数据调节滑块。',
36
- },
37
- {
38
- name: '对比结果',
39
- text: '查看两种模式下的预估年支出差异。',
40
- },
41
- ];
42
-
43
- const faqSchema: WithContext<FAQPage> = {
44
- '@context': 'https://schema.org',
45
- '@type': 'FAQPage',
46
- mainEntity: faqData.map((item) => ({
47
- '@type': 'Question',
48
- name: item.question,
49
- acceptedAnswer: { '@type': 'Answer', text: item.answer },
50
- })),
51
- };
52
-
53
- const howToSchema: WithContext<HowTo> = {
54
- '@context': 'https://schema.org',
55
- '@type': 'HowTo',
56
- name: title,
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { TariffComparatorUI } from '../ui';
4
+ import { bibliography } from '../bibliography';
5
+
6
+ const slug = 'electricity-tariff-comparator';
7
+ const title = '电费套餐对比:自由市场 vs 监管市场';
8
+ const description =
9
+ '了解哪种电费套餐最适合您。根据您的实际用电量对比自由市场套餐与监管市场套餐。';
10
+
11
+ const faqData = [
12
+ {
13
+ question: '固定价格和动态价格哪个更好?',
14
+ answer:
15
+ '固定价格提供可预测性。动态价格(如监管市场)在发电量充沛时可能极低,但存在波动风险。本计算器可帮您做出选择。',
16
+ },
17
+ {
18
+ question: '如何获取我的年用电量?',
19
+ answer:
20
+ '您可以在最新的电费账单中找到“年用电量”(kWh) 这一数值。',
21
+ },
22
+ {
23
+ question: '什么是合同功率?',
24
+ answer:
25
+ '指您可以同时使用的最大电力负荷 (kW)。',
26
+ },
27
+ ];
28
+
29
+ const howToData = [
30
+ {
31
+ name: '查看账单',
32
+ text: '查找年用电量 (kWh) 和合同功率 (kW)。',
33
+ },
34
+ {
35
+ name: '调整数值',
36
+ text: '根据您的实际数据调节滑块。',
37
+ },
38
+ {
39
+ name: '对比结果',
40
+ text: '查看两种模式下的预估年支出差异。',
41
+ },
42
+ ];
43
+
44
+ const faqSchema: WithContext<FAQPage> = {
45
+ '@context': 'https://schema.org',
46
+ '@type': 'FAQPage',
47
+ mainEntity: faqData.map((item) => ({
48
+ '@type': 'Question',
49
+ name: item.question,
50
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
51
+ })),
52
+ };
53
+
54
+ const howToSchema: WithContext<HowTo> = {
55
+ '@context': 'https://schema.org',
56
+ '@type': 'HowTo',
57
+ name: title,
58
+ description,
59
+ step: howToData.map((step) => ({
60
+ '@type': 'HowToStep',
61
+ name: step.name,
62
+ text: step.text,
63
+ })),
64
+ };
65
+
66
+ const appSchema: WithContext<SoftwareApplication> = {
67
+ '@context': 'https://schema.org',
68
+ '@type': 'SoftwareApplication',
69
+ name: title,
70
+ description,
71
+ applicationCategory: 'UtilityApplication',
72
+ operatingSystem: 'All',
73
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'CNY' },
74
+ inLanguage: 'zh',
75
+ };
76
+
77
+ export const content: ToolLocaleContent<TariffComparatorUI> = {
78
+ slug,
79
+ title,
57
80
  description,
58
- step: howToData.map((step) => ({
59
- '@type': 'HowToStep',
60
- name: step.name,
61
- text: step.text,
62
- })),
63
- };
64
-
65
- const appSchema: WithContext<SoftwareApplication> = {
66
- '@context': 'https://schema.org',
67
- '@type': 'SoftwareApplication',
68
- name: title,
69
- description,
70
- applicationCategory: 'UtilityApplication',
71
- operatingSystem: 'All',
72
- offers: { '@type': 'Offer', price: '0', priceCurrency: 'CNY' },
73
- inLanguage: 'zh',
74
- };
75
-
76
- export const content: ToolLocaleContent<TariffComparatorUI> = {
77
- slug,
78
- title,
79
- description,
80
- faqTitle: '常见问题',
81
- faq: faqData,
82
- bibliographyTitle: '参考资料',
83
- bibliography: [
84
- { name: '能源监管部门官方指南', url: 'https://www.nea.gov.cn' },
85
- ],
86
- howTo: howToData,
87
- schemas: [faqSchema, howToSchema, appSchema],
88
- seo: [
89
- {
90
- type: 'title',
91
- text: '节省您的电力开支',
92
- level: 2,
93
- },
94
- {
95
- type: 'paragraph',
96
- html: '选择合适的套餐每年可节省数百元。利用我们的对比工具做出决定。',
97
- },
98
- {
99
- type: 'summary',
100
- title: '省钱策略',
101
- items: [
102
- '定期对比市场上的新套餐。',
103
- '合理设定合同功率,避免不必要的月租费。',
104
- '尽量将大功率用电安排在低谷时段。',
105
- ],
106
- },
107
- ],
108
- ui: {
109
- labelConsumption: '年用电量',
110
- unitKwhYear: 'kWh/年',
111
- labelPower: '合同功率',
112
- unitKw: 'kW',
113
- labelMarket: '监管市场 (动态)',
114
- labelFree: '自由市场 (固定)',
115
- labelAnnualEst: '预估年支出',
116
- labelPowerTerm: '功率费 (固定)',
117
- labelEnergyTerm: '电费 (变量)',
118
- labelDashboard: '能源面板',
119
- labelMaxPower: '峰值功率',
120
- labelMaxPowerEst: '预估峰值',
121
- labelCo2: '碳足迹',
122
- labelCo2Est: '预估年排放量',
123
- labelSimulator: '方案模拟器',
124
- labelSolar: '太阳能自用',
125
- labelSolarDesc: '模拟安装电池板后的节省(默认减少 30% 用电)',
126
- labelShift: '低谷时段转移',
127
- labelShiftDesc: '转移至低谷时段的比例:',
128
- badgeBetter: '更佳性价比',
129
- badgeWorseYear: '年',
130
- currencySign: '¥',
131
- monthLabels: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月',
132
- },
133
- };
81
+ faq: faqData,
82
+ bibliography,
83
+ howTo: howToData,
84
+ schemas: [faqSchema, howToSchema, appSchema],
85
+ seo: [
86
+ {
87
+ type: 'title',
88
+ text: '节省您的电力开支',
89
+ level: 2,
90
+ },
91
+ {
92
+ type: 'paragraph',
93
+ html: '选择合适的套餐每年可节省数百元。利用我们的对比工具做出决定。',
94
+ },
95
+ {
96
+ type: 'summary',
97
+ title: '省钱策略',
98
+ items: [
99
+ '定期对比市场上的新套餐。',
100
+ '合理设定合同功率,避免不必要的月租费。',
101
+ '尽量将大功率用电安排在低谷时段。',
102
+ ],
103
+ },
104
+ ],
105
+ ui: {
106
+ labelConsumption: '年用电量',
107
+ unitKwhYear: 'kWh/年',
108
+ labelPower: '合同功率',
109
+ unitKw: 'kW',
110
+ labelMarket: '监管市场 (动态)',
111
+ labelFree: '自由市场 (固定)',
112
+ labelAnnualEst: '预估年支出',
113
+ labelPowerTerm: '功率费 (固定)',
114
+ labelEnergyTerm: '电费 (变量)',
115
+ labelDashboard: '能源面板',
116
+ labelMaxPower: '峰值功率',
117
+ labelMaxPowerEst: '预估峰值',
118
+ labelCo2: '碳足迹',
119
+ labelCo2Est: '预估年排放量',
120
+ labelSimulator: '方案模拟器',
121
+ labelSolar: '太阳能自用',
122
+ labelSolarDesc: '模拟安装电池板后的节省(默认减少 30% 用电)',
123
+ labelShift: '低谷时段转移',
124
+ labelShiftDesc: '转移至低谷时段的比例:',
125
+ badgeBetter: '更佳性价比',
126
+ badgeWorseYear: '',
127
+ currencySign: '¥',
128
+ monthLabels: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月',
129
+ },
130
+ };
@@ -11,4 +11,5 @@ const { locale = 'es' } = Astro.props;
11
11
  const content = await tariffComparator.i18n[locale]?.();
12
12
  if (!content) return null;
13
13
  ---
14
- <SEORenderer content={{ locale: locale as string, sections: content.seo }} />
14
+
15
+ {content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
package/src/types.ts CHANGED
@@ -29,9 +29,7 @@ export interface ToolLocaleContent<TUI extends Record<string, string> = Record<s
29
29
  description: string;
30
30
  ui: TUI;
31
31
  seo: SEOSection[];
32
- faqTitle?: string;
33
32
  faq: FAQItem[];
34
- bibliographyTitle?: string;
35
33
  bibliography: BibliographyEntry[];
36
34
  howTo: HowToStep[];
37
35
  schemas: WithContext<Thing>[];