Skip to content

Commit

Permalink
Merge pull request #220 from ycherkes/patch-1
Browse files Browse the repository at this point in the history
Documentation: Fix asset links
  • Loading branch information
earloc authored Sep 2, 2024
2 parents 75173db + 5f5d351 commit a62cb10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/code-first.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The `code-first` approach let´s you specify ordinary, **strongly typed** `Inter
These `typealized interfaces` then get picked up by the `source-generator`, which generates an implementing class that then can be used f.e. in conjuntion with ordinary `dependency-injection`.
This way, devlepors do not need to leave their natural habitat (the code-editor), which comes with the benefit of automatic code-refactorings, ultimatley optimizing the [inner-loop](https://notes.serverlessfirst.com/public/The+inner+and+outer+loops+of+software+development+workflow#Inner+loop), even during i18n-tasks.

![GenerateMethod](../assets/demo_TypealizedInterface_GenerateMethod.gif)
![GenerateMethod](https://github.com/earloc/TypealizR/blob/main/docs/assets/demo_TypealizedInterface_GenerateMethod.gif)

## pre-requisits
The consuming target project should at least reference a suitable version of [Microsoft.Extensions.Localization.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.Localization.Abstractions)
Expand All @@ -16,7 +16,7 @@ The consuming target project should at least reference a suitable version of [Mi
- install [TypealizR.CodeFirst.Abstractions](https://www.nuget.org/packages/TypealizR.CodeFirst.Abstractions) via [![NuGet](https://img.shields.io/nuget/v/TypealizR.CodeFirst.Abstractions)](https://www.nuget.org/packages/TypealizR.CodeFirst.Abstractions)
- Author a `Typealized-Interface` which basically is just an ordinary `interface`, marked with `CodeFirstTypealizedAttribute` somewhere within your project.

![demo_TypealizedInterface](../assets/demo_TypealizedInterface.png)
![demo_TypealizedInterface](https://github.com/earloc/TypealizR/blob/main/docs/assets/demo_TypealizedInterface.png)
```csharp
using TypealizR.CodeFirst.Abstractions;
namespace Sample;
Expand Down Expand Up @@ -104,7 +104,7 @@ The consuming target project should at least reference a suitable version of [Mi
> `dotnet tr cf ex some/path/to/a.csproj`

This will extract the following `resx`-file for above sample:
![TypealizedInterface_Resx](../assets//demo_TypealizedInterface_Resx.png?raw=true)
![TypealizedInterface_Resx](https://github.com/earloc/TypealizR/blob/main/docs/assets//demo_TypealizedInterface_Resx.png?raw=true)
```xml
<data name="Hello">
<value>Hello, fellow developer!</value>
Expand All @@ -113,4 +113,4 @@ The consuming target project should at least reference a suitable version of [Mi
<value>Hey {0}, welcome to {1} 👍!</value>
</data>
```
> executing this will OVERWRITE any existing file at the moment. In the future, TypealizR will be aware of existing files and provide a way to synchronize code with those files, in order to not loose any customizations done within them. Follow [the discussion](https://github.com/earloc/TypealizR/discussions/78) and let´s define together, what workflows would be needed to make code-first-i18n a real game-changer in the future!
> executing this will OVERWRITE any existing file at the moment. In the future, TypealizR will be aware of existing files and provide a way to synchronize code with those files, in order to not loose any customizations done within them. Follow [the discussion](https://github.com/earloc/TypealizR/discussions/78) and let´s define together, what workflows would be needed to make code-first-i18n a real game-changer in the future!

0 comments on commit a62cb10

Please sign in to comment.