@jjlmoya/utils-nature 1.13.0 → 1.15.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 (84) hide show
  1. package/package.json +1 -1
  2. package/src/category/i18n/fr.ts +6 -6
  3. package/src/category/i18n/ru.ts +5 -5
  4. package/src/layouts/PreviewLayout.astro +1 -1
  5. package/src/pages/[locale]/[slug].astro +32 -14
  6. package/src/tests/diacritics_density.test.ts +118 -0
  7. package/src/tests/inverted_punctuation.test.ts +84 -0
  8. package/src/tests/locale_completeness.test.ts +1 -31
  9. package/src/tests/no_en_dash.test.ts +71 -0
  10. package/src/tests/script_density.test.ts +94 -0
  11. package/src/tests/shared-test-helpers.ts +56 -0
  12. package/src/tests/tool_exports.test.ts +34 -0
  13. package/src/tool/cricketThermometer/bibliography.ts +12 -0
  14. package/src/tool/cricketThermometer/i18n/de.ts +6 -18
  15. package/src/tool/cricketThermometer/i18n/en.ts +3 -15
  16. package/src/tool/cricketThermometer/i18n/es.ts +3 -15
  17. package/src/tool/cricketThermometer/i18n/fr.ts +9 -21
  18. package/src/tool/cricketThermometer/i18n/id.ts +3 -15
  19. package/src/tool/cricketThermometer/i18n/it.ts +3 -15
  20. package/src/tool/cricketThermometer/i18n/ja.ts +3 -15
  21. package/src/tool/cricketThermometer/i18n/ko.ts +3 -15
  22. package/src/tool/cricketThermometer/i18n/nl.ts +3 -15
  23. package/src/tool/cricketThermometer/i18n/pl.ts +6 -18
  24. package/src/tool/cricketThermometer/i18n/pt.ts +3 -15
  25. package/src/tool/cricketThermometer/i18n/ru.ts +8 -20
  26. package/src/tool/cricketThermometer/i18n/sv.ts +3 -15
  27. package/src/tool/cricketThermometer/i18n/tr.ts +3 -15
  28. package/src/tool/cricketThermometer/i18n/zh.ts +8 -20
  29. package/src/tool/cricketThermometer/seo.astro +1 -1
  30. package/src/tool/cricketThermometer/ui.ts +0 -2
  31. package/src/tool/digitalCarbon/bibliography.ts +8 -0
  32. package/src/tool/digitalCarbon/digital-carbon-footprint-calculator.css +57 -1
  33. package/src/tool/digitalCarbon/i18n/de.ts +4 -10
  34. package/src/tool/digitalCarbon/i18n/en.ts +2 -8
  35. package/src/tool/digitalCarbon/i18n/es.ts +2 -8
  36. package/src/tool/digitalCarbon/i18n/fr.ts +6 -12
  37. package/src/tool/digitalCarbon/i18n/id.ts +2 -8
  38. package/src/tool/digitalCarbon/i18n/it.ts +2 -8
  39. package/src/tool/digitalCarbon/i18n/ja.ts +2 -8
  40. package/src/tool/digitalCarbon/i18n/ko.ts +2 -8
  41. package/src/tool/digitalCarbon/i18n/nl.ts +2 -8
  42. package/src/tool/digitalCarbon/i18n/pl.ts +2 -8
  43. package/src/tool/digitalCarbon/i18n/pt.ts +2 -8
  44. package/src/tool/digitalCarbon/i18n/ru.ts +3 -9
  45. package/src/tool/digitalCarbon/i18n/sv.ts +2 -8
  46. package/src/tool/digitalCarbon/i18n/tr.ts +2 -8
  47. package/src/tool/digitalCarbon/i18n/zh.ts +2 -8
  48. package/src/tool/digitalCarbon/seo.astro +1 -1
  49. package/src/tool/rainHarvester/bibliography.ts +20 -0
  50. package/src/tool/rainHarvester/i18n/de.ts +5 -23
  51. package/src/tool/rainHarvester/i18n/en.ts +2 -20
  52. package/src/tool/rainHarvester/i18n/es.ts +2 -20
  53. package/src/tool/rainHarvester/i18n/fr.ts +3 -21
  54. package/src/tool/rainHarvester/i18n/id.ts +2 -20
  55. package/src/tool/rainHarvester/i18n/it.ts +2 -20
  56. package/src/tool/rainHarvester/i18n/ja.ts +2 -20
  57. package/src/tool/rainHarvester/i18n/ko.ts +2 -20
  58. package/src/tool/rainHarvester/i18n/nl.ts +2 -20
  59. package/src/tool/rainHarvester/i18n/pl.ts +5 -23
  60. package/src/tool/rainHarvester/i18n/pt.ts +2 -20
  61. package/src/tool/rainHarvester/i18n/ru.ts +8 -26
  62. package/src/tool/rainHarvester/i18n/sv.ts +2 -20
  63. package/src/tool/rainHarvester/i18n/tr.ts +2 -20
  64. package/src/tool/rainHarvester/i18n/zh.ts +5 -23
  65. package/src/tool/rainHarvester/seo.astro +1 -1
  66. package/src/tool/seedCalculator/bibliography.ts +16 -0
  67. package/src/tool/seedCalculator/i18n/de.ts +2 -18
  68. package/src/tool/seedCalculator/i18n/en.ts +2 -18
  69. package/src/tool/seedCalculator/i18n/es.ts +2 -18
  70. package/src/tool/seedCalculator/i18n/fr.ts +3 -19
  71. package/src/tool/seedCalculator/i18n/id.ts +2 -18
  72. package/src/tool/seedCalculator/i18n/it.ts +2 -18
  73. package/src/tool/seedCalculator/i18n/ja.ts +2 -18
  74. package/src/tool/seedCalculator/i18n/ko.ts +2 -18
  75. package/src/tool/seedCalculator/i18n/nl.ts +2 -18
  76. package/src/tool/seedCalculator/i18n/pl.ts +3 -19
  77. package/src/tool/seedCalculator/i18n/pt.ts +2 -18
  78. package/src/tool/seedCalculator/i18n/ru.ts +6 -22
  79. package/src/tool/seedCalculator/i18n/sv.ts +2 -18
  80. package/src/tool/seedCalculator/i18n/tr.ts +2 -18
  81. package/src/tool/seedCalculator/i18n/zh.ts +2 -18
  82. package/src/tool/seedCalculator/seo.astro +8 -2
  83. package/src/tool/seedCalculator/ui.ts +0 -2
  84. package/src/types.ts +0 -2
