@vendure/dashboard 3.5.0-minor-202509261210 → 3.5.0-minor-202510031341

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 (263) hide show
  1. package/README.md +4 -0
  2. package/dist/plugin/dashboard.plugin.d.ts +25 -6
  3. package/dist/plugin/dashboard.plugin.js +184 -27
  4. package/dist/plugin/default-page.html +188 -0
  5. package/dist/vite/vite-plugin-config.js +13 -9
  6. package/dist/vite/vite-plugin-translations.d.ts +22 -0
  7. package/dist/vite/vite-plugin-translations.js +66 -0
  8. package/dist/vite/vite-plugin-vendure-dashboard.js +8 -6
  9. package/lingui.config.js +25 -2
  10. package/package.json +159 -156
  11. package/src/app/app-providers.tsx +0 -4
  12. package/src/app/common/delete-bulk-action.tsx +6 -5
  13. package/src/app/common/duplicate-bulk-action.tsx +4 -5
  14. package/src/app/common/duplicate-entity-dialog.tsx +1 -1
  15. package/src/app/common/set-document-direction.ts +7 -0
  16. package/src/app/main.tsx +50 -17
  17. package/src/app/routes/_authenticated/_administrators/administrators.tsx +8 -6
  18. package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +17 -6
  19. package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +2 -2
  20. package/src/app/routes/_authenticated/_assets/assets.tsx +1 -1
  21. package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +4 -4
  22. package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +8 -6
  23. package/src/app/routes/_authenticated/_assets/components/asset-tag-filter.tsx +1 -1
  24. package/src/app/routes/_authenticated/_assets/components/asset-tags-editor.tsx +1 -1
  25. package/src/app/routes/_authenticated/_assets/components/manage-tags-dialog.tsx +3 -8
  26. package/src/app/routes/_authenticated/_channels/channels.tsx +3 -6
  27. package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +5 -5
  28. package/src/app/routes/_authenticated/_collections/collections.tsx +3 -4
  29. package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +4 -6
  30. package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +1 -1
  31. package/src/app/routes/_authenticated/_collections/components/collection-contents-sheet.tsx +1 -1
  32. package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +6 -6
  33. package/src/app/routes/_authenticated/_countries/countries.graphql.ts +2 -0
  34. package/src/app/routes/_authenticated/_countries/countries.tsx +2 -3
  35. package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +4 -4
  36. package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-sheet.tsx +1 -1
  37. package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +4 -4
  38. package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +2 -4
  39. package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +13 -6
  40. package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +8 -8
  41. package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +3 -3
  42. package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +1 -1
  43. package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-utils.tsx +1 -1
  44. package/src/app/routes/_authenticated/_customers/components/customer-history/default-customer-history-components.tsx +1 -1
  45. package/src/app/routes/_authenticated/_customers/components/customer-history/use-customer-history.ts +1 -1
  46. package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +1 -1
  47. package/src/app/routes/_authenticated/_customers/customers.graphql.ts +4 -0
  48. package/src/app/routes/_authenticated/_customers/customers.tsx +23 -11
  49. package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +10 -8
  50. package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +1 -1
  51. package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +6 -5
  52. package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +1 -1
  53. package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +1 -1
  54. package/src/app/routes/_authenticated/_facets/facets.tsx +5 -5
  55. package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +7 -5
  56. package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +4 -4
  57. package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +5 -5
  58. package/src/app/routes/_authenticated/_orders/components/add-manual-payment-dialog.tsx +19 -21
  59. package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +1 -1
  60. package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +22 -22
  61. package/src/app/routes/_authenticated/_orders/components/fulfill-order-dialog.tsx +6 -6
  62. package/src/app/routes/_authenticated/_orders/components/fulfillment-details.tsx +15 -9
  63. package/src/app/routes/_authenticated/_orders/components/order-address.tsx +1 -1
  64. package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +11 -9
  65. package/src/app/routes/_authenticated/_orders/components/order-history/default-order-history-components.tsx +1 -1
  66. package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +1 -1
  67. package/src/app/routes/_authenticated/_orders/components/order-history/order-history-utils.tsx +1 -1
  68. package/src/app/routes/_authenticated/_orders/components/order-history/use-order-history.ts +1 -1
  69. package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +1 -1
  70. package/src/app/routes/_authenticated/_orders/components/order-modification-preview-dialog.tsx +4 -4
  71. package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +1 -1
  72. package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +27 -27
  73. package/src/app/routes/_authenticated/_orders/components/order-table.tsx +2 -2
  74. package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +1 -1
  75. package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +26 -20
  76. package/src/app/routes/_authenticated/_orders/components/seller-orders-card.tsx +3 -1
  77. package/src/app/routes/_authenticated/_orders/components/settle-refund-dialog.tsx +6 -6
  78. package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +1 -1
  79. package/src/app/routes/_authenticated/_orders/components/state-transition-control.tsx +1 -1
  80. package/src/app/routes/_authenticated/_orders/components/use-transition-order-to-state.tsx +3 -2
  81. package/src/app/routes/_authenticated/_orders/orders.tsx +5 -9
  82. package/src/app/routes/_authenticated/_orders/orders_.$aggregateOrderId_.seller-orders.$sellerOrderId.tsx +1 -1
  83. package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +1 -1
  84. package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +4 -4
  85. package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +17 -17
  86. package/src/app/routes/_authenticated/_orders/utils/order-detail-loaders.tsx +1 -1
  87. package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +5 -6
  88. package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +13 -6
  89. package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +1 -1
  90. package/src/app/routes/_authenticated/_product-variants/components/variant-price-detail.tsx +1 -1
  91. package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +9 -2
  92. package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +13 -6
  93. package/src/app/routes/_authenticated/_products/components/add-option-group-dialog.tsx +5 -5
  94. package/src/app/routes/_authenticated/_products/components/add-product-variant-dialog.tsx +5 -5
  95. package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +5 -4
  96. package/src/app/routes/_authenticated/_products/components/create-product-options-dialog.tsx +9 -12
  97. package/src/app/routes/_authenticated/_products/components/create-product-variants-dialog.tsx +1 -1
  98. package/src/app/routes/_authenticated/_products/components/create-product-variants.tsx +4 -4
  99. package/src/app/routes/_authenticated/_products/components/option-groups-editor.tsx +1 -1
  100. package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +1 -1
  101. package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +3 -3
  102. package/src/app/routes/_authenticated/_products/components/product-options-table.tsx +9 -6
  103. package/src/app/routes/_authenticated/_products/products.graphql.ts +31 -31
  104. package/src/app/routes/_authenticated/_products/products.tsx +11 -6
  105. package/src/app/routes/_authenticated/_products/products_.$id.tsx +4 -4
  106. package/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx +11 -11
  107. package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$id.tsx +8 -12
  108. package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +2 -2
  109. package/src/app/routes/_authenticated/_profile/profile.tsx +4 -4
  110. package/src/app/routes/_authenticated/_promotions/promotions.tsx +2 -4
  111. package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +16 -9
  112. package/src/app/routes/_authenticated/_roles/components/permissions-table-grid.tsx +1 -1
  113. package/src/app/routes/_authenticated/_roles/roles.tsx +3 -6
  114. package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +4 -6
  115. package/src/app/routes/_authenticated/_sellers/sellers.tsx +3 -4
  116. package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +4 -4
  117. package/src/app/routes/_authenticated/_shipping-methods/components/price-display.tsx +5 -5
  118. package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-test-result-wrapper.tsx +1 -1
  119. package/src/app/routes/_authenticated/_shipping-methods/components/test-address-form.tsx +4 -3
  120. package/src/app/routes/_authenticated/_shipping-methods/components/test-order-builder.tsx +4 -3
  121. package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-result.tsx +8 -8
  122. package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-sheet.tsx +1 -1
  123. package/src/app/routes/_authenticated/_shipping-methods/components/test-single-method-result.tsx +8 -8
  124. package/src/app/routes/_authenticated/_shipping-methods/components/test-single-shipping-method-sheet.tsx +4 -4
  125. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +2 -3
  126. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +2 -2
  127. package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +3 -4
  128. package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +13 -6
  129. package/src/app/routes/_authenticated/_system/healthchecks.tsx +10 -4
  130. package/src/app/routes/_authenticated/_system/job-queue.tsx +10 -13
  131. package/src/app/routes/_authenticated/_system/scheduled-tasks.tsx +18 -16
  132. package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +2 -4
  133. package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +13 -6
  134. package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +8 -12
  135. package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +6 -4
  136. package/src/app/routes/_authenticated/_zones/zones.tsx +4 -4
  137. package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +8 -5
  138. package/src/app/routes/_authenticated/index.tsx +6 -2
  139. package/src/app/styles.css +4 -0
  140. package/src/i18n/common-strings.ts +111 -0
  141. package/src/i18n/locales/ar.po +4777 -0
  142. package/src/i18n/locales/cs.po +4777 -0
  143. package/src/i18n/locales/de.po +4299 -1101
  144. package/src/i18n/locales/en.po +3857 -659
  145. package/src/i18n/locales/es.po +4777 -0
  146. package/src/i18n/locales/fa.po +4777 -0
  147. package/src/i18n/locales/fr.po +4777 -0
  148. package/src/i18n/locales/he.po +4777 -0
  149. package/src/i18n/locales/hr.po +4777 -0
  150. package/src/i18n/locales/it.po +4777 -0
  151. package/src/i18n/locales/ja.po +4777 -0
  152. package/src/i18n/locales/ko.po +4628 -0
  153. package/src/i18n/locales/nb.po +4777 -0
  154. package/src/i18n/locales/ne.po +4777 -0
  155. package/src/i18n/locales/nl.po +4628 -0
  156. package/src/i18n/locales/pl.po +4777 -0
  157. package/src/i18n/locales/pt_BR.po +4777 -0
  158. package/src/i18n/locales/pt_PT.po +4777 -0
  159. package/src/i18n/locales/ru.po +4777 -0
  160. package/src/i18n/locales/sv.po +4777 -0
  161. package/src/i18n/locales/tr.po +4777 -0
  162. package/src/i18n/locales/uk.po +4777 -0
  163. package/src/i18n/locales/zh_Hans.po +4777 -0
  164. package/src/i18n/locales/zh_Hant.po +4777 -0
  165. package/src/lib/components/data-input/combination-mode-input.tsx +1 -1
  166. package/src/lib/components/data-input/custom-field-list-input.tsx +11 -7
  167. package/src/lib/components/data-input/customer-group-input.tsx +27 -33
  168. package/src/lib/components/data-input/datetime-input.tsx +40 -1
  169. package/src/lib/components/data-input/default-relation-input.tsx +5 -4
  170. package/src/lib/components/data-input/product-multi-selector-input.tsx +14 -14
  171. package/src/lib/components/data-input/relation-selector.tsx +1 -1
  172. package/src/lib/components/data-input/select-with-options.tsx +1 -1
  173. package/src/lib/components/data-input/slug-input.tsx +9 -15
  174. package/src/lib/components/data-table/add-filter-menu.tsx +4 -4
  175. package/src/lib/components/data-table/data-table-bulk-action-item.tsx +8 -8
  176. package/src/lib/components/data-table/data-table-bulk-actions.tsx +4 -4
  177. package/src/lib/components/data-table/data-table-column-header.tsx +13 -8
  178. package/src/lib/components/data-table/data-table-faceted-filter.tsx +2 -1
  179. package/src/lib/components/data-table/data-table-filter-dialog.tsx +1 -1
  180. package/src/lib/components/data-table/data-table-utils.ts +21 -4
  181. package/src/lib/components/data-table/data-table-view-options.tsx +4 -2
  182. package/src/lib/components/data-table/data-table.tsx +3 -3
  183. package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +4 -4
  184. package/src/lib/components/data-table/global-views-bar.tsx +1 -1
  185. package/src/lib/components/data-table/human-readable-operator.tsx +1 -1
  186. package/src/lib/components/data-table/manage-global-views-button.tsx +1 -1
  187. package/src/lib/components/data-table/my-views-button.tsx +13 -13
  188. package/src/lib/components/data-table/refresh-button.tsx +1 -1
  189. package/src/lib/components/data-table/save-view-button.tsx +11 -11
  190. package/src/lib/components/data-table/use-generated-columns.tsx +10 -7
  191. package/src/lib/components/data-table/views-sheet.tsx +79 -71
  192. package/src/lib/components/date-range-picker.tsx +36 -34
  193. package/src/lib/components/layout/app-sidebar.tsx +3 -1
  194. package/src/lib/components/layout/channel-switcher.tsx +8 -10
  195. package/src/lib/components/layout/dev-mode-indicator.tsx +1 -1
  196. package/src/lib/components/layout/generated-breadcrumbs.tsx +10 -8
  197. package/src/lib/components/layout/language-dialog.tsx +34 -13
  198. package/src/lib/components/layout/manage-languages-dialog.tsx +1 -1
  199. package/src/lib/components/layout/nav-main.tsx +23 -13
  200. package/src/lib/components/layout/nav-user.tsx +19 -23
  201. package/src/lib/components/login/login-form.tsx +1 -1
  202. package/src/lib/components/shared/asset/asset-bulk-actions.tsx +4 -4
  203. package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +1 -1
  204. package/src/lib/components/shared/asset/asset-gallery.tsx +15 -14
  205. package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +11 -11
  206. package/src/lib/components/shared/assign-to-channel-dialog.tsx +6 -5
  207. package/src/lib/components/shared/channel-code-label.tsx +1 -1
  208. package/src/lib/components/shared/channel-selector.tsx +4 -4
  209. package/src/lib/components/shared/configurable-operation-multi-selector.tsx +16 -14
  210. package/src/lib/components/shared/configurable-operation-selector.tsx +1 -1
  211. package/src/lib/components/shared/confirmation-dialog.tsx +8 -8
  212. package/src/lib/components/shared/country-selector.tsx +1 -1
  213. package/src/lib/components/shared/currency-selector.tsx +4 -4
  214. package/src/lib/components/shared/custom-fields-form.tsx +8 -24
  215. package/src/lib/components/shared/customer-address-form.tsx +3 -3
  216. package/src/lib/components/shared/customer-group-selector.tsx +1 -1
  217. package/src/lib/components/shared/customer-selector.tsx +1 -1
  218. package/src/lib/components/shared/error-page.tsx +1 -1
  219. package/src/lib/components/shared/facet-value-selector.tsx +10 -10
  220. package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +1 -1
  221. package/src/lib/components/shared/history-timeline/history-note-editor.tsx +1 -1
  222. package/src/lib/components/shared/history-timeline/history-note-entry.tsx +1 -1
  223. package/src/lib/components/shared/language-selector.tsx +4 -4
  224. package/src/lib/components/shared/navigation-confirmation.tsx +1 -1
  225. package/src/lib/components/shared/paginated-list-data-table.tsx +21 -18
  226. package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +6 -5
  227. package/src/lib/components/shared/rich-text-editor/image-dialog.tsx +1 -1
  228. package/src/lib/components/shared/rich-text-editor/link-dialog.tsx +1 -1
  229. package/src/lib/components/shared/rich-text-editor/responsive-toolbar.tsx +1 -1
  230. package/src/lib/components/shared/rich-text-editor/table-edit-icons.tsx +1 -1
  231. package/src/lib/components/shared/role-code-label.tsx +1 -1
  232. package/src/lib/components/shared/role-selector.tsx +4 -4
  233. package/src/lib/components/shared/seller-selector.tsx +1 -1
  234. package/src/lib/components/shared/stock-level-label.tsx +3 -5
  235. package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +3 -1
  236. package/src/lib/components/shared/tax-category-selector.tsx +1 -1
  237. package/src/lib/components/shared/translatable-form-field.tsx +15 -15
  238. package/src/lib/components/shared/zone-selector.tsx +1 -1
  239. package/src/lib/constants.ts +10 -0
  240. package/src/lib/framework/dashboard-widget/base-widget.tsx +11 -9
  241. package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +6 -4
  242. package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +8 -5
  243. package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +7 -4
  244. package/src/lib/framework/dashboard-widget/widget-filters-context.tsx +3 -1
  245. package/src/lib/framework/defaults.ts +34 -63
  246. package/src/lib/framework/layout-engine/page-layout.tsx +36 -36
  247. package/src/lib/framework/page/detail-page.tsx +10 -10
  248. package/src/lib/framework/page/use-extended-router.tsx +48 -23
  249. package/src/lib/graphql/api.ts +22 -7
  250. package/src/lib/graphql/graphql-env.d.ts +13 -25
  251. package/src/lib/hooks/use-display-locale.ts +40 -0
  252. package/src/lib/hooks/use-dynamic-translations.ts +46 -0
  253. package/src/lib/hooks/use-extended-detail-query.ts +1 -1
  254. package/src/lib/hooks/use-extended-list-query.ts +1 -1
  255. package/src/lib/hooks/use-local-format.ts +15 -1
  256. package/src/lib/hooks/use-saved-views.ts +7 -0
  257. package/src/lib/hooks/use-ui-language-loader.ts +30 -0
  258. package/src/lib/lib/load-i18n-messages.ts +17 -0
  259. package/src/lib/lib/trans.tsx +15 -11
  260. package/src/lib/providers/auth.tsx +2 -2
  261. package/src/lib/providers/channel-provider.tsx +3 -2
  262. package/src/lib/providers/i18n-provider.tsx +7 -14
  263. package/src/lib/providers/user-settings.tsx +46 -5
