-
Notifications
You must be signed in to change notification settings - Fork 335
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
Culture support for in operator and Sort function #2539
Open
gregli-msft
wants to merge
8
commits into
main
Choose a base branch
from
gregli/culture-tr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ed1d335
Updates
gregli-msft e44f670
Merge branch 'main' into gregli/culture-tr
gregli-msft f746d19
Merge branch 'main' into gregli/culture-tr
gregli-msft 7f9564c
Merge branch 'main' into gregli/culture-tr
gregli-msft 79d0cb2
Updates
gregli-msft de3e5a7
Merge branch 'gregli/culture-tr' of https://github.com/microsoft/powe…
gregli-msft 0d5db88
Updates
gregli-msft e4d232e
Updates
gregli-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
144 changes: 144 additions & 0 deletions
144
src/tests/Microsoft.PowerFx.Core.Tests.Shared/ExpressionTestCases/Culture_da-DK.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
#SETUP: RegEx,CultureInfo("da-DK"),PowerFxV1CompatibilityRules,ConsistentOneColumnTableResult,SupportColumnNamesAsIdentifiers | ||
|
||
>> Language() | ||
"da-DK" | ||
|
||
>> "Ø" = UniChar( Hex2Dec( "00d8") ) | ||
true | ||
|
||
>> "ø" = UniChar( Hex2Dec( "00f8") ) | ||
true | ||
|
||
// UPPER, LOWER, PROPER | ||
|
||
>> Upper( "ø" ) | ||
"Ø" | ||
|
||
>> Lower( "Ø" ) | ||
"ø" | ||
|
||
>> Upper( "ø" ) = "Ø" | ||
true | ||
|
||
>> Lower( "Ø" ) = "ø" | ||
true | ||
|
||
>> Lower( "ørkesløse" ) = Lower( "ØRKESLØSE" ) | ||
true | ||
|
||
>> Upper( "ørkesløse" ) = Upper( "ØRKESLØSE" ) | ||
true | ||
|
||
>> Proper( "ørkesløse" ) | ||
"Ørkesløse" | ||
|
||
>> Proper( "ØRKESLØSE" ) | ||
"Ørkesløse" | ||
|
||
// VALUE, DECIMAL, FLOAT | ||
// Comma decimal seperator | ||
|
||
>> Value( "123,456" ) | ||
123.456 | ||
|
||
>> Value( "123,456", "da-DK" ) | ||
123.456 | ||
|
||
>> Decimal( "123,456" ) | ||
123.456 | ||
|
||
>> Decimal( "123,456", "da-DK" ) | ||
123.456 | ||
|
||
>> Float( "123,456" ) | ||
123.456 | ||
|
||
>> Float( "123,456", "da-DK" ) | ||
123.456 | ||
|
||
// TEXT | ||
|
||
>> Text( DateTime(2010,1,1,14,0,0,0), "mmm ddd yyyy AM/PM" ) | ||
"jan. fre. 2010 PM" | ||
|
||
>> Text( DateTime(2020,1,1,2,0,0,0), "mmmm dddd yyyy AM/PM" ) | ||
"januar onsdag 2020 AM" | ||
|
||
>> Text( 123456789, "#,###.00" ) | ||
"123456789,00000" | ||
|
||
>> Text( 123456789, "#.###,00" ) | ||
"123.456.789,00" | ||
|
||
// IN AND EXACTIN | ||
|
||
>> "å" in "ømtåligt" | ||
true | ||
|
||
>> "å" in "ØMTÅLIGT" | ||
true | ||
|
||
>> "Å" in "ømtåligt" | ||
true | ||
|
||
>> "Å" in "ØMTÅLIGT" | ||
true | ||
|
||
>> "å" exactin "ømtåligt" | ||
true | ||
|
||
>> "å" exactin "ØMTÅLIGT" | ||
false | ||
|
||
>> "Å" exactin "ØMTÅLIGT" | ||
true | ||
|
||
>> "ØMtålIGT" in ["ømtåligt","bcde"] | ||
true | ||
|
||
>> "ømtålIgt" in ["bcde", "ØMTÅLiGT"] | ||
true | ||
|
||
>> "ømtålIgt" in ["bcde", "MTÅLiGT"] | ||
false | ||
|
||
// SORT | ||
|
||
>> Concat( Sort( Split( "n F X W o i j x B m I R G S h Ø L p K t A k l y J æ u v s T a ø N D z Æ e O U E H r Z å g b q Å P d f C M c Y w V Q", " " ), Value ), Value, " " ) | ||
"A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Æ æ Ø ø Å å" | ||
|
||
>> Concat( SortByColumns( Split( "U c q s X Å P L i I u d J å M E l k W v j Æ n a B K C D e ø æ f O y m Ø r Q R A x h T H N Z F V w o S g t p G Y b z", " " ), "Value" ), Value, " " ) | ||
"A a B b C c D d E e F f G g H h I i J j K k L l M m N n O o P p Q q R r S s T t U u V v W w X x Y y Z z Æ æ Ø ø Å å" | ||
|
||
// REGULAR EXPRESSIONS | ||
// Always uses invariant in all locales, even in en-US and tr-TR (industry standard) | ||
|
||
>> IsMatch( "å", "Å", MatchOptions.IgnoreCase ) | ||
true | ||
|
||
>> IsMatch( "Å", "å", MatchOptions.IgnoreCase ) | ||
true | ||
|
||
>> IsMatch( "Å", "A", MatchOptions.IgnoreCase ) | ||
false | ||
|
||
>> IsMatch( "Å", "a", MatchOptions.IgnoreCase ) | ||
false | ||
|
||
>> IsMatch( "ø", "Ø", MatchOptions.IgnoreCase ) | ||
true | ||
|
||
>> IsMatch( "Ø", "ø", MatchOptions.IgnoreCase ) | ||
true | ||
|
||
>> IsMatch( "æ", "Æ", MatchOptions.IgnoreCase ) | ||
true | ||
|
||
>> IsMatch( "Æ", "æ", MatchOptions.IgnoreCase ) | ||
true | ||
|
||
>> ShowColumns( Match( "ØMTÅÅLIGT", "\u00c5+" ), FullMatch, StartMatch ) | ||
{FullMatch:"ÅÅ",StartMatch:4} | ||
|
||
>> IsMatch( "ØMTÅÅLIGT", "Ø", MatchOptions.Contains ) | ||
true |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
services
always have a CultureInfo value? In other places where I see CultureInfo being accessed (mostly in LibraryText.txt) it comes from the runner directly, not from the service provider.