wineater-bot 3.0.17 → 3.0.19

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wineater-bot",
3
- "version": "3.0.17",
3
+ "version": "3.0.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "src/index.js",
@@ -10,7 +10,7 @@ export const barConfig = {
10
10
  "Ensalada de arúgula y parmesano",
11
11
  "Tomate hierloom aliñado",
12
12
  "Aceitunas LENEZ",
13
- "PapaBnaz",
13
+ "Papatinaz",
14
14
  "Croquetas | hongos de temporada | jamón serrano",
15
15
  "Carpaccio Cesar",
16
16
  "Torreznos",
@@ -31,13 +31,13 @@ export const barConfig = {
31
31
  "Jamón Ibérico de bellota",
32
32
  "Lomo ibérico",
33
33
  "Chorizo ibérico",
34
- "Plato mixto"
34
+ "Plato mixto iberico"
35
35
  ]
36
36
  },
37
37
  {
38
38
  groupTitle: "Quesos",
39
39
  dishes: [
40
- "Selección de quesos"
40
+ "Selección de quesos (D’Affinois, Brie Ermitage, Manchego semi curado, Roquefort)"
41
41
  ]
42
42
  },
43
43
  {
package/src/js/i18n.js CHANGED
@@ -28,6 +28,15 @@ class Translator {
28
28
  widgetTitle: "TROUVEZ VOTRE VIN PARFAIT",
29
29
  widgetSubtitle: "Partagez tout ce que vous avez en tête—votre repas, humeur, budget ou occasion—et notre sommelier IA vous recommandera le vin parfait en quelques secondes",
30
30
  searchPlaceholder: "Entrez un mot-clé ou une description",
31
+ wineDetails: {
32
+ reason: "Raison",
33
+ price: "Prix",
34
+ region: "Région",
35
+ type: "Type",
36
+ moreInfo: "Plus d'infos",
37
+ sommSelection: "Sélection Somm",
38
+ code: "Code"
39
+ },
31
40
  searchButton: "Rechercher",
32
41
  priceRange: "Gamme de prix",
33
42
  wineColor: "Couleur du vin",
@@ -75,6 +84,15 @@ class Translator {
75
84
  widgetTitle: "ENCUENTRA TU VINO PERFECTO",
76
85
  widgetSubtitle: "Comparte cualquier cosa que tengas en mente—tu comida, estado de ánimo, presupuesto o evento—y nuestro sommelier de IA te recomendará el vino perfecto en segundos",
77
86
  searchPlaceholder: "Escribe una palabra clave o descripción",
87
+ wineDetails: {
88
+ reason: "Razón",
89
+ price: "Precio",
90
+ region: "Región",
91
+ type: "Tipo",
92
+ code: "Código",
93
+ moreInfo: "Más información",
94
+ sommSelection: "Selección Somm"
95
+ },
78
96
  searchButton: "Buscar",
79
97
  priceRange: "Rango de precios",
80
98
  wineColor: "Color del vino",
@@ -122,6 +140,15 @@ class Translator {
122
140
  widgetTitle: "FIND YOUR PERFECT WINE",
123
141
  widgetSubtitle: "Share anything on your mind—your meal, mood, budget, or occasion—and our AI sommelier will recommend the perfect wine in seconds",
124
142
  searchPlaceholder: "Enter a keyword or description",
143
+ wineDetails: {
144
+ price: "Price",
145
+ region: "Region",
146
+ type: "Type",
147
+ moreInfo: "More info",
148
+ reason: "Reason",
149
+ sommSelection: "Somm Selection",
150
+ code: "Code"
151
+ },
125
152
  searchButton: "Search",
126
153
  priceRange: "Price Range",
127
154
  wineColor: "Wine Color",
@@ -174,6 +201,15 @@ class Translator {
174
201
  "Empfohlen für eine Party"
175
202
  ],
176
203
  searchPlaceholder: "Geben Sie ein Stichwort oder eine Beschreibung ein",
204
+ wineDetails: {
205
+ price: "Preis",
206
+ region: "Region",
207
+ type: "Typ",
208
+ moreInfo: "Mehr Infos",
209
+ sommSelection: "Somm-Auswahl",
210
+ reason: "Grund",
211
+ code: "Code"
212
+ },
177
213
  searchButton: "Suche",
178
214
  priceRange: "Preisspanne",
179
215
  wineColor: "Weinfarbe",
@@ -205,7 +241,18 @@ class Translator {
205
241
  }
206
242
 
207
243
  translate(key) {
208
- return this.translations[this.language][key] || key;
244
+ const keys = key.split('.'); // Разбиваем ключ на части
245
+ let value = this.translations[this.language];
246
+
247
+ for (const k of keys) {
248
+ if (value && typeof value === 'object' && k in value) {
249
+ value = value[k]; // Переходим к следующему уровню
250
+ } else {
251
+ return key; // Если ключ не найден, возвращаем сам ключ
252
+ }
253
+ }
254
+
255
+ return value;
209
256
  }
210
257
  }
211
258
 
package/src/js/widget.js CHANGED
@@ -210,17 +210,20 @@ export class WineWidget {
210
210
 
211
211
  wines.forEach((wine, index) => {
212
212
  const wineHTML = `
213
- <div class="wine-recommendation-tile ${index === wines.length - 1 ? 'somm-selection' : ''}">
214
- ${index === wines.length - 1 ? '<div class="somm-selection-badge">Somm Selection</div>' : ''}
215
- <img src="${wine.Image}" alt="${wine.Title}" />
216
- <div class="tile-details">
217
- <strong>${wine.Title}</strong>
218
- <p>Prix: ${wine.Price || 'N/A'}</p>
219
- <p>Région: ${wine.Region || 'N/A'}</p>
220
- <p>Type: ${wine.Type || 'N/A'}</p>
221
- <a href="${wine.Url}" target="_blank">Plus d'infos</a>
222
- </div>
223
- </div>
213
+ <div class="wine-recommendation-tile ${wine.isSommSelection ? 'somm-selection' : ''}">
214
+ ${wine.isSommSelection ? `<div class="somm-selection-badge">${translator.translate('wineDetails.sommSelection')}</div>` : ''}
215
+ ${!!wine.image ? `<img src="${wine.image}" alt="${wine.title}" />` : '' }
216
+ <div class="tile-details">
217
+ <strong>${wine.title}</strong>
218
+ <p>${translator.translate('wineDetails.price')}: ${wine.price || 'N/A'}</p>
219
+ <p>${translator.translate('wineDetails.region')}: ${wine.region || 'N/A'}</p>
220
+ <p>${translator.translate('wineDetails.type')}: ${wine.type || 'N/A'}</p>
221
+ ${this.widgetType === 'bar' ? `<p>${translator.translate('wineDetails.reason')}: ${wine.pairing_recommendation || 'N/A'}</p>` : ''}
222
+ ${this.widgetType === 'bar'
223
+ ? `<p>${translator.translate('wineDetails.code')}: ${wine.url || 'N/A'}</p>`
224
+ : `<a href="${wine.Url}" target="_blank">${translator.translate('wineDetails.moreInfo')}</a>`}
225
+ </div>
226
+ </div>
224
227
  `;
225
228
  resultsContainer.insertAdjacentHTML('beforeend', wineHTML);
226
229