---
# System prepended metadata

title: NET Core Localization with Resource Files

---

# NET Core Localization with Resource Files
## General
* selection of the culture is based on CultureInfo.CurrentUICulture, NOT CurrentCulture, but set both anyway, just to make sure all cultures are the same

## File Naming Example
### Shared Resources
* SharedResources.resx (default/fallback language)
    * SharedResources.Designer.cs (auto generated)
* SharedResources.en-US.resx

## Code Example
### Using our shared resource
``` c#
public class MyService
{
    public string GetTestTranslation(){
        return SharedResources.Test;
    }
}
```

### Setting the Culture
``` c#
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
```

### Annotation