Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantic Localization Api #32

Open
Axemasta opened this issue Aug 27, 2023 · 0 comments
Open

Semantic Localization Api #32

Axemasta opened this issue Aug 27, 2023 · 0 comments

Comments

@Axemasta
Copy link
Owner

Whilst you could use mocale to set localizations for your semantic properties... there could be scope for some good user experience!

Add a method for each semantic property:

  • Localize
  • LocalizeSemanticDescription
  • LocalizeSemanticHelp

Each api would use the same key, allowing for a few qol features:

  • Code in localization code without writing all localizations for all semantic properties
  • Use the same key in code for each semantic type, ie the key: KeyOne would be used by all 3:
<Label Text="{mocale:Localize KeyOne}" 
    SemanticProperties.Description="{mocale:LocalizeSemanticDescription KeyOne}"
    SemanticProperties.Hint="{mocale:LocalizeSemanticHint KeyOne}" />
  • Json files still requires all keys:
{
    "KeyOne": "Hello World",
    "KeyOne_SemanticDescription": "A label that says hello world",
    "KeyOne_SemanticHint": "Something else that helps...",
}

If these values don't exist, a null value should be returned to prevent messing with default screen reader behaviours. Maybe some config, we DEFINITELY dont want $KeyOne$ being set as a semantic hint / description!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant