A comprehensive localization library providing common UI resources (fields, actions, messages, and validation messages) for .NET applications in English and Portuguese (pt-BR).
- Bilingual Support: English and Portuguese (pt-BR)
- Four Resource Types: Actions, Fields, Messages, and FluentValidation Messages
- 261+ Localized Resources: 33 actions, 162 fields, 66 messages
- Strongly-Typed Access: Static properties with compile-time safety
- ResourceManager Support: Runtime key lookup for dynamic scenarios
- .NET Multi-targeting: Supports .NET 8, 9, and 10
- FluentValidation Integration: Dedicated resources for FluentValidation messages
- Actions Resources Separated: Action verbs (Add, Edit, Delete, Save, etc.) moved from Fields to dedicated Actions.resx for better organization
- Messages Cleanup: Removed 51 redundant messages that can be replaced by parameterized templates (e.g., use
XNotFoundwith parameter instead ofUserNotFound,TokenNotFound, etc.) - New Template Messages: Added
ConfirmXtemplate for generic confirmations - Enhanced Documentation: Interactive dictionary pages for browsing all resources with translations
- Modern Solution Format: Using .slnx (XML-based) solution file format
dotnet add package NuvTools.ResourcesOr via NuGet Package Manager:
Install-Package NuvTools.Resources
User interface action verbs and commands (33 resources)
using NuvTools.Resources;
var addButton = Actions.Add; // "Add" / "Adicionar"
var saveButton = Actions.Save; // "Save" / "Salvar"
var deleteButton = Actions.Delete; // "Delete" / "Excluir"
var cancelButton = Actions.Cancel; // "Cancel" / "Cancelar"Note: Actions were separated from Fields in v10.0.0 for better semantic organization.
Common UI field labels and terms (162 resources)
using NuvTools.Resources;
var accountLabel = Fields.Account; // "Account" / "Conta"
var emailLabel = Fields.Email; // "E-mail"
var nameLabel = Fields.Name; // "Name" / "Nome"
var addressLabel = Fields.Address; // "Address" / "Logradouro"User-facing notifications and validation messages (66 resources)
using NuvTools.Resources;
var successMsg = Messages.OperationPerformedSuccessfully; // "Operation performed successfully."
var notFoundMsg = string.Format(Messages.XNotFound, "User"); // "User not found."
var confirmMsg = string.Format(Messages.ConfirmX, "deletion"); // "Confirm deletion?"Validation error messages for FluentValidation integration
using NuvTools.Resources;
// FluentValidation-specific messages (accessed via ResourceManager)
var notEmptyMsg = FluentValidationMessages.ResourceManager.GetString("NotEmpty");
var emailMsg = FluentValidationMessages.ResourceManager.GetString("EmailValidator");Resources automatically adapt to the current UI culture:
using System.Globalization;
using NuvTools.Resources;
// Set culture to Portuguese
CultureInfo.CurrentUICulture = new CultureInfo("pt-BR");
Console.WriteLine(Fields.Name); // Output: "Nome"
// Set culture to English
CultureInfo.CurrentUICulture = new CultureInfo("en");
Console.WriteLine(Fields.Name); // Output: "Name"The library provides two ways to access resources:
Strongly-typed properties with compile-time safety:
using NuvTools.Resources;
// Actions, Fields, and Messages provide static properties
var addAction = Actions.Add; // "Add" / "Adicionar"
var nameField = Fields.Name; // "Name" / "Nome"
var successMsg = Messages.Success; // "Success!" / "Sucesso!"Use ResourceManager when you need to look up resources by string keys at runtime:
using System.Globalization;
using NuvTools.Resources;
// All resource classes expose a ResourceManager property
var action = Actions.ResourceManager.GetString("Add");
var field = Fields.ResourceManager.GetString("Name");
var message = Messages.ResourceManager.GetString("Success");
// Specify culture explicitly
var localizedField = Fields.ResourceManager.GetString("Name", new CultureInfo("pt-BR")); // "Nome"
var localizedAction = Actions.ResourceManager.GetString("Add", new CultureInfo("pt-BR")); // "Adicionar"
// FluentValidation messages
var notEmptyMsg = FluentValidationMessages.ResourceManager.GetString("NotEmpty");# Build
dotnet build
# Build for Release
dotnet build -c Release
# Create NuGet package
dotnet pack -c ReleaseBrowse searchable dictionaries with all available resources and their English/Portuguese translations:
| Dictionary | Resources | Description |
|---|---|---|
| Actions | 33 | Action verbs and commands (Add, Edit, Delete, Save, Search, etc.) |
| Fields | 162 | Form field labels and UI elements (Account, Name, Email, Address, etc.) |
| Messages | 66 | User messages and validation templates (XNotFound, XInvalid, XRequired, etc.) |
These dictionaries are perfect for:
- Finding the right resource key before coding
- Browsing available translations
- Ensuring consistency across your application
- .NET 8
- .NET 9
- .NET 10
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the terms specified in the LICENSE file.