@@ -1,4 +1,5 @@
1
1
  import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import { bibliography } from '../bibliography';
2
3
  import type { ToolLocaleContent } from '../../../types';
3
4
  import type { SeedCalculatorUI } from '../ui';
4
5
 
@@ -87,23 +88,8 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
87
88
  slug,
88
89
  title,
89
90
  description,
90
- faqTitle: 'Często zadawane pytania',
91
91
  faq: faqData,
92
- bibliographyTitle: 'Źródła Naukowe',
93
- bibliography: [
94
- {
95
- name: 'KWS Hiszpania',
96
- url: 'https://www.kws.com/es/es/',
97
- },
98
- {
99
- name: 'Hiszpańskie Ministerstwo Rolnictwa (MAPA)',
100
- url: 'https://www.mapa.gob.es/es/agricultura/temas/producciones-agricolas/cultivos-herbaceos/',
101
- },
102
- {
103
- name: 'Yara Hiszpania',
104
- url: 'https://www.yara.es/nutricion-vegetal/maiz/',
105
- },
106
- ],
92
+ bibliography,
107
93
  howTo: howToData,
108
94
  schemas: [faqSchema, howToSchema, appSchema],
109
95
  seo: [
@@ -119,7 +105,7 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
119
105
  {
120
106
  type: 'tip',
121
107
  title: 'Wzór matematyczny',
122
- html: '<p>Dla agronomów i ciekawskich oto podstawa obliczeń:</p><pre>Odstęp (cm) = 10 000 000 / (Obsada × Szerokość Rzędu)</pre><ul><li><strong>10 000 000:</strong> Współczynnik konwersji z Ha na cm².</li><li><strong>Obsada:</strong> Liczba nasion na hektar.</li><li><strong>Szerokość Rzędu:</strong> Odległość między rzędami w cm.</li></ul>',
108
+ html: '<p>Dla agronomów i ciekawskich - oto podstawa obliczeń:</p><pre>Odstęp (cm) = 10 000 000 / (Obsada × Szerokość Rzędu)</pre><ul><li><strong>10 000 000:</strong> Współczynnik konwersji z Ha na cm².</li><li><strong>Obsada:</strong> Liczba nasion na hektar.</li><li><strong>Szerokość Rzędu:</strong> Odległość między rzędami w cm.</li></ul>',
123
109
  },
124
110
  {
125
111
  type: 'title',
@@ -207,7 +193,5 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
207
193
  noteSoy: 'Wysoka obsada',
208
194
  noteBeet: 'Krytyczny płytki siew',
209
195
  noteRapeseed: 'Bardzo małe nasiona',
210
- faqTitle: 'Często zadawane pytania',
211
- bibliographyTitle: 'Źródła Naukowe',
212
196
  },
213
197
  };
