Starts in:
2 DAYS
10 HRS
9 MIN
9 SEC
Starts in:
2 D
10 H
9 M
9 S
Open Closed

Extend SaasResource problem #7870 #8065


User avatar
0
sairam.thirupathuru created
  • ABP Framework version: Latest Version
  • Steps to reproduce the issue: I'm trying to extend "SaasResource " to the English language but the changes are not effecting in the application. Please help me out for resolving the issue.

Note : You don’t need the codebase for this. Just download the codebase from ABP.IO, open the SaaS Service, and try to add a new feature. Also, attempt to apply localization for the newly added feature.


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

    hi

    Note : You don’t need the codebase for this. Just download the codebase from ABP.IO, open the SaaS Service, and try to add a new feature. Also, attempt to apply localization for the newly added feature.

    Can you share this project via https://wetransfer.com/, I will change and share the code.

    liming.ma@volosoft.com

    Thanks.

  • User Avatar
    0
    sairam.thirupathuru created

    Hello @maliming You don't need a code project for this. Download the SAAS service from ABP.IO, add a new feature, and implement localization for it.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Our implementation codes may be different. You can share a project to eliminate misunderstandings.

    Thanks

    liming.ma@volosoft.com

  • User Avatar
    0
    sairam.thirupathuru created

    We can't send code from official emails. It's straightforward, so there won't be any misunderstandings.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi

    Please share the SaasService.Contract csproj file content.

  • User Avatar
    0
    sairam.thirupathuru created

    SaasService.Contract csproj

    <Project Sdk="Microsoft.NET.Sdk">
      <Import Project="..\common.props" />
      <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <RootNamespace>CastandCrew.PSLWeb.SaasService</RootNamespace>
        <GenerateDocumentationFile>true</GenerateDocumentationFile>
        <CopyLocalLockFileAssemblies>True</CopyLocalLockFileAssemblies>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.4" />
        <PackageReference Include="Volo.Abp.Features" Version="8.2.1" />
        <PackageReference Include="Volo.Saas.Host.Application.Contracts" Version="8.2.1" />
        <PackageReference Include="Volo.Saas.Tenant.Application.Contracts" Version="8.2.1" />
      </ItemGroup>
      <ItemGroup>
        <PackageReference Include="Volo.Abp.UI" Version="8.2.1" />
        <PackageReference Include="Volo.Abp.Validation" Version="8.2.1" />
        <PackageReference Include="Volo.Abp.Authorization.Abstractions" Version="8.2.1" />
        <PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="8.2.1" />
        <PackageReference Include="Volo.Abp.Ddd.Domain.Shared" Version="8.2.1" />
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="Localization\SaasService\*.json" />
        <Content Remove="Localization\SaasService\*.json" />
      </ItemGroup>
    </Project>
    

    SaasFeatureDefinitionProvider.cs

    using CastandCrew.PSLWeb.SaasService.Localization;
    using Volo.Abp.Features;
    using Volo.Abp.Localization;
    using Volo.Abp.Validation.StringValues;
    namespace CastandCrew.PSLWeb.SaasService.Features
    {
        public class SaasFeatureDefinitionProvider : FeatureDefinitionProvider
        {
            private static LocalizableString L(string name)
            {
                return LocalizableString.Create<SaasServiceResource>(name);
            }
            private static LocalizableStringInfo CreateLocalizableStringInfo(string name)
            {
                // Assuming you need the name and a string for localization
                return new LocalizableStringInfo("SaasService", name); // Adjust based on actual constructor
            }
            public override void Define(IFeatureDefinitionContext context)
            {
                var vendorFeatureGroup = context.AddGroup("SaasFeatureApp", L("SaasFeatureApp"));
                vendorFeatureGroup.AddFeature(
                    "SaasFeatureApp.IsLegacyFeature",
                    defaultValue: "false",
                    displayName: L("IsLegacyFeature"),
                    description: L("IsLegacyFeatureDescription"),
                    valueType: new ToggleStringValueType(),
                    true,
                    true
                );
                vendorFeatureGroup.AddFeature(
                  "SaasFeatureApp.ProjectType",
                  defaultValue: "Commercial",  // Set the default value here
                  displayName: L("ProjectType"),
                  description: L("ProjectTypeDescription"),
                  valueType: new SelectionStringValueType()
                  {
                      ItemSource = new StaticSelectionStringValueItemSource(
                        new LocalizableSelectionStringValueItem()
                        {
                            Value = "Commercial",
                            DisplayText = CreateLocalizableStringInfo("Commercial")
                        },
                        new LocalizableSelectionStringValueItem()
                        {
                            Value = "Features",
                            DisplayText = CreateLocalizableStringInfo("Features")
                        },
                         new LocalizableSelectionStringValueItem()
                         {
                             Value = "Television",
                             DisplayText = CreateLocalizableStringInfo("Television")
                         },
                          new LocalizableSelectionStringValueItem()
                          {
                              Value = "LiveOrEvents",
                              DisplayText = CreateLocalizableStringInfo("LiveOrEvents")
                          }),
                  },
                   true,
                   true
               );
            }
        }
    }
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try adding <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest> to your SaasService.Contract csproj file.

    https://abp.io/docs/latest/framework/infrastructure/virtual-file-system#configure-the-abpvirtualfilesystemoptions

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