Open Closed

Get template definition by template name and culture name #7974


User avatar
0
  • ABP Framework version: v8.2
  • UI Type: Angular
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Steps to reproduce the issue: How can I get template definition by template name and culture name? for eg. var templateEn = await _templateDefinitionManager.GetAsync("templateName", "en"); var templateFr = await _templateDefinitionManager.GetAsync("templateName", "fr");

or

List<TemplateDefinition> templates = await _templateDefinitionManager.GetAsync("templateName");

Is it possible to do so?

public interface ITemplateDefinitionManager { [ItemNotNull] Task<TemplateDefinition> GetAsync([NotNull] string name);

[ItemNotNull]
Task&lt;IReadOnlyList&lt;TemplateDefinition&gt;> GetAllAsync();

Task&lt;TemplateDefinition?&gt; GetOrNullAsync(string name);

}

Right now templateDefinitionManager only get by name.


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    It is impossible to get TemplateDefinition based on culture.

    You can check how to get template content by specifying the culture.

    https://abp.io/docs/latest/Text-Templating#multiple-contents-localization

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09