lurq 0.65.1

A Rust UI toolkit with typed components, retained state, reactive signals, GPU rendering, and DevTools.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
//! What tables, lists and charts say by themselves: a table's counts of rows, its menus of a column, its filters,
//! its export and its sums, and what a chart is called and reads out. A part of the app's [`Locale`](super::Locale).

use std::sync::Arc;

use super::Plural;

/// What tables, lists and charts say by themselves, in a locale's words. Every field is the app's to replace.
///
/// ```
/// use lurq::core::Locale;
///
/// let locale = Locale::for_tag("uk");
/// assert_eq!(&*locale.data.sort_ascending, "Сортувати за зростанням");
/// assert_eq!(locale.count(&locale.data.rows, 22), "22 рядки");
/// assert_eq!(locale.count(&locale.data.rows, 25), "25 рядків");
/// ```
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct DataWords {
  /// The title of a table's column of actions.
  pub actions_column: Arc<str>,
  /// What a table says of rows that failed to load, and with none.
  pub rows_failed: Arc<str>,
  pub no_rows: Arc<str>,
  pub select_row: Arc<str>,
  pub select_none: Arc<str>,
  /// How many rows a table has: "12 rows".
  pub rows: Plural,
  /// How many of them are shown, with `{shown}`, the form by `{count}`: "5 of 12 rows".
  pub shown_rows: Plural,
  /// How many of them are chosen, with `{selected}`, the form by `{count}`: "2 of 12 rows selected".
  pub selected_rows: Plural,
  /// What the controls of a column are called, with `{column}` for its title.
  pub column_menu: Arc<str>,
  pub resize_column: Arc<str>,
  pub sort_by: Arc<str>,
  /// The menu of a column, and of the columns shown.
  pub columns: Arc<str>,
  pub sort_ascending: Arc<str>,
  pub sort_descending: Arc<str>,
  pub clear_sort: Arc<str>,
  pub pin_start: Arc<str>,
  pub pin_end: Arc<str>,
  pub unpin: Arc<str>,
  pub size_to_fit: Arc<str>,
  pub hide_column: Arc<str>,
  pub show_all_columns: Arc<str>,
  /// The menu of what a table is exported as.
  pub export: Arc<str>,
  pub shown_csv: Arc<str>,
  pub shown_tsv: Arc<str>,
  pub selected_csv: Arc<str>,
  pub selected_tsv: Arc<str>,
  /// The bar of a table's tools, and how close its rows are.
  pub grid_tools: Arc<str>,
  pub search_rows: Arc<str>,
  pub filter: Arc<str>,
  pub density: Arc<str>,
  pub comfortable: Arc<str>,
  pub default: Arc<str>,
  pub compact: Arc<str>,
  /// A filter of a range said in a tag, with `{from}` and `{to}`.
  pub from_to: Arc<str>,
  pub from_only: Arc<str>,
  pub to_only: Arc<str>,
  /// The menu of a column's filter.
  pub filter_placeholder: Arc<str>,
  pub clear_filter: Arc<str>,
  pub clear_all_filters: Arc<str>,
  pub contains: Arc<str>,
  pub starts_with: Arc<str>,
  pub equals: Arc<str>,
  pub at_least: Arc<str>,
  pub at_most: Arc<str>,
  pub from: Arc<str>,
  pub to: Arc<str>,
  pub all: Arc<str>,
  /// A filter of several values said in a tag: "3 values".
  pub values: Plural,
  /// What the row of a table's sums is called, and each sum.
  pub summary: Arc<str>,
  pub sum: Arc<str>,
  pub average: Arc<str>,
  pub count: Arc<str>,
  pub min: Arc<str>,
  pub max: Arc<str>,
  /// What a chart and its legend are called, what kind of thing a chart is to what reads the tree, and what one
  /// with nothing says.
  pub chart: Arc<str>,
  pub chart_role: Arc<str>,
  pub legend: Arc<str>,
  pub no_data: Arc<str>,
  /// A bar of a series of several, with `{name}` for its category and `{number}` for the series.
  pub series: Arc<str>,
  /// The ends of a heatmap's scale, the scale with `{less}` and `{more}`, and a cell with no value.
  pub less: Arc<str>,
  pub more: Arc<str>,
  pub scale: Arc<str>,
  pub no_value: Arc<str>,
  /// What a sparkline reads out, with `{least}`, `{most}` and `{last}`: "12 values from 3 to 40, the last 18".
  pub values_summary: Plural,
}

