@jjlmoya/utils-textiles 1.20.0 → 1.22.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 (209) hide show
  1. package/package.json +1 -1
  2. package/src/category/i18n/de.ts +76 -76
  3. package/src/category/i18n/en.ts +76 -76
  4. package/src/category/i18n/es.ts +76 -76
  5. package/src/category/i18n/fr.ts +76 -76
  6. package/src/category/i18n/id.ts +76 -76
  7. package/src/category/i18n/it.ts +76 -76
  8. package/src/category/i18n/ja.ts +76 -76
  9. package/src/category/i18n/ko.ts +76 -76
  10. package/src/category/i18n/nl.ts +76 -76
  11. package/src/category/i18n/pl.ts +76 -76
  12. package/src/category/i18n/pt.ts +76 -76
  13. package/src/category/i18n/ru.ts +76 -76
  14. package/src/category/i18n/sv.ts +76 -76
  15. package/src/category/i18n/zh.ts +76 -76
  16. package/src/category/index.ts +2 -0
  17. package/src/category/seo.astro +1 -1
  18. package/src/components/PreviewNavSidebar.astro +1 -1
  19. package/src/components/PreviewToolbar.astro +1 -1
  20. package/src/data.ts +1 -1
  21. package/src/entries.ts +4 -1
  22. package/src/env.d.ts +1 -1
  23. package/src/index.ts +1 -1
  24. package/src/layouts/PreviewLayout.astro +113 -113
  25. package/src/pages/index.astro +1 -1
  26. package/src/tests/faq_count.test.ts +19 -19
  27. package/src/tests/i18n_coverage.test.ts +4 -2
  28. package/src/tests/locale_spelling.test.ts +44 -0
  29. package/src/tests/mocks/astro_mock.js +1 -1
  30. package/src/tests/no_en_dash.test.ts +70 -70
  31. package/src/tests/no_h1_in_components.test.ts +1 -1
  32. package/src/tests/seo_length.test.ts +22 -22
  33. package/src/tests/seo_translation_completeness.test.ts +69 -0
  34. package/src/tests/spanish_leakage.test.ts +175 -153
  35. package/src/tests/tool_validation.test.ts +17 -17
  36. package/src/tool/burnTest/i18n/es.ts +211 -211
  37. package/src/tool/burnTest/i18n/fr.ts +211 -211
  38. package/src/tool/burnTest/i18n/ja.ts +211 -211
  39. package/src/tool/burnTest/i18n/ko.ts +211 -211
  40. package/src/tool/burnTest/i18n/pl.ts +211 -211
  41. package/src/tool/burnTest/i18n/ru.ts +211 -211
  42. package/src/tool/burnTest/i18n/sv.ts +211 -211
  43. package/src/tool/burnTest/i18n/zh.ts +211 -211
  44. package/src/tool/burnTest/seo.astro +15 -15
  45. package/src/tool/clothingSizeConverter/i18n/de.ts +348 -348
  46. package/src/tool/clothingSizeConverter/i18n/en.ts +348 -348
  47. package/src/tool/clothingSizeConverter/i18n/fr.ts +348 -348
  48. package/src/tool/clothingSizeConverter/i18n/ja.ts +348 -348
  49. package/src/tool/clothingSizeConverter/i18n/ko.ts +348 -348
  50. package/src/tool/clothingSizeConverter/i18n/nl.ts +348 -348
  51. package/src/tool/clothingSizeConverter/i18n/pl.ts +348 -348
  52. package/src/tool/clothingSizeConverter/i18n/ru.ts +348 -348
  53. package/src/tool/clothingSizeConverter/i18n/sv.ts +348 -348
  54. package/src/tool/clothingSizeConverter/i18n/tr.ts +348 -348
  55. package/src/tool/clothingSizeConverter/i18n/zh.ts +348 -348
  56. package/src/tool/clothingSizeConverter/seo.astro +15 -15
  57. package/src/tool/embroideryStitchPricingEstimator/bibliography.astro +6 -0
  58. package/src/tool/embroideryStitchPricingEstimator/bibliography.ts +12 -0
  59. package/src/tool/embroideryStitchPricingEstimator/component.astro +111 -0
  60. package/src/tool/embroideryStitchPricingEstimator/controller.ts +111 -0
  61. package/src/tool/embroideryStitchPricingEstimator/dom-views.ts +94 -0
  62. package/src/tool/embroideryStitchPricingEstimator/embroidery-stitch-count-pricing-estimator.css +438 -0
  63. package/src/tool/embroideryStitchPricingEstimator/entry.ts +29 -0
  64. package/src/tool/embroideryStitchPricingEstimator/evaluator.ts +22 -0
  65. package/src/tool/embroideryStitchPricingEstimator/i18n/de.ts +38 -0
  66. package/src/tool/embroideryStitchPricingEstimator/i18n/en.ts +194 -0
  67. package/src/tool/embroideryStitchPricingEstimator/i18n/es.ts +38 -0
  68. package/src/tool/embroideryStitchPricingEstimator/i18n/fr.ts +38 -0
  69. package/src/tool/embroideryStitchPricingEstimator/i18n/id.ts +38 -0
  70. package/src/tool/embroideryStitchPricingEstimator/i18n/it.ts +38 -0
  71. package/src/tool/embroideryStitchPricingEstimator/i18n/ja.ts +38 -0
  72. package/src/tool/embroideryStitchPricingEstimator/i18n/ko.ts +38 -0
  73. package/src/tool/embroideryStitchPricingEstimator/i18n/nl.ts +38 -0
  74. package/src/tool/embroideryStitchPricingEstimator/i18n/pl.ts +38 -0
  75. package/src/tool/embroideryStitchPricingEstimator/i18n/pt.ts +38 -0
  76. package/src/tool/embroideryStitchPricingEstimator/i18n/ru.ts +38 -0
  77. package/src/tool/embroideryStitchPricingEstimator/i18n/sv.ts +38 -0
  78. package/src/tool/embroideryStitchPricingEstimator/i18n/tr.ts +38 -0
  79. package/src/tool/embroideryStitchPricingEstimator/i18n/zh.ts +38 -0
  80. package/src/tool/embroideryStitchPricingEstimator/index.ts +11 -0
  81. package/src/tool/embroideryStitchPricingEstimator/logic.test.ts +40 -0
  82. package/src/tool/embroideryStitchPricingEstimator/logic.ts +86 -0
  83. package/src/tool/embroideryStitchPricingEstimator/seo.astro +15 -0
  84. package/src/tool/embroideryStitchPricingEstimator/storage.ts +20 -0
  85. package/src/tool/embroideryStitchPricingEstimator/ui.ts +53 -0
  86. package/src/tool/fabricProjectCalculator/i18n/de.ts +236 -236
  87. package/src/tool/fabricProjectCalculator/i18n/ja.ts +236 -236
  88. package/src/tool/fabricProjectCalculator/i18n/ko.ts +236 -236
  89. package/src/tool/fabricProjectCalculator/i18n/nl.ts +236 -236
  90. package/src/tool/fabricProjectCalculator/i18n/pl.ts +236 -236
  91. package/src/tool/fabricProjectCalculator/i18n/ru.ts +236 -236
  92. package/src/tool/fabricProjectCalculator/i18n/sv.ts +236 -236
  93. package/src/tool/fabricProjectCalculator/i18n/tr.ts +236 -236
  94. package/src/tool/fabricProjectCalculator/i18n/zh.ts +236 -236
  95. package/src/tool/fabricProjectCalculator/seo.astro +15 -15
  96. package/src/tool/fabricTruth/i18n/de.ts +268 -268
  97. package/src/tool/fabricTruth/i18n/en.ts +268 -268
  98. package/src/tool/fabricTruth/i18n/es.ts +302 -302
  99. package/src/tool/fabricTruth/i18n/fr.ts +268 -268
  100. package/src/tool/fabricTruth/i18n/id.ts +268 -268
  101. package/src/tool/fabricTruth/i18n/it.ts +268 -268
  102. package/src/tool/fabricTruth/i18n/ja.ts +268 -268
  103. package/src/tool/fabricTruth/i18n/ko.ts +268 -268
  104. package/src/tool/fabricTruth/i18n/nl.ts +268 -268
  105. package/src/tool/fabricTruth/i18n/pl.ts +268 -268
  106. package/src/tool/fabricTruth/i18n/pt.ts +268 -268
  107. package/src/tool/fabricTruth/i18n/ru.ts +268 -268
  108. package/src/tool/fabricTruth/i18n/sv.ts +268 -268
  109. package/src/tool/fabricTruth/i18n/tr.ts +268 -268
  110. package/src/tool/fabricTruth/i18n/zh.ts +272 -272
  111. package/src/tool/fabricTruth/seo.astro +15 -15
  112. package/src/tool/fiberPrep/i18n/de.ts +215 -215
  113. package/src/tool/fiberPrep/i18n/fr.ts +215 -215
  114. package/src/tool/fiberPrep/i18n/ja.ts +215 -215
  115. package/src/tool/fiberPrep/i18n/ko.ts +215 -215
  116. package/src/tool/fiberPrep/i18n/nl.ts +215 -215
  117. package/src/tool/fiberPrep/i18n/pl.ts +215 -215
  118. package/src/tool/fiberPrep/i18n/ru.ts +215 -215
  119. package/src/tool/fiberPrep/i18n/sv.ts +215 -215
  120. package/src/tool/fiberPrep/i18n/tr.ts +215 -215
  121. package/src/tool/fiberPrep/i18n/zh.ts +215 -215
  122. package/src/tool/fiberPrep/seo.astro +15 -15
  123. package/src/tool/knittingGauge/i18n/de.ts +224 -224
  124. package/src/tool/knittingGauge/i18n/ja.ts +224 -224
  125. package/src/tool/knittingGauge/i18n/ko.ts +224 -224
  126. package/src/tool/knittingGauge/i18n/pl.ts +224 -224
  127. package/src/tool/knittingGauge/i18n/ru.ts +224 -224
  128. package/src/tool/knittingGauge/i18n/tr.ts +224 -224
  129. package/src/tool/knittingGauge/i18n/zh.ts +224 -224
  130. package/src/tool/knittingGauge/seo.astro +15 -15
  131. package/src/tool/laundryGuide/i18n/de.ts +271 -271
  132. package/src/tool/laundryGuide/i18n/en.ts +271 -271
  133. package/src/tool/laundryGuide/i18n/es.ts +271 -271
  134. package/src/tool/laundryGuide/i18n/fr.ts +255 -255
  135. package/src/tool/laundryGuide/i18n/id.ts +271 -271
  136. package/src/tool/laundryGuide/i18n/it.ts +271 -271
  137. package/src/tool/laundryGuide/i18n/ja.ts +271 -271
  138. package/src/tool/laundryGuide/i18n/ko.ts +271 -271
  139. package/src/tool/laundryGuide/i18n/nl.ts +271 -271
  140. package/src/tool/laundryGuide/i18n/pl.ts +271 -271
  141. package/src/tool/laundryGuide/i18n/pt.ts +271 -271
  142. package/src/tool/laundryGuide/i18n/ru.ts +271 -271
  143. package/src/tool/laundryGuide/i18n/sv.ts +271 -271
  144. package/src/tool/laundryGuide/i18n/tr.ts +271 -271
  145. package/src/tool/laundryGuide/i18n/zh.ts +271 -271
  146. package/src/tool/laundryGuide/seo.astro +15 -15
  147. package/src/tool/needleConverter/i18n/de.ts +202 -202
  148. package/src/tool/needleConverter/i18n/es.ts +207 -207
  149. package/src/tool/needleConverter/i18n/fr.ts +207 -207
  150. package/src/tool/needleConverter/i18n/ja.ts +202 -202
  151. package/src/tool/needleConverter/i18n/ko.ts +202 -202
  152. package/src/tool/needleConverter/i18n/nl.ts +202 -202
  153. package/src/tool/needleConverter/i18n/pl.ts +202 -202
  154. package/src/tool/needleConverter/i18n/ru.ts +202 -202
  155. package/src/tool/needleConverter/i18n/sv.ts +202 -202
  156. package/src/tool/needleConverter/i18n/tr.ts +202 -202
  157. package/src/tool/needleConverter/i18n/zh.ts +202 -202
  158. package/src/tool/needleConverter/seo.astro +15 -15
  159. package/src/tool/sewingPatternScaler/component.astro +236 -236
  160. package/src/tool/sewingPatternScaler/i18n/fr.ts +170 -170
  161. package/src/tool/sewingPatternScaler/i18n/ja.ts +114 -114
  162. package/src/tool/sewingPatternScaler/i18n/ko.ts +114 -114
  163. package/src/tool/sewingPatternScaler/i18n/nl.ts +114 -114
  164. package/src/tool/sewingPatternScaler/i18n/pl.ts +114 -114
  165. package/src/tool/sewingPatternScaler/i18n/ru.ts +114 -114
  166. package/src/tool/sewingPatternScaler/i18n/sv.ts +114 -114
  167. package/src/tool/sewingPatternScaler/i18n/tr.ts +114 -114
  168. package/src/tool/sewingPatternScaler/i18n/zh.ts +114 -114
  169. package/src/tool/sewingPatternScaler/seo.astro +15 -15
  170. package/src/tool/shoeSizeConverter/i18n/fr.ts +183 -183
  171. package/src/tool/shoeSizeConverter/i18n/ja.ts +179 -179
  172. package/src/tool/shoeSizeConverter/i18n/ko.ts +179 -179
  173. package/src/tool/shoeSizeConverter/i18n/nl.ts +179 -179
  174. package/src/tool/shoeSizeConverter/i18n/pl.ts +179 -179
  175. package/src/tool/shoeSizeConverter/i18n/ru.ts +179 -179
  176. package/src/tool/shoeSizeConverter/i18n/sv.ts +179 -179
  177. package/src/tool/shoeSizeConverter/i18n/tr.ts +179 -179
  178. package/src/tool/shoeSizeConverter/i18n/zh.ts +179 -179
  179. package/src/tool/shoeSizeConverter/seo.astro +15 -15
  180. package/src/tool/stainChemistry/bibliography.ts +16 -16
  181. package/src/tool/stainChemistry/i18n/de.ts +286 -286
  182. package/src/tool/stainChemistry/i18n/en.ts +289 -289
  183. package/src/tool/stainChemistry/i18n/es.ts +286 -286
  184. package/src/tool/stainChemistry/i18n/fr.ts +296 -296
  185. package/src/tool/stainChemistry/i18n/id.ts +286 -286
  186. package/src/tool/stainChemistry/i18n/it.ts +286 -286
  187. package/src/tool/stainChemistry/i18n/ja.ts +286 -286
  188. package/src/tool/stainChemistry/i18n/ko.ts +283 -283
  189. package/src/tool/stainChemistry/i18n/nl.ts +286 -286
  190. package/src/tool/stainChemistry/i18n/pl.ts +286 -286
  191. package/src/tool/stainChemistry/i18n/pt.ts +286 -286
  192. package/src/tool/stainChemistry/i18n/ru.ts +286 -286
  193. package/src/tool/stainChemistry/i18n/sv.ts +286 -286
  194. package/src/tool/stainChemistry/i18n/tr.ts +286 -286
  195. package/src/tool/stainChemistry/i18n/zh.ts +281 -281
  196. package/src/tool/stainChemistry/seo.astro +15 -15
  197. package/src/tool/yarnCalculator/i18n/de.ts +296 -296
  198. package/src/tool/yarnCalculator/i18n/es.ts +296 -296
  199. package/src/tool/yarnCalculator/i18n/fr.ts +296 -296
  200. package/src/tool/yarnCalculator/i18n/ja.ts +296 -296
  201. package/src/tool/yarnCalculator/i18n/ko.ts +296 -296
  202. package/src/tool/yarnCalculator/i18n/nl.ts +296 -296
  203. package/src/tool/yarnCalculator/i18n/pl.ts +296 -296
  204. package/src/tool/yarnCalculator/i18n/ru.ts +296 -296
  205. package/src/tool/yarnCalculator/i18n/sv.ts +296 -296
  206. package/src/tool/yarnCalculator/i18n/tr.ts +296 -296
  207. package/src/tool/yarnCalculator/i18n/zh.ts +295 -295
  208. package/src/tool/yarnCalculator/seo.astro +15 -15
  209. package/src/tools.ts +2 -2
