multilanguages icon indicating copy to clipboard operation
multilanguages copied to clipboard

akmultilanguages with shared project structure

Open gheith3 opened this issue 2 years ago • 2 comments

This guide provides a step-by-step solution for sharing akmultilanguages library within a shared project structure that includes a MAUI Blazor app and a Blazor website.

Project Structure

  • Blazor Components Library
  • MAUI Blazor App
  • Blazor Website

Steps

  1. Inside the Blazor Components Library Install the package. Create a resources folder and add your resource files.
  2. Modify the .csproj File Add the following line to the <PropertyGroup> section of the .csproj file for the Blazor Components Library:
<PropertyGroup>
    ...
    <AssemblyName>your-project-assembly-name</AssemblyName>
</PropertyGroup>

Replace your-project-assembly-name with the actual assembly name for your project.

  1. In the MAUI Blazor App Add the package to your MAUI Blazor App project. Use the following code to configure the services:
builder.Services.AddLanguageContainer<EmbeddedResourceKeysProvider>(
    Assembly.Load("your-project-assembly-name"),
    "Resources");

Replace your-project-assembly-name with the actual assembly name you set in the Blazor Components Library.

Example Here's an example of the final folder structure:

- Blazor Components Library
    - Resources
        - YourResourceFile.resx
    - BlazorComponentsLibrary.csproj

- MAUI Blazor App
    - ...
    - MauiProgram.cs

- Blazor Website
    - ...
    - Program.cs

gheith3 avatar Nov 03 '23 09:11 gheith3

@gheith3 Thank you so much for this huge contribution, I will make sure to create the right Wiki pages this weekend and include this documentations inside

aksoftware98 avatar Nov 03 '23 14:11 aksoftware98

thank you, im more than welcome to working in this project, if i can do more things just tell me

gheith3 avatar Nov 03 '23 16:11 gheith3