impl DataWords {
  pub fn english() -> Self {
    Self {
      actions_column: "Actions".into(),
      rows_failed: "These rows could not be loaded".into(),
      no_rows: "No rows".into(),
      select_row: "Select row".into(),
      select_none: "Select none".into(),
      rows: Plural::two("{count} row", "{count} rows"),
      shown_rows: Plural::two("{shown} of {count} row", "{shown} of {count} rows"),
      selected_rows: Plural::two(
        "{selected} of {count} row selected",
        "{selected} of {count} rows selected",
      ),
      column_menu: "{column} column menu".into(),
      resize_column: "Resize {column}".into(),
      sort_by: "Sort by {column}".into(),
      columns: "Columns".into(),
      sort_ascending: "Sort ascending".into(),
      sort_descending: "Sort descending".into(),
      clear_sort: "Clear sort".into(),
      pin_start: "Pin to start".into(),
      pin_end: "Pin to end".into(),
      unpin: "Unpin".into(),
      size_to_fit: "Size to fit".into(),
      hide_column: "Hide column".into(),
      show_all_columns: "Show all columns".into(),
      export: "Export".into(),
      shown_csv: "Shown rows as CSV".into(),
      shown_tsv: "Shown rows as tab-separated".into(),
      selected_csv: "Selected as CSV".into(),
      selected_tsv: "Selected as tab-separated".into(),
      grid_tools: "Grid tools".into(),
      search_rows: "Search rows".into(),
      filter: "Filter".into(),
      density: "Density".into(),
      comfortable: "Comfortable".into(),
      default: "Default".into(),
      compact: "Compact".into(),
      from_to: "{from} to {to}".into(),
      from_only: "from {from}".into(),
      to_only: "to {to}".into(),
      filter_placeholder: "Filter…".into(),
      clear_filter: "Clear filter".into(),
      clear_all_filters: "Clear all filters".into(),
      contains: "Contains".into(),
      starts_with: "Starts with".into(),
      equals: "Equals".into(),
      at_least: "At least".into(),
      at_most: "At most".into(),
      from: "From".into(),
      to: "To".into(),
      all: "All".into(),
      values: Plural::two("{count} value", "{count} values"),
      summary: "Summary".into(),
      sum: "Sum".into(),
      average: "Average".into(),
      count: "Count".into(),
      min: "Min".into(),
      max: "Max".into(),
      chart: "Chart".into(),
      chart_role: "chart".into(),
      legend: "Legend".into(),
      no_data: "No data".into(),
      series: "{name}, series {number}".into(),
      less: "Less".into(),
      more: "More".into(),
      scale: "{less} to {more}".into(),
      no_value: "No value".into(),
      values_summary: Plural::two(
        "{count} value from {least} to {most}, the last {last}",
        "{count} values from {least} to {most}, the last {last}",
      ),
    }
  }