@@ -1,4 +1,5 @@
1
1
  import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import { bibliography } from '../bibliography';
2
3
  import type { ToolLocaleContent } from '../../../types';
3
4
  import type { SeedCalculatorUI } from '../ui';
4
5
 
@@ -87,23 +88,8 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
87
88
  slug,
88
89
  title,
89
90
  description,
90
- faqTitle: 'Perguntas Frequentes',
91
91
  faq: faqData,
92
- bibliographyTitle: 'Referências Científicas',
93
- bibliography: [
94
- {
95
- name: 'KWS Espanha',
96
- url: 'https://www.kws.com/es/es/',
97
- },
98
- {
99
- name: 'Ministério da Agricultura de Espanha (MAPA)',
100
- url: 'https://www.mapa.gob.es/es/agricultura/temas/producciones-agricolas/cultivos-herbaceos/',
101
- },
102
- {
103
- name: 'Yara Espanha',
104
- url: 'https://www.yara.es/nutricion-vegetal/maiz/',
105
- },
106
- ],
92
+ bibliography,
107
93
  howTo: howToData,
108
94
  schemas: [faqSchema, howToSchema, appSchema],
109
95
  seo: [
@@ -207,7 +193,5 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
207
193
  noteSoy: 'Alta população',
208
194
  noteBeet: 'Sementeira superficial crítica',
209
195
  noteRapeseed: 'Semente muito pequena',
210
- faqTitle: 'Perguntas Frequentes',
211
- bibliographyTitle: 'Referências Científicas',
212
196
  },
213
197
  };
@@ -1,4 +1,5 @@
1
1
  import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import { bibliography } from '../bibliography';
2
3
  import type { ToolLocaleContent } from '../../../types';
3
4
  import type { SeedCalculatorUI } from '../ui';
4
5
 
@@ -26,7 +27,7 @@ const faqData = [
26
27
  {
27
28
  question: 'Почему так важна калибровка сеялки?',
28
29
  answer:
29
- 'Слишком густой посев вызывает конкуренцию между растениями и приводит к измельчанию зерна. Слишком редкий посев это потеря площади и потенциала урожайности. Точность ключ к прибыльности.',
30
+ 'Слишком густой посев вызывает конкуренцию между растениями и приводит к измельчанию зерна. Слишком редкий посев - это потеря площади и потенциала урожайности. Точность - ключ к прибыльности.',
30
31
  },
31
32
  ];
32
33
 
@@ -45,7 +46,7 @@ const howToData = [
45
46
  },
46
47
  {
47
48
  name: 'Получите настройки механизмов',
48
- text: 'Используйте значение «семян на метр» или «расстояние в см между семенами» для настройки звездочек или монитора на вашей машине.',
49
+ text: 'Используйте значение "семян на метр" или "расстояние в см между семенами" для настройки звездочек или монитора на вашей машине.',
49
50
  },
50
51
  ];
51
52
 
@@ -87,23 +88,8 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
87
88
  slug,
88
89
  title,
89
90
  description,
90
- faqTitle: 'Часто задаваемые вопросы',
91
91
  faq: faqData,