@@ -1,295 +1,295 @@
1
- import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
- import type { ToolLocaleContent } from '../../../types';
3
- import { bibliography } from '../bibliography';
4
- import type { YarnCalculatorUI } from '../ui';
5
-
6
- const slug = 'yarn-calculator';
7
- const title = '毛线计算器:我需要准备多少米、多少团线?';
8
- const description = '根据织物图解和尺寸,精确计算编织(棒针或钩针)项目所需的羊毛或毛线总量(米/团)。';
9
-
10
- const faqData = [
11
- {
12
- question: '为什么钩针(crochet)比棒针(knit)更费线?',
13
- answer:
14
- '钩针编织依靠创建层叠的结和环,这使得每平方厘米的织物更加紧密且厚实。平均而言,钩针项目比使用双针(平针织法)编织的相同项目多消耗 25% 到 35% 的毛线。',
15
- },
16
- {
17
- question: '如果我购买不同缸号(Dye Lot)的线会怎样?',
18
- answer:
19
- '即使在商店里看起来颜色完全一致,染色过程中极细微的化学差异也可能导致成品编织在一起时出现可见的"色差带"。强烈建议务必一次性买齐所需毛线,并确保批次代码(缸号)完全相同。',
20
- },
21
- {
22
- question: '织片密度(gauge)如何影响最终耗线量?',
23
- answer:
24
- '如果织得较松,每一针消耗的线长度(米)就会增加。如果你的试样密度比图解要求的大(例如标准是 15 针,你由于织得松变成了 13 针),你的毛线消耗量将大幅增加。提前编织密度试样至关重要。',
25
- },
26
- {
27
- question: '如果我只有毛线团重量,该如何计算米数?',
28
- answer:
29
- '缺少长度数据很难准确计算。大多数线团都会在标签上标注长度。如果没有标注,可以在 Ravelry 等数据库中根据线材名称搜索,查找每 50 克或 100 克的准确长度。',
30
- },
31
- ];
32
-
33
- const howToData = [
34
- {
35
- name: '选择项目类型',
36
- text: '从毛衣、围巾、帽子、袜子或毯子中选择,以加载特定的耗线基础数据。',
37
- },
38
- {
39
- name: '定义尺寸与粗细',
40
- text: '指明成品尺寸(S, M, L, XL)以及你要使用的毛线粗细(蕾丝线、中细线、合股线、粗线等)。',
41
- },
42
- {
43
- name: '启用修正系数',
44
- text: '如果你的图解中有麻花、辫子或复杂的纹理,请开启纹理开关以增加必要的预留量。',
45
- },
46
- {
47
- name: '获取购买清单',
48
- text: '输入你所选毛线每团的米数,即可看到确切需要放入购物车的数量。',
49
- },
50
- ];
51
-
52
- const faqSchema: WithContext<FAQPage> = {
53
- '@context': 'https://schema.org',
54
- '@type': 'FAQPage',
55
- mainEntity: faqData.map((item) => ({
56
- '@type': 'Question',
57
- name: item.question,
58
- acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
- })),
60
- };
61
-
62
- const howToSchema: WithContext<HowTo> = {
63
- '@context': 'https://schema.org',
64
- '@type': 'HowTo',
65
- name: title,
66
- description,
67
- step: howToData.map((step) => ({
68
- '@type': 'HowToStep',
69
- name: step.name,
70
- text: step.text,
71
- })),
72
- };
73
-
74
- const appSchema: WithContext<SoftwareApplication> = {
75
- '@context': 'https://schema.org',
76
- '@type': 'SoftwareApplication',
77
- name: title,
78
- description,
79
- applicationCategory: 'UtilityApplication',
80
- operatingSystem: 'All',
81
- offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
82
- inLanguage: 'zh',
83
- };
84
-
85
- export const content: ToolLocaleContent<YarnCalculatorUI> = {
86
- slug,
87
- title,
88
- description,
89
- faq: faqData,
90
- bibliography: bibliography,
91
- howTo: howToData,
92
- schemas: [faqSchema, howToSchema, appSchema],
93
- seo: [
94
- {
95
- type: 'title',
96
- text: '毛线耗量指南:如何为你的项目计算米数和线团数',
97
- level: 2,
98
- },
99
- {
100
- type: 'paragraph',
101
- html: '掌握编织物流管理,使用我们的棒针与钩针高精度技术计算器,避免"断线"尴尬。每一位编织者最大的恐惧莫过于 <strong>"绝望的最后几米(Yarn Chicken)"</strong>:在项目的末尾,似乎线就要在收掉最后几针前用完了。本计算器旨在基于工业标准的长度和克重数据为你提供准确的预估。',
102
- },
103
- {
104
- type: 'stats',
105
- items: [
106
- { value: '+10%', label: '备用系数', icon: 'mdi:security' },
107
- { value: '公制', label: '计算单位(米)', icon: 'mdi:ruler' },
108
- { value: '离线', label: '本地数据库', icon: 'mdi:wifi-off' },
109
- ],
110
- columns: 3,
111
- },
112
- {
113
- type: 'title',
114
- text: '为什么线团的"重量"具有欺骗性?',
115
- level: 3,
116
- },
117
- {
118
- type: 'paragraph',
119
- html: '许多初学者在购买毛线时会犯专注于重量(例如"买 6 团 100 克的线")的错误。然而,重量是质量单位,而非长度单位。两款同样重 100 克的线,其长度可能截然不同:一款 <strong>Bulky(粗线)</strong> 类型可能只有 80 米,而同样重量的一款 <strong>Fingering / Lace(蕾丝线)</strong> 长度可能超过 450 米。',
120
- },
121
- {
122
- type: 'paragraph',
123
- html: '因此,我们的计算器始终优先考虑 <strong>总米数</strong>。一旦你知道了自己的尺寸和项目所需的总长度,只需将其除以特定线团标签上标注的长度,即可得到应购买的确切团数。',
124
- },
125
- {
126
- type: 'title',
127
- text: '按粗细分类的标准米数参考表',
128
- level: 3,
129
- },
130
- {
131
- type: 'paragraph',
132
- html: '如果你手边没有线材标签,可以参考以下数值(按每 100 克纤维计)进行估算:',
133
- },
134
- {
135
- type: 'table',
136
- headers: ['粗细 (Weight)', '约计米数 / 100g', '推荐用途', '推荐针号'],
137
- rows: [
138
- ['<strong>Lace / 0 (蕾丝)</strong>', '600 - 900m', '蕾丝披肩,镂空花样', '1.5 - 2.5mm'],
139
- ['<strong>Fingering / 1 (超细)</strong>', '360 - 450m', '袜子,婴儿服饰', '2.25 - 3.25mm'],
140
- ['<strong>Sport / 2 (细)</strong>', '270 - 320m', '轻便外套', '3.25 - 3.75mm'],
141
- ['<strong>DK / 3 (中细)</strong>', '200 - 250m', '毛衣,帽子', '3.75 - 4.5mm'],
142
- ['<strong>Worsted / 4 (中粗)</strong>', '180 - 220m', '毯子,大衣', '4.5 - 5.5mm'],
143
- ['<strong>Bulky / 5 (粗)</strong>', '100 - 140m', 'XXL 围巾,厚毯子', '6.0 - 8.0mm'],
144
- ],
145
- },
146
- {
147
- type: 'tip',
148
- title: '密度系数(Gauge)',
149
- html: '<p>请记住,如果你织得非常松,你的针脚会更大,消耗的线量会比织得紧时更多。我们的计算器应用了一个安全裕度,但如果你知道自己的织法极其松散,请考虑在结果的基础上额外增加 5-10% 的线量以防万一。</p>',
150
- },
151
- {
152
- type: 'title',
153
- text: '增加耗线量的变量',
154
- level: 3,
155
- },
156
- {
157
- type: 'paragraph',
158
- html: '并非所有针法消耗的纤维量都相同。在选择设计时,请考虑以下倍数因素:',
159
- },
160
- {
161
- type: 'comparative',
162
- items: [
163
- {
164
- title: '下针 / 平针',
165
- description: '代表任何服装的基础消耗量和最大用线效率。',
166
- icon: 'mdi:minus-circle-outline',
167
- points: ['初学者的理想选择', '织物自然垂坠'],
168
- },
169
- {
170
- title: '麻花 / 纹理',
171
- description: '纤维的交叉会使织片"缩短",使消耗量增加约 25%。',
172
- icon: 'mdi:texture-box',
173
- points: ['需要更多米数', '织物更紧密、更沉重'],
174
- pointIcon: 'mdi:alert-circle-outline',
175
- },
176
- {
177
- title: '钩针 (Crochet)',
178
- description: '钩针编织的结节比棒针编织多消耗约 30% 的线量。',
179
- icon: 'mdi:hook',
180
- points: ['线团消耗极快', '三维立体质感'],
181
- pointIcon: 'mdi:alert-circle-outline',
182
- },
183
- {
184
- title: '罗纹针',
185
- description: '正反针的结构使每平方厘米积聚了更多羊毛。',
186
- icon: 'mdi:unfold-more-horizontal',
187
- points: ['中等消耗 (+15%)', '高弹性恢复能力'],
188
- },
189
- ],
190
- columns: 2,
191
- },
192
- {
193
- type: 'title',
194
- text: '精明编织者名词解释',
195
- level: 3,
196
- },
197
- {
198
- type: 'glossary',
199
- items: [
200
- {
201
- term: 'Dye Lot (缸号)',
202
- definition:
203
- '标识染色锅次的编号。不同缸号的线在团装状态下可能看不出差别,但在成品中色差会非常明显。',
204
- },
205
- {
206
- term: 'Stash (囤线)',
207
- definition:
208
- '编织者个人的线材收藏。了解没有标签的余线克重对于计算小型项目至关重要。',
209
- },
210
- {
211
- term: 'Put-up',
212
- definition:
213
- '线材的呈现形式(绞、团或锥),这决定了使用前是否需要重新绕团。',
214
- },
215
- {
216
- term: 'Yarn Chicken (最后几米挑战)',
217
- definition:
218
- '挑战在似乎不足的线量下完成一段工艺。',
219
- },
220
- ],
221
- },
222
- {
223
- type: 'title',
224
- text: '如何使用此计算器的结果',
225
- level: 3,
226
- },
227
- {
228
- type: 'paragraph',
229
- html: '一旦工具返回了所需的米数和团数,我们建议执行以下手动核对步骤:',
230
- },
231
- {
232
- type: 'list',
233
- items: [
234
- '<strong>核对实际线团长度:</strong> 并非所有 100 克的线团都是 200 米。请根据包装标签上的实际数据调整最终计算。',
235
- '<strong>累加细节用线量:</strong> 如果你要为围巾添加流苏或为帽子添加绒球,请在总量上额外增加 50-80 米。',
236
- '<strong>密度试样:</strong> 编织一个 10x10 厘米的正方形。使用精密电子秤称重。如果重 20 克,你的毯子是 100x100(即 100 个正方形),那么你一共需要 2 公斤线。',
237
- '<strong>务必购买同批次缸号:</strong> 如果计算结果是 7 团,如果批次不同,请购买 8 团以留出余地或用于接缝等隐蔽部位。',
238
- ],
239
- },
240
- {
241
- type: 'summary',
242
- title: '购线策略建议',
243
- items: [
244
- '优先考虑米数而非克重,以确保长度充足。',
245
- '钩针消耗的线量远高于棒针;请准确调整类型选择。',
246
- '紧密纹理(麻花等)需要在线材预算上增加 25%。',
247
- '务必保留每缸毛线的一张标签,以备需要补色或查号时使用。',
248
- '预留 10% 的安全边际用于编织强制要求的密度试样。',
249
- ],
250
- },
251
- ],
252
- ui: {
253
- sectionProject: '1. 项目类型',
254
- sectionSize: '2. 尺寸 / 尺码',
255
- sectionWeight: '3. 线材粗细',
256
- sectionPattern: '4. 图解特征',
257
- sectionBall: '5. 线团数据',
258
- labelCables: '是否有麻花或紧密纹理?',
259
- labelGrams: '克 / 团',
260
- labelMeters: '米 / 团',
261
- weightFine: '细线',
262
- weightMedium: '中量',
263
- weightThick: '粗线',
264
- weightXXL: '超粗',
265
- projectSweater: '毛衣',
266
- projectScarf: '围巾',
267
- projectHat: '帽子',
268
- projectSocks: '袜子',
269
- projectBlanket: '毯子',
270
- projectCardigan: '开衫',
271
- statPrefix: '预计总耗线量',
272
- statSuffix: 'M',
273
- statNote: '包含 10% 保守预留量的最终计算长度。',
274
- ballsFormatSingular: '购买 {n} 团',
275
- ballsFormatPlural: '购买 {n} 团',
276
- ballsDetailFormat: '每团 {w}g / {m}m',
277
- alertTitle: '战略安全提示:',
278
- alertText:
279
- '此计算已确保你不会断线。购买线团时,请务必核对缸号(dye lot)是否一致,以避免织物出现色偏。',
280
- schemeSleeveLabel: '袖子',
281
- schemeSleeveEach: '每只',
282
- schemeBodyLabel: '正身',
283
- schemeTotalHat: '帽子合计',
284
- schemeTotalFlat: '部位合计',
285
- schemeTotalSocks: '每双合计',
286
- sizeLabels: {
287
- sweater: ['S', 'M', 'L', 'XL'],
288
- cardigan: ['S', 'M', 'L', 'XL'],
289
- hat: ['童款', 'S', 'M', 'L'],
290
- scarf: ['迷你', '中等', '大款', '加大'],
291
- socks: ['童款', '成人 S', '成人 M', '成人 L'],
292
- blanket: ['婴儿', '沙发', '单人床', '双人床'],
293
- },
294
- },
295
- };
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import { bibliography } from '../bibliography';
4
+ import type { YarnCalculatorUI } from '../ui';
5
+
6
+ const slug = 'yarn-calculator';
7
+ const title = '毛线计算器:我需要准备多少米、多少团线?';
8
+ const description = '根据织物图解和尺寸,精确计算编织(棒针或钩针)项目所需的羊毛或毛线总量(米/团)。';
9
+
10
+ const faqData = [
11
+ {
12
+ question: '为什么钩针(crochet)比棒针(knit)更费线?',
13
+ answer:
14
+ '钩针编织依靠创建层叠的结和环,这使得每平方厘米的织物更加紧密且厚实。平均而言,钩针项目比使用双针(平针织法)编织的相同项目多消耗 25% 到 35% 的毛线。',
15
+ },
16
+ {
17
+ question: '如果我购买不同缸号(Dye Lot)的线会怎样?',
18
+ answer:
19
+ '即使在商店里看起来颜色完全一致,染色过程中极细微的化学差异也可能导致成品编织在一起时出现可见的"色差带"。强烈建议务必一次性买齐所需毛线,并确保批次代码(缸号)完全相同。',
20
+ },
21
+ {
22
+ question: '织片密度(gauge)如何影响最终耗线量?',
23
+ answer:
24
+ '如果织得较松,每一针消耗的线长度(米)就会增加。如果你的试样密度比图解要求的大(例如标准是 15 针,你由于织得松变成了 13 针),你的毛线消耗量将大幅增加。提前编织密度试样至关重要。',
25
+ },
26
+ {
27
+ question: '如果我只有毛线团重量,该如何计算米数?',
28
+ answer:
29
+ '缺少长度数据很难准确计算。大多数线团都会在标签上标注长度。如果没有标注,可以在 Ravelry 等数据库中根据线材名称搜索,查找每 50 克或 100 克的准确长度。',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: '选择项目类型',
36
+ text: '从毛衣、围巾、帽子、袜子或毯子中选择,以加载特定的耗线基础数据。',
37
+ },
38
+ {
39
+ name: '定义尺寸与粗细',
40
+ text: '指明成品尺寸(S, M, L, XL)以及你要使用的毛线粗细(蕾丝线、中细线、合股线、粗线等)。',
41
+ },
42
+ {
43
+ name: '启用修正系数',
44
+ text: '如果你的图解中有麻花、辫子或复杂的纹理,请开启纹理开关以增加必要的预留量。',
45
+ },
46
+ {
47
+ name: '获取购买清单',
48
+ text: '输入你所选毛线每团的米数,即可看到确切需要放入购物车的数量。',
49
+ },
50
+ ];
51
+
52
+ const faqSchema: WithContext<FAQPage> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'FAQPage',
55
+ mainEntity: faqData.map((item) => ({
56
+ '@type': 'Question',
57
+ name: item.question,
58
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
+ })),
60
+ };
61
+
62
+ const howToSchema: WithContext<HowTo> = {
63
+ '@context': 'https://schema.org',
64
+ '@type': 'HowTo',
65
+ name: title,
66
+ description,
67
+ step: howToData.map((step) => ({
68
+ '@type': 'HowToStep',
69
+ name: step.name,
70
+ text: step.text,
71
+ })),
72
+ };
73
+
74
+ const appSchema: WithContext<SoftwareApplication> = {
75
+ '@context': 'https://schema.org',
76
+ '@type': 'SoftwareApplication',
77
+ name: title,
78
+ description,
79
+ applicationCategory: 'UtilityApplication',
80
+ operatingSystem: 'All',
81
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
82
+ inLanguage: 'zh',
83
+ };
84
+
85
+ export const content: ToolLocaleContent<YarnCalculatorUI> = {
86
+ slug,
87
+ title,
88
+ description,
89
+ faq: faqData,
90
+ bibliography: bibliography,
91
+ howTo: howToData,
92
+ schemas: [faqSchema, howToSchema, appSchema],
93
+ seo: [
94
+ {
95
+ type: 'title',
96
+ text: '毛线耗量指南:如何为你的项目计算米数和线团数',
97
+ level: 2,
98
+ },
99
+ {
100
+ type: 'paragraph',
101
+ html: '掌握编织物流管理,使用我们的棒针与钩针高精度技术计算器,避免"断线"尴尬。每一位编织者最大的恐惧莫过于 <strong>"绝望的最后几米(Yarn Chicken)"</strong>:在项目的末尾,似乎线就要在收掉最后几针前用完了。本计算器旨在基于工业标准的长度和克重数据为你提供准确的预估。',
102
+ },
103
+ {
104
+ type: 'stats',
105
+ items: [
106
+ { value: '+10%', label: '备用系数', icon: 'mdi:security' },
107
+ { value: '公制', label: '计算单位(米)', icon: 'mdi:ruler' },
108
+ { value: '离线', label: '本地数据库', icon: 'mdi:wifi-off' },
109
+ ],
110
+ columns: 3,
111
+ },
112
+ {
113
+ type: 'title',
114
+ text: '为什么线团的"重量"具有欺骗性?',
115
+ level: 3,
116
+ },
117
+ {
118
+ type: 'paragraph',
119
+ html: '许多初学者在购买毛线时会犯专注于重量(例如"买 6 团 100 克的线")的错误。然而,重量是质量单位,而非长度单位。两款同样重 100 克的线,其长度可能截然不同:一款 <strong>Bulky(粗线)</strong> 类型可能只有 80 米,而同样重量的一款 <strong>Fingering / Lace(蕾丝线)</strong> 长度可能超过 450 米。',
120
+ },
121
+ {
122
+ type: 'paragraph',
123
+ html: '因此,我们的计算器始终优先考虑 <strong>总米数</strong>。一旦你知道了自己的尺寸和项目所需的总长度,只需将其除以特定线团标签上标注的长度,即可得到应购买的确切团数。',
124
+ },
125
+ {
126
+ type: 'title',
127
+ text: '按粗细分类的标准米数参考表',
128
+ level: 3,
129
+ },
130
+ {
131
+ type: 'paragraph',
132
+ html: '如果你手边没有线材标签,可以参考以下数值(按每 100 克纤维计)进行估算:',
133
+ },
134
+ {
135
+ type: 'table',
136
+ headers: ['粗细 (Weight)', '约计米数 / 100g', '推荐用途', '推荐针号'],
137
+ rows: [
138
+ ['<strong>Lace / 0 (蕾丝)</strong>', '600 - 900m', '蕾丝披肩,镂空花样', '1.5 - 2.5mm'],
139
+ ['<strong>Fingering / 1 (超细)</strong>', '360 - 450m', '袜子,婴儿服饰', '2.25 - 3.25mm'],
140
+ ['<strong>Sport / 2 (细)</strong>', '270 - 320m', '轻便外套', '3.25 - 3.75mm'],
141
+ ['<strong>DK / 3 (中细)</strong>', '200 - 250m', '毛衣,帽子', '3.75 - 4.5mm'],
142
+ ['<strong>Worsted / 4 (中粗)</strong>', '180 - 220m', '毯子,大衣', '4.5 - 5.5mm'],
143
+ ['<strong>Bulky / 5 (粗)</strong>', '100 - 140m', 'XXL 围巾,厚毯子', '6.0 - 8.0mm'],
144
+ ],
145
+ },
146
+ {
147
+ type: 'tip',
148
+ title: '密度系数(Gauge)',
149
+ html: '<p>请记住,如果你织得非常松,你的针脚会更大,消耗的线量会比织得紧时更多。我们的计算器应用了一个安全裕度,但如果你知道自己的织法极其松散,请考虑在结果的基础上额外增加 5-10% 的线量以防万一。</p>',
150
+ },
151
+ {
152
+ type: 'title',
153
+ text: '增加耗线量的变量',
154
+ level: 3,
155
+ },
156
+ {
157
+ type: 'paragraph',
158
+ html: '并非所有针法消耗的纤维量都相同。在选择设计时,请考虑以下倍数因素:',
159
+ },
160
+ {
161
+ type: 'comparative',
162
+ items: [
163
+ {
164
+ title: '下针 / 平针',
165
+ description: '代表任何服装的基础消耗量和最大用线效率。',
166
+ icon: 'mdi:minus-circle-outline',
167
+ points: ['初学者的理想选择', '织物自然垂坠'],
168
+ },
169
+ {
170
+ title: '麻花 / 纹理',
171
+ description: '纤维的交叉会使织片"缩短",使消耗量增加约 25%。',
172
+ icon: 'mdi:texture-box',
173
+ points: ['需要更多米数', '织物更紧密、更沉重'],
174
+ pointIcon: 'mdi:alert-circle-outline',
175
+ },
176
+ {
177
+ title: '钩针 (Crochet)',
178
+ description: '钩针编织的结节比棒针编织多消耗约 30% 的线量。',
179
+ icon: 'mdi:hook',
180
+ points: ['线团消耗极快', '三维立体质感'],
181
+ pointIcon: 'mdi:alert-circle-outline',
182
+ },
183
+ {
184
+ title: '罗纹针',
185
+ description: '正反针的结构使每平方厘米积聚了更多羊毛。',
186
+ icon: 'mdi:unfold-more-horizontal',
187
+ points: ['中等消耗 (+15%)', '高弹性恢复能力'],
188
+ },
189
+ ],
190
+ columns: 2,
191
+ },
192
+ {
193
+ type: 'title',
194
+ text: '精明编织者名词解释',
195
+ level: 3,
196
+ },
197
+ {
198
+ type: 'glossary',
199
+ items: [
200
+ {
201
+ term: 'Dye Lot (缸号)',
202
+ definition:
203
+ '标识染色锅次的编号。不同缸号的线在团装状态下可能看不出差别,但在成品中色差会非常明显。',
204
+ },
205
+ {
206
+ term: 'Stash (囤线)',
207
+ definition:
208
+ '编织者个人的线材收藏。了解没有标签的余线克重对于计算小型项目至关重要。',
209
+ },
210
+ {
211
+ term: 'Put-up',
212
+ definition:
213
+ '线材的呈现形式(绞、团或锥),这决定了使用前是否需要重新绕团。',
214
+ },
215
+ {
216
+ term: 'Yarn Chicken (最后几米挑战)',
217
+ definition:
218
+ '挑战在似乎不足的线量下完成一段工艺。',
219
+ },
220
+ ],
221
+ },
222
+ {
223
+ type: 'title',
224
+ text: '如何使用此计算器的结果',
225
+ level: 3,
226
+ },
227
+ {
228
+ type: 'paragraph',
229
+ html: '一旦工具返回了所需的米数和团数,我们建议执行以下手动核对步骤:',
230
+ },
231
+ {
232
+ type: 'list',
233
+ items: [
234
+ '<strong>核对实际线团长度:</strong> 并非所有 100 克的线团都是 200 米。请根据包装标签上的实际数据调整最终计算。',
235
+ '<strong>累加细节用线量:</strong> 如果你要为围巾添加流苏或为帽子添加绒球,请在总量上额外增加 50-80 米。',
236
+ '<strong>密度试样:</strong> 编织一个 10x10 厘米的正方形。使用精密电子秤称重。如果重 20 克,你的毯子是 100x100(即 100 个正方形),那么你一共需要 2 公斤线。',
237
+ '<strong>务必购买同批次缸号:</strong> 如果计算结果是 7 团,如果批次不同,请购买 8 团以留出余地或用于接缝等隐蔽部位。',
238
+ ],
239
+ },
240
+ {
241
+ type: 'summary',
242
+ title: '购线策略建议',
243
+ items: [
244
+ '优先考虑米数而非克重,以确保长度充足。',
245
+ '钩针消耗的线量远高于棒针;请准确调整类型选择。',
246
+ '紧密纹理(麻花等)需要在线材预算上增加 25%。',
247
+ '务必保留每缸毛线的一张标签,以备需要补色或查号时使用。',
248
+ '预留 10% 的安全边际用于编织强制要求的密度试样。',
249
+ ],
250
+ },
251
+ ],
252
+ ui: {
253
+ sectionProject: '1. 项目类型',
254
+ sectionSize: '2. 尺寸 / 尺码',
255
+ sectionWeight: '3. 线材粗细',
256
+ sectionPattern: '4. 图解特征',
257
+ sectionBall: '5. 线团数据',
258
+ labelCables: '是否有麻花或紧密纹理?',
259
+ labelGrams: '克 / 团',
260
+ labelMeters: '米 / 团',
261
+ weightFine: '细线',
262
+ weightMedium: '中量',
263
+ weightThick: '粗线',
264
+ weightXXL: '超粗',
265
+ projectSweater: '毛衣',
266
+ projectScarf: '围巾',
267
+ projectHat: '帽子',
268
+ projectSocks: '袜子',
269
+ projectBlanket: '毯子',
270
+ projectCardigan: '开衫',
271
+ statPrefix: '预计总耗线量',
272
+ statSuffix: 'M',
273
+ statNote: '包含 10% 保守预留量的最终计算长度。',
274
+ ballsFormatSingular: '购买 {n} 团',
275
+ ballsFormatPlural: '购买 {n} 团',
276
+ ballsDetailFormat: '每团 {w}g / {m}m',
277
+ alertTitle: '战略安全提示:',
278
+ alertText:
279
+ '此计算已确保你不会断线。购买线团时,请务必核对缸号(dye lot)是否一致,以避免织物出现色偏。',
280
+ schemeSleeveLabel: '袖子',
281
+ schemeSleeveEach: '每只',
282
+ schemeBodyLabel: '正身',
283
+ schemeTotalHat: '帽子合计',
284
+ schemeTotalFlat: '部位合计',
285
+ schemeTotalSocks: '每双合计',
286
+ sizeLabels: {
287
+ sweater: ['S', 'M', 'L', 'XL'],
288
+ cardigan: ['S', 'M', 'L', 'XL'],
289
+ hat: ['童款', 'S', 'M', 'L'],
290
+ scarf: ['迷你', '中等', '大款', '加大'],
291
+ socks: ['童款', '成人 S', '成人 M', '成人 L'],
292
+ blanket: ['婴儿', '沙发', '单人床', '双人床'],
293
+ },
294
+ },
295
+ };
@@ -1,15 +1,15 @@
1
- ---
2
- import { SEORenderer } from '@jjlmoya/utils-shared';
3
- import { yarnCalculator } 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 yarnCalculator.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 { yarnCalculator } 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 yarnCalculator.i18n[locale]?.();
12
+ if (!content) return null;
13
+ ---
14
+
15
+ {content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
package/src/tools.ts CHANGED
@@ -12,7 +12,7 @@ import { FABRIC_PROJECT_CALCULATOR_TOOL } from './tool/fabricProjectCalculator/i
12
12
  import { SEWING_PATTERN_SCALER_TOOL } from './tool/sewingPatternScaler/index';
13
13
  import { NEEDLE_CONVERTER_TOOL } from './tool/needleConverter/index';
14
14
  import { YARN_CALCULATOR_TOOL } from './tool/yarnCalculator/index';
15
+ import { EMBROIDERY_STITCH_PRICING_ESTIMATOR_TOOL } from './tool/embroideryStitchPricingEstimator/index';
15
16
 
16
- export const ALL_TOOLS: ToolDefinition[] = [FABRIC_TRUTH_TOOL, LAUNDRY_GUIDE_TOOL, STAIN_CHEMISTRY_TOOL, BURN_TEST_TOOL, FIBER_PREP_TOOL, SHOE_SIZE_CONVERTER_TOOL, CLOTHING_SIZE_CONVERTER_TOOL, KNITTING_GAUGE_TOOL, FABRIC_PROJECT_CALCULATOR_TOOL, SEWING_PATTERN_SCALER_TOOL, NEEDLE_CONVERTER_TOOL, YARN_CALCULATOR_TOOL];
17
-
17
+ export const ALL_TOOLS: ToolDefinition[] = [FABRIC_TRUTH_TOOL, LAUNDRY_GUIDE_TOOL, STAIN_CHEMISTRY_TOOL, BURN_TEST_TOOL, FIBER_PREP_TOOL, SHOE_SIZE_CONVERTER_TOOL, CLOTHING_SIZE_CONVERTER_TOOL, KNITTING_GAUGE_TOOL, FABRIC_PROJECT_CALCULATOR_TOOL, SEWING_PATTERN_SCALER_TOOL, NEEDLE_CONVERTER_TOOL, YARN_CALCULATOR_TOOL, EMBROIDERY_STITCH_PRICING_ESTIMATOR_TOOL];
18
18