  /// The words of a language (`en`, `uk`, `de`, `fr`, `es`, `pl`); of any other, English.
  pub fn for_language(language: &str) -> Self {
    match language {
      "uk" => Self {
        actions_column: "Дії".into(),
        rows_failed: "Не вдалося завантажити ці рядки".into(),
        no_rows: "Немає рядків".into(),
        select_row: "Вибрати рядок".into(),
        select_none: "Зняти вибір".into(),
        rows: Plural::three("{count} рядок", "{count} рядки", "{count} рядків"),
        shown_rows: Plural::three(
          "{shown} з {count} рядка",
          "{shown} з {count} рядків",
          "{shown} з {count} рядків",
        ),
        selected_rows: Plural::three(
          "Вибрано {selected} з {count} рядка",
          "Вибрано {selected} з {count} рядків",
          "Вибрано {selected} з {count} рядків",
        ),
        column_menu: "Меню стовпця «{column}»".into(),
        resize_column: "Змінити ширину стовпця «{column}»".into(),
        sort_by: "Сортувати за стовпцем «{column}»".into(),
        columns: "Стовпці".into(),
        sort_ascending: "Сортувати за зростанням".into(),
        sort_descending: "Сортувати за спаданням".into(),
        clear_sort: "Скинути сортування".into(),
        pin_start: "Закріпити на початку".into(),
        pin_end: "Закріпити в кінці".into(),
        unpin: "Відкріпити".into(),
        size_to_fit: "Підігнати ширину".into(),
        hide_column: "Приховати стовпець".into(),
        show_all_columns: "Показати всі стовпці".into(),
        export: "Експорт".into(),
        shown_csv: "Показані рядки як CSV".into(),
        shown_tsv: "Показані рядки з табуляцією".into(),
        selected_csv: "Вибране як CSV".into(),
        selected_tsv: "Вибране з табуляцією".into(),
        grid_tools: "Інструменти таблиці".into(),
        search_rows: "Пошук у рядках".into(),
        filter: "Фільтр".into(),
        density: "Щільність".into(),
        comfortable: "Вільна".into(),
        default: "Звичайна".into(),
        compact: "Щільна".into(),
        from_to: "від {from} до {to}".into(),
        from_only: "від {from}".into(),
        to_only: "до {to}".into(),
        filter_placeholder: "Фільтр…".into(),
        clear_filter: "Скинути фільтр".into(),
        clear_all_filters: "Скинути всі фільтри".into(),
        contains: "Містить".into(),
        starts_with: "Починається з".into(),
        equals: "Дорівнює".into(),
        at_least: "Щонайменше".into(),
        at_most: "Щонайбільше".into(),
        from: "Від".into(),
        to: "До".into(),
        all: "Усі".into(),
        values: Plural::three("{count} значення", "{count} значення", "{count} значень"),
        summary: "Підсумок".into(),
        sum: "Сума".into(),
        average: "Середнє".into(),
        count: "Кількість".into(),
        min: "Мін.".into(),
        max: "Макс.".into(),
        chart: "Діаграма".into(),
        chart_role: "діаграма".into(),
        legend: "Легенда".into(),
        no_data: "Немає даних".into(),
        series: "{name}, ряд {number}".into(),
        less: "Менше".into(),
        more: "Більше".into(),
        scale: "{less} — {more}".into(),
        no_value: "Немає значення".into(),
        values_summary: Plural::three(
          "{count} значення від {least} до {most}, останнє {last}",
          "{count} значення від {least} до {most}, останнє {last}",
          "{count} значень від {least} до {most}, останнє {last}",
        ),
      },
      "de" => Self {
        actions_column: "Aktionen".into(),
        rows_failed: "Diese Zeilen konnten nicht geladen werden".into(),
        no_rows: "Keine Zeilen".into(),
        select_row: "Zeile auswählen".into(),
        select_none: "Keine auswählen".into(),
        rows: Plural::two("{count} Zeile", "{count} Zeilen"),
        shown_rows: Plural::two("{shown} von {count} Zeile", "{shown} von {count} Zeilen"),
        selected_rows: Plural::two(
          "{selected} von {count} Zeile ausgewählt",
          "{selected} von {count} Zeilen ausgewählt",
        ),
        column_menu: "Spaltenmenü {column}".into(),
        resize_column: "Breite von {column} ändern".into(),
        sort_by: "Nach {column} sortieren".into(),
        columns: "Spalten".into(),
        sort_ascending: "Aufsteigend sortieren".into(),
        sort_descending: "Absteigend sortieren".into(),
        clear_sort: "Sortierung aufheben".into(),
        pin_start: "Am Anfang fixieren".into(),
        pin_end: "Am Ende fixieren".into(),
        unpin: "Fixierung lösen".into(),
        size_to_fit: "Breite anpassen".into(),
        hide_column: "Spalte ausblenden".into(),
        show_all_columns: "Alle Spalten anzeigen".into(),
        export: "Exportieren".into(),
        shown_csv: "Angezeigte Zeilen als CSV".into(),
        shown_tsv: "Angezeigte Zeilen tabulatorgetrennt".into(),
        selected_csv: "Auswahl als CSV".into(),
        selected_tsv: "Auswahl tabulatorgetrennt".into(),
        grid_tools: "Tabellenwerkzeuge".into(),
        search_rows: "Zeilen durchsuchen".into(),
        filter: "Filter".into(),
        density: "Dichte".into(),
        comfortable: "Komfortabel".into(),
        default: "Standard".into(),
        compact: "Kompakt".into(),
        from_to: "{from} bis {to}".into(),
        from_only: "ab {from}".into(),
        to_only: "bis {to}".into(),
        filter_placeholder: "Filtern…".into(),
        clear_filter: "Filter löschen".into(),
        clear_all_filters: "Alle Filter löschen".into(),
        contains: "Enthält".into(),
        starts_with: "Beginnt mit".into(),
        equals: "Ist gleich".into(),
        at_least: "Mindestens".into(),
        at_most: "Höchstens".into(),
        from: "Von".into(),
        to: "Bis".into(),
        all: "Alle".into(),
        values: Plural::two("{count} Wert", "{count} Werte"),
        summary: "Zusammenfassung".into(),
        sum: "Summe".into(),
        average: "Durchschnitt".into(),
        count: "Anzahl".into(),
        min: "Min.".into(),
        max: "Max.".into(),
        chart: "Diagramm".into(),
        chart_role: "Diagramm".into(),
        legend: "Legende".into(),
        no_data: "Keine Daten".into(),
        series: "{name}, Reihe {number}".into(),
        less: "Weniger".into(),
        more: "Mehr".into(),
        scale: "{less} bis {more}".into(),
        no_value: "Kein Wert".into(),
        values_summary: Plural::two(
          "{count} Wert von {least} bis {most}, zuletzt {last}",
          "{count} Werte von {least} bis {most}, zuletzt {last}",
        ),
      },
      "fr" => Self {
        actions_column: "Actions".into(),
        rows_failed: "Impossible de charger ces lignes".into(),
        no_rows: "Aucune ligne".into(),
        select_row: "Sélectionner la ligne".into(),
        select_none: "Ne rien sélectionner".into(),
        rows: Plural::two("{count} ligne", "{count} lignes"),
        shown_rows: Plural::two("{shown} sur {count} ligne", "{shown} sur {count} lignes"),
        selected_rows: Plural::two(
          "{selected} sur {count} ligne sélectionnée",
          "{selected} sur {count} lignes sélectionnées",
        ),
        column_menu: "Menu de la colonne {column}".into(),
        resize_column: "Redimensionner {column}".into(),
        sort_by: "Trier par {column}".into(),
        columns: "Colonnes".into(),
        sort_ascending: "Tri croissant".into(),
        sort_descending: "Tri décroissant".into(),
        clear_sort: "Effacer le tri".into(),
        pin_start: "Épingler au début".into(),
        pin_end: "Épingler à la fin".into(),
        unpin: "Détacher".into(),
        size_to_fit: "Ajuster la largeur".into(),
        hide_column: "Masquer la colonne".into(),
        show_all_columns: "Afficher toutes les colonnes".into(),
        export: "Exporter".into(),
        shown_csv: "Lignes affichées en CSV".into(),
        shown_tsv: "Lignes affichées séparées par des tabulations".into(),
        selected_csv: "Sélection en CSV".into(),
        selected_tsv: "Sélection séparée par des tabulations".into(),
        grid_tools: "Outils du tableau".into(),
        search_rows: "Rechercher dans les lignes".into(),
        filter: "Filtrer".into(),
        density: "Densité".into(),
        comfortable: "Confortable".into(),
        default: "Par défaut".into(),
        compact: "Compacte".into(),
        from_to: "de {from} à {to}".into(),
        from_only: "à partir de {from}".into(),
        to_only: "jusqu’à {to}".into(),
        filter_placeholder: "Filtrer…".into(),
        clear_filter: "Effacer le filtre".into(),
        clear_all_filters: "Effacer tous les filtres".into(),
        contains: "Contient".into(),
        starts_with: "Commence par".into(),
        equals: "Est égal à".into(),
        at_least: "Au moins".into(),
        at_most: "Au plus".into(),
        from: "De".into(),
        to: "À".into(),
        all: "Tous".into(),
        values: Plural::two("{count} valeur", "{count} valeurs"),
        summary: "Résumé".into(),
        sum: "Somme".into(),
        average: "Moyenne".into(),
        count: "Nombre".into(),
        min: "Min.".into(),
        max: "Max.".into(),
        chart: "Graphique".into(),
        chart_role: "graphique".into(),
        legend: "Légende".into(),
        no_data: "Aucune donnée".into(),
        series: "{name}, série {number}".into(),
        less: "Moins".into(),
        more: "Plus".into(),
        scale: "{less} à {more}".into(),
        no_value: "Aucune valeur".into(),
        values_summary: Plural::two(
          "{count} valeur de {least} à {most}, la dernière {last}",
          "{count} valeurs de {least} à {most}, la dernière {last}",
        ),
      },
      "es" => Self {
        actions_column: "Acciones".into(),
        rows_failed: "No se pudieron cargar estas filas".into(),
        no_rows: "No hay filas".into(),
        select_row: "Seleccionar fila".into(),
        select_none: "No seleccionar ninguno".into(),
        rows: Plural::two("{count} fila", "{count} filas"),
        shown_rows: Plural::two("{shown} de {count} fila", "{shown} de {count} filas"),
        selected_rows: Plural::two(
          "{selected} de {count} fila seleccionada",
          "{selected} de {count} filas seleccionadas",
        ),
        column_menu: "Menú de la columna {column}".into(),
        resize_column: "Cambiar el ancho de {column}".into(),
        sort_by: "Ordenar por {column}".into(),
        columns: "Columnas".into(),
        sort_ascending: "Orden ascendente".into(),
        sort_descending: "Orden descendente".into(),
        clear_sort: "Quitar orden".into(),
        pin_start: "Fijar al inicio".into(),
        pin_end: "Fijar al final".into(),
        unpin: "No fijar".into(),
        size_to_fit: "Ajustar ancho".into(),
        hide_column: "Ocultar columna".into(),
        show_all_columns: "Mostrar todas las columnas".into(),
        export: "Exportar".into(),
        shown_csv: "Filas mostradas como CSV".into(),
        shown_tsv: "Filas mostradas separadas por tabulaciones".into(),
        selected_csv: "Selección como CSV".into(),
        selected_tsv: "Selección separada por tabulaciones".into(),
        grid_tools: "Herramientas de la tabla".into(),
        search_rows: "Buscar filas".into(),
        filter: "Filtrar".into(),
        density: "Densidad".into(),
        comfortable: "Cómoda".into(),
        default: "Predeterminada".into(),
        compact: "Compacta".into(),
        from_to: "de {from} a {to}".into(),
        from_only: "desde {from}".into(),
        to_only: "hasta {to}".into(),
        filter_placeholder: "Filtrar…".into(),
        clear_filter: "Borrar filtro".into(),
        clear_all_filters: "Borrar todos los filtros".into(),
        contains: "Contiene".into(),
        starts_with: "Empieza por".into(),
        equals: "Es igual a".into(),
        at_least: "Al menos".into(),
        at_most: "Como máximo".into(),
        from: "Desde".into(),
        to: "Hasta".into(),
        all: "Todos".into(),
        values: Plural::two("{count} valor", "{count} valores"),
        summary: "Resumen".into(),
        sum: "Suma".into(),
        average: "Promedio".into(),
        count: "Recuento".into(),
        min: "Mín.".into(),
        max: "Máx.".into(),
        chart: "Gráfico".into(),
        chart_role: "gráfico".into(),
        legend: "Leyenda".into(),
        no_data: "Sin datos".into(),
        series: "{name}, serie {number}".into(),
        less: "Menos".into(),
        more: "Más".into(),
        scale: "{less} a {more}".into(),
        no_value: "Sin valor".into(),
        values_summary: Plural::two(
          "{count} valor de {least} a {most}, el último {last}",
          "{count} valores de {least} a {most}, el último {last}",
        ),
      },
      "pl" => Self {
        actions_column: "Akcje".into(),
        rows_failed: "Nie udało się wczytać tych wierszy".into(),
        no_rows: "Brak wierszy".into(),
        select_row: "Zaznacz wiersz".into(),
        select_none: "Odznacz wszystko".into(),
        rows: Plural::three("{count} wiersz", "{count} wiersze", "{count} wierszy"),
        shown_rows: Plural::three(
          "{shown} z {count} wiersza",
          "{shown} z {count} wierszy",
          "{shown} z {count} wierszy",
        ),
        selected_rows: Plural::three(
          "Zaznaczono {selected} z {count} wiersza",
          "Zaznaczono {selected} z {count} wierszy",
          "Zaznaczono {selected} z {count} wierszy",
        ),
        column_menu: "Menu kolumny {column}".into(),
        resize_column: "Zmień szerokość kolumny {column}".into(),
        sort_by: "Sortuj według: {column}".into(),
        columns: "Kolumny".into(),
        sort_ascending: "Sortuj rosnąco".into(),
        sort_descending: "Sortuj malejąco".into(),
        clear_sort: "Wyczyść sortowanie".into(),
        pin_start: "Przypnij na początku".into(),
        pin_end: "Przypnij na końcu".into(),
        unpin: "Odepnij".into(),
        size_to_fit: "Dopasuj szerokość".into(),
        hide_column: "Ukryj kolumnę".into(),
        show_all_columns: "Pokaż wszystkie kolumny".into(),
        export: "Eksportuj".into(),
        shown_csv: "Widoczne wiersze jako CSV".into(),
        shown_tsv: "Widoczne wiersze rozdzielone tabulatorami".into(),
        selected_csv: "Zaznaczone jako CSV".into(),
        selected_tsv: "Zaznaczone rozdzielone tabulatorami".into(),
        grid_tools: "Narzędzia tabeli".into(),
        search_rows: "Szukaj w wierszach".into(),
        filter: "Filtr".into(),
        density: "Gęstość".into(),
        comfortable: "Swobodna".into(),
        default: "Domyślna".into(),
        compact: "Kompaktowa".into(),
        from_to: "od {from} do {to}".into(),
        from_only: "od {from}".into(),
        to_only: "do {to}".into(),
        filter_placeholder: "Filtruj…".into(),
        clear_filter: "Wyczyść filtr".into(),
        clear_all_filters: "Wyczyść wszystkie filtry".into(),
        contains: "Zawiera".into(),
        starts_with: "Zaczyna się od".into(),
        equals: "Równa się".into(),
        at_least: "Co najmniej".into(),
        at_most: "Co najwyżej".into(),
        from: "Od".into(),
        to: "Do".into(),
        all: "Wszystkie".into(),
        values: Plural::three("{count} wartość", "{count} wartości", "{count} wartości"),
        summary: "Podsumowanie".into(),
        sum: "Suma".into(),
        average: "Średnia".into(),
        count: "Liczba".into(),
        min: "Min.".into(),
        max: "Maks.".into(),
        chart: "Wykres".into(),
        chart_role: "wykres".into(),
        legend: "Legenda".into(),
        no_data: "Brak danych".into(),
        series: "{name}, seria {number}".into(),
        less: "Mniej".into(),
        more: "Więcej".into(),
        scale: "{less} – {more}".into(),
        no_value: "Brak wartości".into(),
        values_summary: Plural::three(
          "{count} wartość od {least} do {most}, ostatnia {last}",
          "{count} wartości od {least} do {most}, ostatnia {last}",
          "{count} wartości od {least} do {most}, ostatnia {last}",
        ),
      },
      _ => Self::english(),
    }
  }
}