@@ -0,0 +1,66 @@
1
+ import { createCompilationErrorMessage, createCompiledCatalog, getCatalogForFile, getCatalogs, } from '@lingui/cli/api';
2
+ import { getConfig } from '@lingui/conf';
3
+ import * as fs from 'fs';
4
+ import * as path from 'path';
5
+ /**
6
+ * @description
7
+ * This Vite plugin compiles
8
+ * @param options
9
+ */
10
+ export function translationsPlugin(options) {
11
+ const { externalPoFiles = [], localesDir = 'src/i18n/locales', outputPath = 'assets/i18n' } = options;
12
+ const linguiConfig = getConfig({ configPath: path.join(options.packageRoot, 'lingui.config.js') });
13
+ const catalogsPromise = getCatalogs(linguiConfig);
14
+ async function compileTranslations(files, emitFile) {
15
+ const catalogs = await catalogsPromise;
16
+ for (const file of files) {
17
+ const catalogRelativePath = path.relative(options.packageRoot, file.path);
18
+ const fileCatalog = getCatalogForFile(catalogRelativePath, catalogs);
19
+ const { locale, catalog } = fileCatalog;
20
+ const { messages } = await catalog.getTranslations(locale, {
21
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
22
+ fallbackLocales: { default: linguiConfig.sourceLocale },
23
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
24
+ sourceLocale: linguiConfig.sourceLocale,
25
+ });
26
+ const { source: code, errors } = createCompiledCatalog(locale, messages, {
27
+ namespace: 'es',
28
+ pseudoLocale: linguiConfig.pseudoLocale,
29
+ });
30
+ if (errors.length) {
31
+ const message = createCompilationErrorMessage(locale, errors);
32
+ throw new Error(message +
33
+ `These errors fail build because \`failOnCompileError=true\` in Lingui Vite plugin configuration.`);
34
+ }
35
+ // Emit the compiled JavaScript file to the build output
36
+ const outputFileName = path.posix.join(outputPath, `${locale}.js`);
37
+ emitFile({
38
+ type: 'asset',
39
+ fileName: outputFileName,
40
+ source: code,
41
+ });
42
+ }
43
+ }
44
+ return {
45
+ name: 'vendure:compile-translations',
46
+ async generateBundle() {
47
+ // This runs during the bundle generation phase - emit files directly to build output
48
+ try {
49
+ const resolvedLocalesDir = path.resolve(options.packageRoot, localesDir);
50
+ // Get all built-in .po files
51
+ const builtInFiles = fs
52
+ .readdirSync(resolvedLocalesDir)
53
+ .filter(file => file.endsWith('.po'))
54
+ .map(file => ({
55
+ name: file,
56
+ path: path.join(resolvedLocalesDir, file),
57
+ }));
58
+ await compileTranslations(builtInFiles, this.emitFile);
59
+ this.info(`✓ Processed ${builtInFiles.length} translation files to ${outputPath}`);
60
+ }
61
+ catch (error) {
62
+ this.error(`Translation plugin error: ${error instanceof Error ? error.message : String(error)}`);
63
+ }
64
+ },
65
+ };
66
+ }
@@ -1,6 +1,7 @@
1
+ import { lingui } from '@lingui/vite-plugin';
1
2
  import tailwindcss from '@tailwindcss/vite';