92
- bibliographyTitle: 'Научные источники',
93
- bibliography: [
94
- {
95
- name: 'KWS Испания',
96
- url: 'https://www.kws.com/es/es/',
97
- },
98
- {
99
- name: 'Министерство сельского хозяйства Испании (MAPA)',
100
- url: 'https://www.mapa.gob.es/es/agricultura/temas/producciones-agricolas/cultivos-herbaceos/',
101
- },
102
- {
103
- name: 'Yara Испания',
104
- url: 'https://www.yara.es/nutricion-vegetal/maiz/',
105
- },
106
- ],
92
+ bibliography,
107
93
  howTo: howToData,
108
94
  schemas: [faqSchema, howToSchema, appSchema],
109
95
  seo: [
@@ -119,7 +105,7 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
119
105
  {
120
106
  type: 'tip',
121
107
  title: 'Математическая формула',
122
- html: '<p>Для агрономов и любознательных вот основа расчета:</p><pre>Расстояние (см) = 10 000 000 / (Норма высева × Ширина междурядья)</pre><ul><li><strong>10 000 000:</strong> Коэффициент перевода из Га в см².</li><li><strong>Норма высева:</strong> Семян на гектар.</li><li><strong>Ширина междурядья:</strong> Расстояние между рядами в см.</li></ul>',
108
+ html: '<p>Для агрономов и любознательных - вот основа расчета:</p><pre>Расстояние (см) = 10 000 000 / (Норма высева × Ширина междурядья)</pre><ul><li><strong>10 000 000:</strong> Коэффициент перевода из Га в см².</li><li><strong>Норма высева:</strong> Семян на гектар.</li><li><strong>Ширина междурядья:</strong> Расстояние между рядами в см.</li></ul>',
123
109
  },
124
110
  {
125
111
  type: 'title',
@@ -150,7 +136,7 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
150
136
  },
151
137
  {
152
138
  type: 'paragraph',
153
- html: '<strong>Метод 1/1000 гектара:</strong> Отмерьте расстояние вдоль борозды, соответствующее 1/1000 гектара. Подсчитайте семена и умножьте на 1000. Для междурядья 70 см расстояние составляет 14,28 м; для 52,5 см 19,05 м.',
139
+ html: '<strong>Метод 1/1000 гектара:</strong> Отмерьте расстояние вдоль борозды, соответствующее 1/1000 гектара. Подсчитайте семена и умножьте на 1000. Для междурядья 70 см расстояние составляет 14,28 м; для 52,5 см - 19,05 м.',
154
140
  },
155
141
  {
156
142
  type: 'paragraph',
@@ -207,7 +193,5 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
207
193
  noteSoy: 'Высокая норма высева',
208
194
  noteBeet: 'Критичен мелкий посев',
209
195
  noteRapeseed: 'Очень мелкие семена',
210
- faqTitle: 'Часто задаваемые вопросы',
211
- bibliographyTitle: 'Научные источники',
212
196
  },
213
197
  };
@@ -1,4 +1,5 @@
1
1
  import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import { bibliography } from '../bibliography';
2
3
  import type { ToolLocaleContent } from '../../../types';
3
4
  import type { SeedCalculatorUI } from '../ui';
4
5
 
@@ -87,23 +88,8 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
87
88
  slug,
88
89
  title,
89
90
  description,
90
- faqTitle: 'Vanliga frågor',
91
91
  faq: faqData,
92
- bibliographyTitle: 'Vetenskapliga referenser',
93
- bibliography: [
94
- {
95
- name: 'KWS Spanien',
96
- url: 'https://www.kws.com/es/es/',
97
- },
98
- {
99
- name: 'Spanska jordbruksministeriet (MAPA)',
100
- url: 'https://www.mapa.gob.es/es/agricultura/temas/producciones-agricolas/cultivos-herbaceos/',
101
- },
102
- {
103
- name: 'Yara Spanien',
104
- url: 'https://www.yara.es/nutricion-vegetal/maiz/',
105
- },
106
- ],
92
+ bibliography,
107
93
  howTo: howToData,
108
94
  schemas: [faqSchema, howToSchema, appSchema],
109
95
  seo: [
@@ -207,7 +193,5 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
207
193
  noteSoy: 'Hög population',
208
194
  noteBeet: 'Kritiskt grund sådd',
209
195
  noteRapeseed: 'Mycket litet frö',
210
- faqTitle: 'Vanliga frågor',
211
- bibliographyTitle: 'Vetenskapliga referenser',
212
196
  },