impl Default for DataWords {
  fn default() -> Self {
    Self::english()
  }
}

#[cfg(test)]
mod tests {
  use super::*;

  #[test]
  fn every_language_has_every_word_with_its_places() {
    for language in super::super::locale::LANGUAGES {
      let words = DataWords::for_language(language);
      for word in [&words.column_menu, &words.resize_column, &words.sort_by] {
        assert!(word.contains("{column}"), "{language}: {word}");
      }
      assert!(
        words.from_to.contains("{from}") && words.from_to.contains("{to}"),
        "{language}"
      );
      assert!(
        words.from_only.contains("{from}") && words.to_only.contains("{to}"),
        "{language}"
      );
      assert!(
        words.series.contains("{name}") && words.series.contains("{number}"),
        "{language}"
      );
      assert!(
        words.scale.contains("{less}") && words.scale.contains("{more}"),
        "{language}"
      );
      for (plural, places) in [
        (&words.rows, &["{count}"][..]),
        (&words.values, &["{count}"]),
        (&words.shown_rows, &["{count}", "{shown}"]),
        (&words.selected_rows, &["{count}", "{selected}"]),
        (&words.values_summary, &["{count}", "{least}", "{most}", "{last}"]),
      ] {
        for form in plural.forms() {
          assert!(places.iter().all(|place| form.contains(place)), "{language}: {form}");
        }
      }
    }
    assert_eq!(DataWords::for_language("xx"), DataWords::english());
  }
}