Skip to content

Commit

Permalink
fixed docs for working with enums
Browse files Browse the repository at this point in the history
  • Loading branch information
valdisiljuconoks committed Mar 24, 2024
1 parent 363d638 commit a1536ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/translate-enum-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ public class Document

Now you can use following snippet to give end-user localized dropdown list of available document statuses:

```
```razor
@using DbLocalizationProvider
@inject ILocalizationProvider Provider
@model Document
@{
Expand All @@ -34,7 +35,7 @@ Now you can use following snippet to give end-user localized dropdown list of av
.Select(s => new SelectListItem
{
Value = s.ToString(),
Text = s.Translate()
Text = Provider.Translate(s)
});
}
Expand All @@ -43,11 +44,12 @@ Now you can use following snippet to give end-user localized dropdown list of av

Or if you just need to output current status of the document to the end-user:

```
```razor
@using DbLocalizationProvider
@inject ILocalizationProvider Provider
@model Document
@Model.Status.Translate()
@Provider.Translate(Model.Status)
```

## Specify Translation for Enum
Expand Down

0 comments on commit a1536ae

Please sign in to comment.