[PR #2048] [MERGED] EC-487 Add helpers to localize enum values #9463

Closed
opened 2026-04-11 02:21:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2048
Author: @fedemkr
Created: 8/23/2022
Status: Merged
Merged: 8/23/2022
Merged by: @fedemkr

Base: masterHead: EC-487-localizable-attribute-enum


📝 Commits (2)

  • 364b823 EC-487 Added helper to localize enum values and also a converter to use in xaml
  • 034f9db Merge branch 'master' into EC-487-localizable-attribute-enum

📊 Changes

4 files changed (+72 additions, -0 deletions)

View changed files

src/App/Utilities/EnumHelper.cs (+33 -0)
src/App/Utilities/LocalizableEnumConverter.cs (+23 -0)
src/Core/Attributes/LocalizableEnumAttribute.cs (+14 -0)
📝 src/Core/Core.csproj (+2 -0)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Add some helpers to ease enum value localization

Code changes

  • EnumHelper.cs: Helper to localize enums by using the type as a parameter or as a generic parameter
  • LocalizableEnumConverter.cs: Converter to be used in xaml that used the EnumHelper for the localization
  • LocalizableEnumAttribute.cs: Attribute to be used in enum values to set the key that is used for localization

Before you submit

  • I have checked for formatting errors (dotnet tool run dotnet-format --check) (required)
  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2048 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 8/23/2022 **Status:** ✅ Merged **Merged:** 8/23/2022 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `master` ← **Head:** `EC-487-localizable-attribute-enum` --- ### 📝 Commits (2) - [`364b823`](https://github.com/bitwarden/android/commit/364b823a9b3982204c455b37979b0ea86a243d19) EC-487 Added helper to localize enum values and also a converter to use in xaml - [`034f9db`](https://github.com/bitwarden/android/commit/034f9dbee374ce9c52df0a318ce0a249ef080db9) Merge branch 'master' into EC-487-localizable-attribute-enum ### 📊 Changes **4 files changed** (+72 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/App/Utilities/EnumHelper.cs` (+33 -0) ➕ `src/App/Utilities/LocalizableEnumConverter.cs` (+23 -0) ➕ `src/Core/Attributes/LocalizableEnumAttribute.cs` (+14 -0) 📝 `src/Core/Core.csproj` (+2 -0) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [ ] New feature development - [X] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Add some helpers to ease enum value localization ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **EnumHelper.cs:** Helper to localize enums by using the type as a parameter or as a generic parameter * **LocalizableEnumConverter.cs:** Converter to be used in xaml that used the EnumHelper for the localization * **LocalizableEnumAttribute.cs:** Attribute to be used in enum values to set the key that is used for localization ## Before you submit - [X] I have checked for formatting errors (`dotnet tool run dotnet-format --check`) (required) - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-11 02:21:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#9463