@open-mercato/core 0.7.1-develop.7181.1.702cedc42c → 0.7.1-develop.7183.1.db9678eeb8
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/auth/api/locale/route.js +18 -9
- package/dist/modules/auth/api/locale/route.js.map +2 -2
- package/dist/modules/translations/api/get/locales.js +7 -2
- package/dist/modules/translations/api/get/locales.js.map +2 -2
- package/dist/modules/translations/components/TranslationManager.js +70 -35
- package/dist/modules/translations/components/TranslationManager.js.map +2 -2
- package/dist/modules/translations/di.js +3 -0
- package/dist/modules/translations/di.js.map +2 -2
- package/dist/modules/translations/lib/supported-locales.js +31 -0
- package/dist/modules/translations/lib/supported-locales.js.map +7 -0
- package/dist/modules/wms/api/warehouseSearch.js +2 -2
- package/dist/modules/wms/api/warehouseSearch.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/auth/api/locale/route.ts +41 -9
- package/src/modules/translations/api/get/locales.ts +11 -1
- package/src/modules/translations/components/TranslationManager.tsx +103 -34
- package/src/modules/translations/di.ts +10 -0
- package/src/modules/translations/i18n/de.json +4 -1
- package/src/modules/translations/i18n/en.json +4 -1
- package/src/modules/translations/i18n/es.json +4 -1
- package/src/modules/translations/i18n/ko.json +4 -1
- package/src/modules/translations/i18n/pl.json +4 -1
- package/src/modules/translations/lib/supported-locales.ts +44 -0
- package/src/modules/wms/api/warehouseSearch.ts +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { escapeLikePattern } from '@open-mercato/shared/lib/db/escapeLikePattern'
|
|
2
|
-
import {
|
|
2
|
+
import { getSupportedLocales } from '@open-mercato/shared/lib/i18n/locale-set'
|
|
3
3
|
import { matchCountryCodes } from '@open-mercato/shared/lib/location/countries'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -15,7 +15,11 @@ export function buildWarehouseListSearchOr(term: string): Array<Record<string, u
|
|
|
15
15
|
{ city: { $ilike: like } },
|
|
16
16
|
{ country: { $ilike: like } },
|
|
17
17
|
]
|
|
18
|
-
|
|
18
|
+
// The served set, not the shipped baseline: an operator searching in a locale
|
|
19
|
+
// their app registered should match country names in that locale too.
|
|
20
|
+
// `resolveCountryName` goes through `Intl.DisplayNames`, so any code the
|
|
21
|
+
// runtime has region data for resolves without shipping a table.
|
|
22
|
+
const matchedCountryCodes = matchCountryCodes(term, { locales: [...getSupportedLocales()] })
|
|
19
23
|
if (matchedCountryCodes.length > 0) {
|
|
20
24
|
orFilters.push({ country: { $in: matchedCountryCodes } })
|
|
21
25
|
}
|