Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luanroger/globalstrings
๐ Simple package that helps manage strings for implementing new languages in .NET applications.
https://github.com/luanroger/globalstrings
csharp dotnet generic globalization language localization nuget package strings
Last synced: 20 days ago
JSON representation
๐ Simple package that helps manage strings for implementing new languages in .NET applications.
- Host: GitHub
- URL: https://github.com/luanroger/globalstrings
- Owner: LuanRoger
- License: mit
- Created: 2021-06-08T19:32:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-06T18:31:11.000Z (almost 3 years ago)
- Last Synced: 2025-01-05T16:19:52.839Z (about 1 month ago)
- Topics: csharp, dotnet, generic, globalization, language, localization, nuget, package, strings
- Language: C#
- Homepage: https://www.nuget.org/packages/GlobalStrings
- Size: 65.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GlobalStrings
### Simple package that helps manage strings for implementing new languages in .NET applications![](https://img.shields.io/nuget/v/GlobalStrings)
![](https://img.shields.io/nuget/dt/GlobalStrings)### Dependencies
- .NET 5
- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json) (>= 13.0.1)## Installation
### PM
```powershell
Install-Package GlobalStrings
```
### .NET CLI
```powershell
dotnet add package GlobalStrings
```
See also in [Nuget Packages](https://www.nuget.org/packages/GlobalStrings)## Simple example:
```csharp
using System.Collections.Generic;
using GlobalStrings;private Globalization _globalization { get; set; }
private LanguageInfo languagePtBr => new("pt_br", new(new()
{
{ "Home", new()
{
{0, "Olรก"},
{1, "Seja Bem-Vindo"}
}}
}));private LanguageInfo languageEn => new("en_us", new(new()
{
{"Home", new()
{
{ 0, "Hello" },
{ 1, "Wellcome" }
}}
}));private string congrats;
private string wellcome;public void ChangeLanguageTest()
{
StartGlobalization();
Assert.Equal("Olรก", congrats);
Assert.Equal("Seja Bem-Vindo", wellcome);_globalization.UpdateLang("en");
Assert.Equal("Hello", congrats);
Assert.Equal("Wellcome", wellcome);
}private void StartGlobalization()
{
_globalization = new(new() { languagePtBr, languageEn }, "pt_br");
_globalization.LangTextObserver += Globalization_LangTextObserver;
_globalization.StartGlobalization();
}private void Globalization_LangTextObserver(object sender, UpdateModeEventArgs updateModeEventArgs)
{
congrats = _globalization.SetText("Home", 0);
wellcome = _globalization.SetText("Home", 1);
}
```## Documentation
Access the [documentation here](https://github.com/LuanRoger/GlobalStrings/wiki).