2
3
  import { tanstackRouter } from '@tanstack/router-plugin/vite';
3
- import react from '@vitejs/plugin-react';
4
+ import react from '@vitejs/plugin-react-swc';
4
5
  import path from 'path';
5
6
  import { adminApiSchemaPlugin } from './vite-plugin-admin-api-schema.js';
6
7
  import { configLoaderPlugin } from './vite-plugin-config-loader.js';
@@ -10,6 +11,7 @@ import { gqlTadaPlugin } from './vite-plugin-gql-tada.js';
10
11
  import { dashboardTailwindSourcePlugin } from './vite-plugin-tailwind-source.js';
11
12
  import { themeVariablesPlugin } from './vite-plugin-theme.js';
12
13
  import { transformIndexHtmlPlugin } from './vite-plugin-transform-index.js';
14
+ import { translationsPlugin } from './vite-plugin-translations.js';
13
15
  import { uiConfigPlugin } from './vite-plugin-ui-config.js';
14
16
  /**
15
17
  * @description
@@ -25,8 +27,6 @@ export function vendureDashboardPlugin(options) {
25
27
  process.env.LINGUI_CONFIG = linguiConfigPath;
26
28
  }
27
29
  return [
28
- // TODO: solve https://github.com/kentcdodds/babel-plugin-macros/issues/87
29
- // lingui(),
30
30
  ...(options.disableTansStackRouterPlugin
31
31
  ? []
32
32
  : [
@@ -38,10 +38,9 @@ export function vendureDashboardPlugin(options) {
38
38
  }),
39
39
  ]),
40
40
  react({
41
- // babel: {
42
- // plugins: ['@lingui/babel-plugin-lingui-macro'],
43
- // },
41
+ plugins: [['@lingui/swc-plugin', {}]],
44
42
  }),
43
+ lingui({}),
45
44
  themeVariablesPlugin({ theme: options.theme }),
46
45
  dashboardTailwindSourcePlugin(),
47
46
  tailwindcss(),
@@ -59,6 +58,9 @@ export function vendureDashboardPlugin(options) {
59
58
  ? [gqlTadaPlugin({ gqlTadaOutputPath: options.gqlOutputPath, tempDir, packageRoot })]
60
59
  : []),
61
60
  transformIndexHtmlPlugin(),
61
+ translationsPlugin({
62
+ packageRoot,
63
+ }),
62
64
  ];
63
65
  }
64
66
  /**
package/lingui.config.js CHANGED
@@ -2,11 +2,34 @@ import { defineConfig } from '@lingui/cli';
2
2
 
3
3
  export default defineConfig({
4
4
  sourceLocale: 'en',
5
- locales: ['de', 'en'],
5
+ locales: [
6
+ 'he',
7
+ 'ar',
8
+ 'de',
9
+ 'en',
10
+ 'es',
11
+ 'pl',
12
+ 'zh_Hans',
13
+ 'zh_Hant',
14
+ 'pt_BR',
15
+ 'pt_PT',
16
+ 'cs',
17
+ 'fr',
18
+ 'ru',
19
+ 'uk',
20
+ 'it',
21
+ 'fa',
22
+ 'ne',
23
+ 'hr',
24
+ 'nb',
25
+ 'sv',
26
+ 'tr',
27
+ 'ja',
28
+ ],
6
29
  catalogs: [
7
30
  {
8
31
  path: '<rootDir>/src/i18n/locales/{locale}',
9
- include: ['<rootDir>'],
32
+ include: ['<rootDir>/src'],
10
33
  },
11
34
  ],
12
35
  });
package/package.json CHANGED
@@ -1,160 +1,163 @@
1
1
  {
2
- "name": "@vendure/dashboard",
3
- "private": false,
4
- "version": "3.5.0-minor-202509261210",
5
- "type": "module",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/vendure-ecommerce/vendure"
2
+ "name": "@vendure/dashboard",
3
+ "private": false,
4
+ "version": "3.5.0-minor-202510031341",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/vendure-ecommerce/vendure"
9
+ },
10
+ "homepage": "https://www.vendure.io",
11
+ "funding": "https://github.com/sponsors/michaelbromley",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "scripts": {
16
+ "dev": "vite",
17
+ "build:standalone": "vite build",
18
+ "build:vite": "tsc --project tsconfig.vite.json",
19
+ "build:plugin": "tsc --project tsconfig.plugin.json && node scripts/build-plugin.js",
20
+ "build": "npm run build:vite && npm run build:plugin",
21
+ "watch": "tsc --project tsconfig.vite.json --watch",
22
+ "test": "vitest run",
23
+ "lint": "eslint .",
24
+ "preview": "vite preview",
25
+ "generate-index": "node scripts/generate-index.js",
26
+ "i18n:extract": "lingui extract && node ./scripts/translate/i18n-tool.js extract",
27
+ "i18n:apply": "node ./scripts/translate/i18n-tool.js apply"
28
+ },
29
+ "module": "./src/lib/index.ts",
30
+ "main": "./src/lib/index.ts",
31
+ "types": "./src/lib/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./src/lib/index.d.ts",
35
+ "import": "./src/lib/index.ts",
36
+ "require": "./src/lib/index.ts"
9
37
  },
10
- "homepage": "https://www.vendure.io",
11
- "funding": "https://github.com/sponsors/michaelbromley",
12
- "publishConfig": {
13
- "access": "public"
38
+ "./plugin": {
39
+ "types": "./dist/plugin/index.d.ts",
40
+ "import": "./dist/plugin/index.js",
41
+ "require": "./dist/plugin/index.js"
14
42
  },
15
- "scripts": {
16
- "dev": "vite",
17
- "build:standalone": "vite build",
18
- "build:vite": "tsc --project tsconfig.vite.json",
19
- "build:plugin": "tsc --project tsconfig.plugin.json && node scripts/build-plugin.js",
20
- "build": "npm run build:vite && npm run build:plugin",
21
- "watch": "tsc --project tsconfig.vite.json --watch",
22
- "test": "vitest run",
23
- "lint": "eslint .",
24
- "preview": "vite preview",
25
- "generate-index": "node scripts/generate-index.js"
26
- },
27
- "module": "./src/lib/index.ts",
28
- "main": "./src/lib/index.ts",
29
- "types": "./src/lib/index.d.ts",
30
- "exports": {
31
- ".": {
32
- "types": "./src/lib/index.d.ts",
33
- "import": "./src/lib/index.ts",
34
- "require": "./src/lib/index.ts"
35
- },
36
- "./plugin": {
37
- "types": "./dist/plugin/index.d.ts",
38
- "import": "./dist/plugin/index.js",
39
- "require": "./dist/plugin/index.js"
40
- },
41
- "./vite": {
42
- "types": "./dist/vite/index.d.ts",
43
- "import": "./dist/vite/index.js",
44
- "require": "./dist/vite/index.js"
45
- }
46
- },
47
- "files": [
48
- "dist",
49
- "src",
50
- "lingui.config.js",
51
- "index.html"
52
- ],
53
- "dependencies": {
54
- "@dnd-kit/core": "^6.3.1",
55
- "@dnd-kit/modifiers": "^9.0.0",
56
- "@dnd-kit/sortable": "^10.0.0",
57
- "@hookform/resolvers": "^4.1.3",
58
- "@lingui/babel-plugin-lingui-macro": "^5.2.0",
59
- "@lingui/cli": "^5.2.0",
60
- "@lingui/core": "^5.2.0",
61
- "@lingui/react": "^5.2.0",
62
- "@lingui/vite-plugin": "^5.2.0",
63
- "@radix-ui/react-accordion": "^1.2.11",
64
- "@radix-ui/react-alert-dialog": "^1.1.14",
65
- "@radix-ui/react-aspect-ratio": "^1.1.7",
66
- "@radix-ui/react-avatar": "^1.1.10",
67
- "@radix-ui/react-checkbox": "^1.3.2",
68
- "@radix-ui/react-collapsible": "^1.1.11",
69
- "@radix-ui/react-context-menu": "^2.2.15",
70
- "@radix-ui/react-dialog": "^1.1.14",
71
- "@radix-ui/react-dropdown-menu": "^2.1.15",
72
- "@radix-ui/react-hover-card": "^1.1.14",
73
- "@radix-ui/react-label": "^2.1.7",
74
- "@radix-ui/react-menubar": "^1.1.15",
75
- "@radix-ui/react-navigation-menu": "^1.2.13",
76
- "@radix-ui/react-popover": "^1.1.14",
77
- "@radix-ui/react-progress": "^1.1.7",
78
- "@radix-ui/react-radio-group": "^1.3.7",
79
- "@radix-ui/react-scroll-area": "^1.2.9",
80
- "@radix-ui/react-select": "^2.2.5",
81
- "@radix-ui/react-separator": "^1.1.7",
82
- "@radix-ui/react-slider": "^1.3.5",
83
- "@radix-ui/react-slot": "^1.2.3",
84
- "@radix-ui/react-switch": "^1.2.5",
85
- "@radix-ui/react-tabs": "^1.1.12",
86
- "@radix-ui/react-toggle": "^1.1.9",
87
- "@radix-ui/react-toggle-group": "^1.1.10",
88
- "@radix-ui/react-tooltip": "^1.2.7",
89
- "@tailwindcss/vite": "^4.1.5",
90
- "@tanstack/eslint-plugin-query": "^5.66.1",
91
- "@tanstack/react-query": "^5.66.7",
92
- "@tanstack/react-query-devtools": "^5.68.0",
93
- "@tanstack/react-router": "^1.105.0",
94
- "@tanstack/react-table": "^8.21.2",
95
- "@tanstack/router-devtools": "^1.105.0",
96
- "@tanstack/router-plugin": "^1.105.0",
97
- "@tiptap/extension-floating-menu": "^3.4.4",
98
- "@tiptap/extension-image": "^3.4.4",
99
- "@tiptap/extension-table": "^3.4.4",
100
- "@tiptap/extension-text-style": "^3.4.4",
101
- "@tiptap/pm": "^3.4.4",
102
- "@tiptap/react": "^3.4.4",
103
- "@tiptap/starter-kit": "^3.4.4",
104
- "@types/react": "^19.0.10",
105
- "@types/react-dom": "^19.0.4",
106
- "@uidotdev/usehooks": "^2.4.1",
107
- "@vendure/common": "^3.5.0-minor-202509261210",
108
- "@vendure/core": "^3.5.0-minor-202509261210",
109
- "@vitejs/plugin-react": "^4.3.4",
110
- "acorn": "^8.11.3",
111
- "acorn-walk": "^8.3.2",
112
- "awesome-graphql-client": "^2.1.0",
113
- "class-variance-authority": "^0.7.1",
114
- "clsx": "^2.1.1",
115
- "cmdk": "^1.1.1",
116
- "date-fns": "^4.0.0",
117
- "embla-carousel-react": "^8.6.0",
118
- "express-rate-limit": "^7.5.0",
119
- "fast-glob": "^3.3.2",
120
- "fs-extra": "^11.2.0",
121
- "gql.tada": "^1.8.10",
122
- "graphql": "^16.10.0",
123
- "input-otp": "^1.4.2",
124
- "json-edit-react": "^1.23.1",
125
- "lucide-react": "^0.475.0",
126
- "motion": "^12.6.2",
127
- "next-themes": "^0.4.6",
128
- "react": "^19.0.0",
129
- "react-day-picker": "^9.8.0",
130
- "react-dom": "^19.0.0",
131
- "react-dropzone": "^14.3.8",
132
- "react-hook-form": "^7.60.0",
133
- "react-resizable-panels": "^3.0.3",
134
- "recharts": "^2.15.4",
135
- "sonner": "^2.0.6",
136
- "tailwind-merge": "^3.2.0",
137
- "tailwindcss": "^4.1.5",
138
- "tailwindcss-animate": "^1.0.7",
139
- "tsconfig-paths": "^4.2.0",
140
- "tw-animate-css": "^1.2.9",
141
- "vaul": "^1.1.2",
142
- "vite": "^6.3.5",
143
- "zod": "^3.25.76"
144
- },
145
- "devDependencies": {
146
- "@eslint/js": "^9.19.0",
147
- "@types/node": "^22.13.4",
148
- "eslint": "^9.19.0",
149
- "eslint-plugin-react": "^7.37.4",
150
- "eslint-plugin-react-hooks": "^5.0.0",
151
- "eslint-plugin-react-refresh": "^0.4.18",
152
- "globals": "^15.14.0",
153
- "vite-plugin-dts": "^4.5.3"
154
- },
155
- "optionalDependencies": {
156
- "lightningcss-linux-arm64-musl": "^1.29.3",
157
- "lightningcss-linux-x64-musl": "^1.29.1"
158
- },
159
- "gitHead": "aa1c6971ebbd4954da1ce77fba1d6022051953db"
43
+ "./vite": {
44
+ "types": "./dist/vite/index.d.ts",
45
+ "import": "./dist/vite/index.js",
46
+ "require": "./dist/vite/index.js"
47
+ }
48
+ },
49
+ "files": [
50
+ "dist",
51
+ "src",
52
+ "lingui.config.js",
53
+ "index.html"
54
+ ],
55
+ "dependencies": {
56
+ "@dnd-kit/core": "^6.3.1",
57
+ "@dnd-kit/modifiers": "^9.0.0",
58
+ "@dnd-kit/sortable": "^10.0.0",
59
+ "@hookform/resolvers": "^4.1.3",
60
+ "@lingui/cli": "^5.5.0",
61
+ "@lingui/core": "^5.5.0",
62
+ "@lingui/react": "^5.5.0",
63
+ "@lingui/swc-plugin": "^5.6.1",
64
+ "@lingui/vite-plugin": "^5.5.0",
65
+ "@radix-ui/react-accordion": "^1.2.11",
66
+ "@radix-ui/react-alert-dialog": "^1.1.14",
67
+ "@radix-ui/react-aspect-ratio": "^1.1.7",
68
+ "@radix-ui/react-avatar": "^1.1.10",
69
+ "@radix-ui/react-checkbox": "^1.3.2",
70
+ "@radix-ui/react-collapsible": "^1.1.11",
71
+ "@radix-ui/react-context-menu": "^2.2.15",
72
+ "@radix-ui/react-dialog": "^1.1.14",
73
+ "@radix-ui/react-dropdown-menu": "^2.1.15",
74
+ "@radix-ui/react-hover-card": "^1.1.14",
75
+ "@radix-ui/react-label": "^2.1.7",
76
+ "@radix-ui/react-menubar": "^1.1.15",
77
+ "@radix-ui/react-navigation-menu": "^1.2.13",
78
+ "@radix-ui/react-popover": "^1.1.14",
79
+ "@radix-ui/react-progress": "^1.1.7",
80
+ "@radix-ui/react-radio-group": "^1.3.7",
81
+ "@radix-ui/react-scroll-area": "^1.2.9",
82
+ "@radix-ui/react-select": "^2.2.5",
83
+ "@radix-ui/react-separator": "^1.1.7",
84
+ "@radix-ui/react-slider": "^1.3.5",
85
+ "@radix-ui/react-slot": "^1.2.3",
86
+ "@radix-ui/react-switch": "^1.2.5",
87
+ "@radix-ui/react-tabs": "^1.1.12",
88
+ "@radix-ui/react-toggle": "^1.1.9",
89
+ "@radix-ui/react-toggle-group": "^1.1.10",
90
+ "@radix-ui/react-tooltip": "^1.2.7",
91
+ "@tailwindcss/vite": "^4.1.5",
92
+ "@tanstack/eslint-plugin-query": "^5.66.1",
93
+ "@tanstack/react-query": "^5.66.7",
94
+ "@tanstack/react-query-devtools": "^5.68.0",
95
+ "@tanstack/react-router": "^1.105.0",
96
+ "@tanstack/react-table": "^8.21.2",
97
+ "@tanstack/router-devtools": "^1.105.0",
98
+ "@tanstack/router-plugin": "^1.105.0",
99
+ "@tiptap/extension-floating-menu": "^3.4.4",
100
+ "@tiptap/extension-image": "^3.4.4",
101
+ "@tiptap/extension-table": "^3.4.4",
102
+ "@tiptap/extension-text-style": "^3.4.4",
103
+ "@tiptap/pm": "^3.4.4",
104
+ "@tiptap/react": "^3.4.4",
105
+ "@tiptap/starter-kit": "^3.4.4",
106
+ "@types/react": "^19.0.10",
107
+ "@types/react-dom": "^19.0.4",
108
+ "@uidotdev/usehooks": "^2.4.1",
109
+ "@vitejs/plugin-react": "^5.0.4",
110
+ "@vitejs/plugin-react-swc": "^4.1.0",
111
+ "acorn": "^8.11.3",
112
+ "acorn-walk": "^8.3.2",
113
+ "awesome-graphql-client": "^2.1.0",
114
+ "class-variance-authority": "^0.7.1",
115
+ "clsx": "^2.1.1",
116
+ "cmdk": "^1.1.1",
117
+ "date-fns": "^4.0.0",
118
+ "embla-carousel-react": "^8.6.0",
119
+ "express-rate-limit": "^7.5.0",
120
+ "fast-glob": "^3.3.2",
121
+ "fs-extra": "^11.2.0",
122
+ "gql.tada": "^1.8.13",
123
+ "graphql": "^16.11.0",
124
+ "input-otp": "^1.4.2",
125
+ "json-edit-react": "^1.23.1",
126
+ "lucide-react": "^0.475.0",
127
+ "motion": "^12.6.2",
128
+ "next-themes": "^0.4.6",
129
+ "react": "^19.0.0",
130
+ "react-day-picker": "^9.8.0",
131
+ "react-dom": "^19.0.0",
132
+ "react-dropzone": "^14.3.8",
133
+ "react-hook-form": "^7.60.0",
134
+ "react-resizable-panels": "^3.0.3",
135
+ "recharts": "^2.15.4",
136
+ "sonner": "^2.0.6",
137
+ "tailwind-merge": "^3.2.0",
138
+ "tailwindcss": "^4.1.5",
139
+ "tailwindcss-animate": "^1.0.7",
140
+ "tsconfig-paths": "^4.2.0",
141
+ "tw-animate-css": "^1.2.9",
142
+ "vaul": "^1.1.2",
143
+ "vite": "^6.3.6",
144
+ "zod": "^3.25.76"
145
+ },
146
+ "devDependencies": {
147
+ "@eslint/js": "^9.19.0",
148
+ "@types/node": "^22.13.4",
149
+ "@vendure/common": "^3.5.0-minor-202510031341",
150
+ "@vendure/core": "^3.5.0-minor-202510031341",
151
+ "eslint": "^9.19.0",
152
+ "eslint-plugin-react": "^7.37.4",
153
+ "eslint-plugin-react-hooks": "^5.0.0",
154
+ "eslint-plugin-react-refresh": "^0.4.18",
155
+ "globals": "^15.14.0",
156
+ "vite-plugin-dts": "^4.5.4"
157
+ },
158
+ "optionalDependencies": {
159
+ "lightningcss-linux-arm64-musl": "^1.29.3",
160
+ "lightningcss-linux-x64-musl": "^1.29.1"
161
+ },
162
+ "gitHead": "ffe957ddc6b419f17fced0b4b94fe66fc42528f8"
160
163
  }
@@ -5,7 +5,6 @@ import { ServerConfigProvider } from '@/vdb/providers/server-config.js';
5
5
  import { ThemeProvider } from '@/vdb/providers/theme-provider.js';
6
6
  import { UserSettingsProvider } from '@/vdb/providers/user-settings.js';
7
7
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
8
- import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
9
8
  import React from 'react';
10
9
 
11
10
  export const queryClient = new QueryClient();
@@ -23,9 +22,6 @@ export function AppProviders({ children }: { children: React.ReactNode }) {
23
22
  </AuthProvider>
24
23
  </ThemeProvider>
25
24
  </UserSettingsProvider>
26
- {process.env.NODE_ENV === 'development' && (
27
- <ReactQueryDevtools initialIsOpen={false} buttonPosition="bottom-left" />
28
- )}
29
25
  </QueryClientProvider>
30
26
  </I18nProvider>
31
27
  );
@@ -6,7 +6,7 @@ import { DataTableBulkActionItem } from '@/vdb/components/data-table/data-table-
6
6
  import { usePaginatedList } from '@/vdb/components/shared/paginated-list-data-table.js';
7
7
  import { getMutationName } from '@/vdb/framework/document-introspection/get-document-structure.js';
8
8
  import { api } from '@/vdb/graphql/api.js';
9
- import { Trans, useLingui } from '@/vdb/lib/trans.js';
9
+ import { Trans, useLingui } from '@lingui/react/macro';
10
10
 
11
11
  interface DeleteBulkActionProps {
12
12
  /** The GraphQL mutation document to execute */
