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

Remove LRE/LRO characters from results and error messages #1161

Merged
merged 2 commits into from
Apr 30, 2020
Merged

Remove LRE/LRO characters from results and error messages #1161

merged 2 commits into from
Apr 30, 2020

Conversation

rudyhuyn
Copy link
Contributor

@rudyhuyn rudyhuyn commented Apr 10, 2020

Fixes #504

Calculation results, Memory items, History items and error messages should be displayed LtoR whatever the current culture.

To this end, the current version of the code relies on ViewModels to format the string and add special characters (0x202a, 0x202c or 0x202d) to force Xaml to display the text left-to-right.

This implementation isn't ideal and case many issues with the clipboard when users try to copy-paste the result of a calculation.

This PR will move the management of the direction of the text-flow from the data (strings in view-models) to the UI renderer using the XAML property FlowDirection.

Now that the strings are exempt of special characters, copy-paste will work correctly, whatever the application destination.

Description of the changes:

  • remove all special characters to force a flow direction from all strings in view-models.
  • force controls displaying these strings to render the data left-to-right

Example of the UI when we only remove the special characters
image

After we force Xaml to render controls left-to-right
image

How changes were validated:

  • tested in English, arabian and hebrew.

xmlns:converters="using:CalculatorApp.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:CalculatorApp"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 cleaning

@rudyhuyn rudyhuyn requested a review from sanderl April 10, 2020 06:06
@rudyhuyn rudyhuyn merged commit 6e521d8 into microsoft:master Apr 30, 2020
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

Successfully merging this pull request may close these issues.

Copy paste result contains hidden character
2 participants