213
197
  };
@@ -1,4 +1,5 @@
1
1
  import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import { bibliography } from '../bibliography';
2
3
  import type { ToolLocaleContent } from '../../../types';
3
4
  import type { SeedCalculatorUI } from '../ui';
4
5
 
@@ -87,23 +88,8 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
87
88
  slug,
88
89
  title,
89
90
  description,
90
- faqTitle: 'Sıkça Sorulan Sorular',
91
91
  faq: faqData,
92
- bibliographyTitle: 'Bilimsel Referanslar',
93
- bibliography: [
94
- {
95
- name: 'KWS İspanya',
96
- url: 'https://www.kws.com/es/es/',
97
- },
98
- {
99
- name: 'İspanya Tarım Bakanlığı (MAPA)',
100
- url: 'https://www.mapa.gob.es/es/agricultura/temas/producciones-agricolas/cultivos-herbaceos/',
101
- },
102
- {
103
- name: 'Yara İspanya',
104
- url: 'https://www.yara.es/nutricion-vegetal/maiz/',
105
- },
106
- ],
92
+ bibliography,
107
93
  howTo: howToData,
108
94
  schemas: [faqSchema, howToSchema, appSchema],
109
95
  seo: [
@@ -207,7 +193,5 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
207
193
  noteSoy: 'Yüksek popülasyon',
208
194
  noteBeet: 'Kritik sığ ekim',
209
195
  noteRapeseed: 'Çok küçük tohum',
210
- faqTitle: 'Sıkça Sorulan Sorular',
211
- bibliographyTitle: 'Bilimsel Referanslar',
212
196
  },
213
197
  };
@@ -1,4 +1,5 @@
1
1
  import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import { bibliography } from '../bibliography';
2
3
  import type { ToolLocaleContent } from '../../../types';
3
4
  import type { SeedCalculatorUI } from '../ui';
4
5
 
@@ -87,23 +88,8 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
87
88
  slug,
88
89
  title,
89
90
  description,
90
- faqTitle: '常见问题',
91
91
  faq: faqData,
92
- bibliographyTitle: '科学参考文献',
93
- bibliography: [
94
- {
95
- name: 'KWS 西班牙',
96
- url: 'https://www.kws.com/es/es/',
97
- },
98
- {
99
- name: '西班牙农业部 (MAPA)',
100
- url: 'https://www.mapa.gob.es/es/agricultura/temas/producciones-agricolas/cultivos-herbaceos/',
101
- },
102
- {
103
- name: 'Yara 西班牙',
104
- url: 'https://www.yara.es/nutricion-vegetal/maiz/',
105
- },
106
- ],
92
+ bibliography,
107
93
  howTo: howToData,
108
94
  schemas: [faqSchema, howToSchema, appSchema],
109
95
  seo: [
@@ -207,7 +193,5 @@ export const content: ToolLocaleContent<SeedCalculatorUI> = {
207
193
  noteSoy: '高密度植株',
208
194
  noteBeet: '关键浅播作业',
209
195
  noteRapeseed: '种子极其细小',
210
- faqTitle: '常见问题',
211
- bibliographyTitle: '科学参考文献',
212
196
  },
213
197
  };
@@ -1,9 +1,15 @@
1
1
  ---
2
2
  import { SEORenderer } from '@jjlmoya/utils-shared';
3
3
  import { seedCalculator } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
4
9
 
5
10
  const { locale = 'es' } = Astro.props;
6
- const content = await seedCalculator.i18n[locale as keyof typeof seedCalculator.i18n]?.();
11
+ const content = await seedCalculator.i18n[locale]?.();
7
12
  if (!content) return null;
8
13
  ---
9
- <SEORenderer content={{ locale: locale as string, sections: content.seo }} />
14
+
15
+ {content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
@@ -34,6 +34,4 @@ export interface SeedCalculatorUI extends Record<string, string> {
34
34
  noteSoy: string;
35
35
  noteBeet: string;
36
36
  noteRapeseed: string;
37
- faqTitle: string;
38
- bibliographyTitle: string;
39
37
  }
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>[];