akmultilanguages with shared project structure
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
- Inside the Blazor Components Library Install the package. Create a resources folder and add your resource files.
- 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.
- 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 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
thank you, im more than welcome to working in this project, if i can do more things just tell me