@@ -79,7 +79,7 @@ export function DeleteBulkAction({
79
79
  table,
80
80
  }: Readonly<DeleteBulkActionProps>) {
81
81
  const { refetchPaginatedList } = usePaginatedList();
82
- const { i18n } = useLingui();
82
+ const { t } = useLingui();
83
83
  const queryClient = useQueryClient();
84
84
 
85
85
  const { mutate } = useMutation({
@@ -105,13 +105,14 @@ export function DeleteBulkAction({
105
105
  }
106
106
 
107
107
  if (0 < deleted) {
108
- toast.success(i18n.t(`Deleted ${deleted} ${entityName}`));
108
+ toast.success(t`Deleted ${deleted} ${entityName}`);
109
109
  }
110
110
  if (0 < failed) {
111
+ const allErrors = errors.join(', ');
111
112
  const errorMessage =
112
113
  errors.length > 0
113
- ? i18n.t(`Failed to delete ${failed} ${entityName}: ${errors.join(', ')}`)
114
- : i18n.t(`Failed to delete ${failed} ${entityName}`);
114
+ ? t`Failed to delete ${failed} ${entityName}: ${allErrors}`
115
+ : t`Failed to delete ${failed} ${entityName}`;
115
116
  toast.error(errorMessage);
116
117
  }
117
118
 
@@ -8,7 +8,7 @@ import { DataTableBulkActionItem } from '@/vdb/components/data-table/data-table-
8
8
  import { usePaginatedList } from '@/vdb/components/shared/paginated-list-data-table.js';
9
9
  import { api } from '@/vdb/graphql/api.js';
10
10
  import { duplicateEntityDocument } from '@/vdb/graphql/common-operations.js';
11
- import { Trans, useLingui } from '@/vdb/lib/trans.js';
11
+ import { Trans, useLingui } from '@lingui/react/macro';
12
12
  import { DuplicateEntityDialog } from './duplicate-entity-dialog.js';
13
13
 
14
14
  interface DuplicateBulkActionProps {
@@ -31,7 +31,7 @@ export function DuplicateBulkAction({
31
31
  table,
32
32
  }: Readonly<DuplicateBulkActionProps>) {
33
33
  const { refetchPaginatedList } = usePaginatedList();
34
- const { i18n } = useLingui();
34
+ const { t } = useLingui();
35
35
  const [isDuplicating, setIsDuplicating] = useState(false);
36
36
  const [progress, setProgress] = useState({ completed: 0, total: 0 });
37
37
  const [dialogOpen, setDialogOpen] = useState(false);
@@ -93,9 +93,8 @@ export function DuplicateBulkAction({
93
93
 
94
94
  // Show results
95
95
  if (results.success > 0) {
96
- toast.success(
97
- i18n.t(`Successfully duplicated ${results.success} ${entityName.toLowerCase()}s`),
98
- );
96
+ const count = results.success;
97
+ toast.success(t`Successfully duplicated ${count} ${entityName}`);
99
98
  }
100
99
  if (results.failed > 0) {
101
100
  const errorMessage =
@@ -9,7 +9,7 @@ import {
9
9
  } from '@/vdb/components/ui/dialog.js';
10
10
  import { api } from '@/vdb/graphql/api.js';
11
11
  import { getEntityDuplicatorsDocument } from '@/vdb/graphql/common-operations.js';
12
- import { Trans } from '@/vdb/lib/trans.js';
12
+ import { Trans } from '@lingui/react/macro';
13
13
  import { useQuery } from '@tanstack/react-query';
14
14
  import { ConfigurableOperationInput } from '@vendure/common/lib/generated-types';
15
15
  import React, { useState } from 'react';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @description
3
+ * Sets the `dir` attribute on the HTML tag, which sets the global text direction
4
+ */
5
+ export function setDocumentDirection(direction: 'rtl' | 'ltr') {
6
+ document.documentElement.setAttribute('dir', direction);
7
+ }