Make TextBox placeholder translatable#1908
Merged
maan2003 merged 1 commit intolinebender:masterfrom Aug 15, 2021
Merged
Conversation
maan2003
approved these changes
Aug 11, 2021
Collaborator
maan2003
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks!
Collaborator
that is a limitation of Lens. I don't think it is easily to fix |
This makes the `TextBox` placeholder a `LabelText` which can be initialized with a `LocalizedString` and thus translated. One limitation is that the `LabelText` is bound to the same `Data` type parameter as the lensed `TextBox`, so it is not possible currently to use translation parameters from the broader application state.
639a2e5 to
69e480f
Compare
Contributor
Author
|
I noted down the limitations in the commit message, otherwise the code is unchanged and was just rebased on master. |
Member
|
This is good to go, right? |
Contributor
Author
|
@jneem yes, this should be good to go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the
TextBoxplaceholder aLabelTextwhich can be initialized with aLocalizedStringand thus translated.The problem that I have is that the
TextBoxseems to be bound to a very specific editable text vialens, and that couples theLabelTextto the same Data, which means I currently can’t use anything else from my main Data as placeholders of theLocalizedString(orDynamicfor that matter).