Power-Fx icon indicating copy to clipboard operation
Power-Fx copied to clipboard

Localize runtime error messages

Open anderson-joyle opened this issue 1 year ago • 1 comments

anderson-joyle avatar Aug 20 '24 04:08 anderson-joyle

See #908, #548 #Closed

MikeStall avatar Aug 20 '24 05:08 MikeStall

✅ No public API change. #Resolved

LucGenetier avatar Aug 26 '24 17:08 LucGenetier

✅ No public API change. #Resolved

LucGenetier avatar Aug 27 '24 18:08 LucGenetier

    private static string GetDefaultErrorMessage(ErrorKind errorKind)

All those default error messages will need to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs:2473 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                Message = $"Lower value cannot be greater than Upper value",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryMath.cs:1288 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                Message = $"Lower value cannot be greater than Upper value",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryMath.cs:1330 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                Message = $"Places argument must be big enough to hold the result",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryMath.cs:1543 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                Message = "Filter() only supports one predicate",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryTable.cs:499 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

        var invalidSortColumnTemplate = "The specified column '{0}' does not exist or is an invalid sort column type.";

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryTable.cs:694 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                    Message = "Order table can't have duplicate values",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryTable.cs:831 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

        return CommonErrors.CustomError(irContext, "Only managed connections can be refreshed.");

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryTable.cs:1159 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                    Message = "Untyped number is not a valid Decimal value, possible overflow",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryUntypedObject.cs:223 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                    Message = "Untyped number is not a valid Decimal value, possible overflow",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryUntypedObject.cs:286 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

                    Message = "The UntypedObject does not represent an array",

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryUntypedObject.cs:390 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

            Message = $"The untyped object argument to the '{functionName}' function has an incorrect type. Expected: {expectedType}, Actual: {actualValue.Type}."

This needs to be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryUntypedObject.cs:557 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

We typically don't check in translated (satellite) resources, those are managed by the localization team. #Resolved


Refers to: src/strings/PowerFxRuntimeResources.pt-BR.resx:1 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 27 '24 20:08 CarlosFigueiraMSFT

Right. I added this to run some tests. Is there any harm on leaving it checked in? If I remove it I'll have to also remove some test cases.


In reply to: 2313486363


Refers to: src/strings/PowerFxRuntimeResources.pt-BR.resx:1 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

anderson-joyle avatar Aug 28 '24 15:08 anderson-joyle

✅ No public API change. #Resolved

LucGenetier avatar Aug 29 '24 03:08 LucGenetier

✅ No public API change. #Resolved

LucGenetier avatar Aug 29 '24 15:08 LucGenetier

✅ No public API change. #Resolved

LucGenetier avatar Aug 29 '24 16:08 LucGenetier

✅ No public API change. #Resolved

LucGenetier avatar Aug 29 '24 18:08 LucGenetier

✅ No public API change. #Resolved

LucGenetier avatar Aug 29 '24 18:08 LucGenetier

                return CommonErrors.CustomError(formulaResult.IRContext, string.Format(CultureInfo.InvariantCulture, "Return type should have been {0}, found {1}", retType, formulaResultType));

This should be localized #Resolved


Refers to: src/libraries/Microsoft.PowerFx.Interpreter/CustomFunction/ReflectionFunction.cs:375 in 8b9a944. [](commit_id = 8b9a944b04fa5124f71cd9a9dec927208f6228b8, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 29 '24 22:08 CarlosFigueiraMSFT

That's a question for the localization team - if they're ok with having this file here for now, then it's ok. If that will mess their pipeline, then we should remove it.


In reply to: 2315639609


Refers to: src/strings/PowerFxRuntimeResources.pt-BR.resx:1 in 1692e01. [](commit_id = 1692e013404a4112a78859fca7e158d760b79aba, deletion_comment = False)

CarlosFigueiraMSFT avatar Aug 29 '24 22:08 CarlosFigueiraMSFT

✅ No public API change. #Resolved

LucGenetier avatar Aug 30 '24 00:08 LucGenetier

✅ No public API change. #Resolved

LucGenetier avatar Aug 30 '24 16:08 LucGenetier

✅ No public API change.

LucGenetier avatar Aug 30 '24 19:08 LucGenetier