|
1
|
{"slug":"/references/utils/utils.TranslationsUtils","title":"TranslationsUtils","frontmatter":{},"toc":[{"title":"Functions","id":"functions","level":2},{"title":"Functions","id":"functions-1","level":2},{"title":"applyTranslations","id":"applytranslations","level":3},{"title":"Parameters","id":"applytranslations-parameters","level":4},{"title":"Returns","id":"applytranslations-returns","level":4},{"title":"applyTranslationsToTaxLines","id":"applytranslationstotaxlines","level":3},{"title":"Parameters","id":"applytranslationstotaxlines-parameters","level":4},{"title":"Returns","id":"applytranslationstotaxlines-returns","level":4}],"blocks":[{"kind":"heading","level":2,"text":"Functions","id":"functions"},{"kind":"linkList","items":[{"title":"applyTranslations","href":"/references/utils/utils.TranslationsUtils#applytranslations"},{"title":"applyTranslationsToTaxLines","href":"/references/utils/utils.TranslationsUtils#applytranslationstotaxlines"}]},{"kind":"heading","level":2,"text":"Functions","id":"functions-1"},{"kind":"heading","level":3,"text":"applyTranslations","id":"applytranslations"},{"kind":"heading","level":4,"text":"Parameters","id":"applytranslations-parameters"},{"kind":"typeList","sectionTitle":"applyTranslations","types":[{"name":"__namedParameters","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"localeCode","type":"`undefined` \\| `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"objects","type":"`Record<string, any>`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"[MedusaContainer](/references/medusa/types/medusa.MedusaContainer)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"applytranslations-returns"},{"kind":"typeList","sectionTitle":"applyTranslations","types":[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]},{"kind":"heading","level":3,"text":"applyTranslationsToTaxLines","id":"applytranslationstotaxlines"},{"kind":"heading","level":4,"text":"Parameters","id":"applytranslationstotaxlines-parameters"},{"kind":"typeList","sectionTitle":"applyTranslationsToTaxLines","types":[{"name":"taxLines","type":"[ItemTaxLineDTO](/references/tax/interfaces/tax.ItemTaxLineDTO)[] \\| [ShippingTaxLineDTO](/references/tax/interfaces/tax.ShippingTaxLineDTO)[]","description":"The tax lines to apply translations to.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rate_id","type":"`string`","description":"The associated rate's ID.\nWhen integrating with a third-party, you don't need to provide it.\nThis is mainly used for the built-in rates.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`number`","description":"The rate of the tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`null` \\| `string`","description":"The code of the tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the tax provider used to calculate and retrieve the tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data returned by the tax provider.\nUse this to store jurisdiction-level breakdown data\n(e.g. state, county, city rates) that is not captured in the aggregated rate.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string`","description":"The associated line item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_line_id","type":"`string`","description":"The associated shipping line's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"locale","type":"`undefined` \\| `string`","description":"The locale to apply translations to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"[MedusaContainer](/references/medusa/types/medusa.MedusaContainer)","description":"The container to use for the translations.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":4,"text":"Returns","id":"applytranslationstotaxlines-returns"},{"kind":"typeList","sectionTitle":"applyTranslationsToTaxLines","types":[{"name":"Promise","type":"Promise<[ItemTaxLineDTO](/references/tax/interfaces/tax.ItemTaxLineDTO)[] \\| [ShippingTaxLineDTO](/references/tax/interfaces/tax.ShippingTaxLineDTO)[]>","optional":false,"defaultValue":"","description":"The tax lines with translations applied.","expandable":false,"children":[{"name":"ItemTaxLineDTO[] \\| ShippingTaxLineDTO[]","type":"[ItemTaxLineDTO](/references/tax/interfaces/tax.ItemTaxLineDTO)[] \\| [ShippingTaxLineDTO](/references/tax/interfaces/tax.ShippingTaxLineDTO)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]}]} |