Skip to content

Excel - Element List dialog: Present the localized version of formulas (#9144)#11329

Merged
feerrenrut merged 1 commit into
nvaccess:masterfrom
accessolutions:i9144-excelFormulaLocal
Jul 6, 2020
Merged

Excel - Element List dialog: Present the localized version of formulas (#9144)#11329
feerrenrut merged 1 commit into
nvaccess:masterfrom
accessolutions:i9144-excelFormulaLocal

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #9144

Summary of the issue:

In Microsoft Excel, the Elements List dialog presents formula in their English version, whatever the locale of the user.

Description of how this pull request fixes the issue:

Present instead the localized version of the formula, as Excel itself presents it to the user.

Testing performed:

From local source, opened the Elements List dialog in Excel 2016 with French locale on a worksheet containing formulas.

Known issues with pull request:

To reduce the diff and limit the API impact for add-ons, I did not rename ExcelCellInfo.formula nor add a formulaLocal member. Instead, I simply filled the existing structure member with the appropriate value.
Please let me know if you feel this is less readable and prefer I proceed otherwise.

Change log entry:

Section: Changes or Bug fixes, as you see fit.
In Microsoft Excel, the Elements List dialog now presents formulas in their localized form.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Known issues with pull request:

To reduce the diff and limit the API impact for add-ons, I did not rename ExcelCellInfo.formula nor add a formulaLocal member. Instead, I simply filled the existing structure member with the appropriate value.
Please let me know if you feel this is less readable and prefer I proceed otherwise.

I'm not sue about this one. EXCEL_CELLINFO isn't our structure, right?
It is very unlikely that add-ons are using NVDAHelper code directly, so I think it makes sense to use local everywhere.

@JulienCochuyt

JulienCochuyt commented Jul 3, 2020

Copy link
Copy Markdown
Contributor Author

@LeonarddeR wrote:

I'm not sue about this one. EXCEL_CELLINFO isn't our structure, right?

If I'm not wrong, it is, as of #9257,.

It is very unlikely that add-ons are using NVDAHelper code directly,

I was rather thinking of using the structure as already retrieved on the Python side.

so I think it makes sense to use local everywhere.

This is indeed what I did.
I filled the existing formula member with localized version instead of English version, without renaming nor adding an extra formulaLocal member - guessing typical use of this data is for presenting to the user rather than processing based on standardized English form.

Do you mean you'd prefer I rename the member? Or include both versions in the structure?

@LeonarddeR

Copy link
Copy Markdown
Collaborator

I'm not sue about this one. EXCEL_CELLINFO isn't our structure, right?

If I'm not wrong, it is, as of #9257,.

Yes, you're correct, I"m sorry.

I filled the existing formula member with localized version instead of English version, without renaming nor adding an extra formulaLocal member - guessing typical use of this data is for presenting to the user rather than processing based on standardized English form.

I think it all depended on whether the structure was our own or not. As it is ours, I think it is OK to leave this as is. Just forget my earlier comment ;)

@feerrenrut

Copy link
Copy Markdown
Contributor

To reduce the diff and limit the API impact for add-ons, I did not rename ExcelCellInfo.formula nor add a formulaLocal member. Instead, I simply filled the existing structure member with the appropriate value.
Please let me know if you feel this is less readable and prefer I proceed otherwise.

My only concern with this is if NVDA / other code (addons?) is looking for "known values" in the non-localized version of this. It seem unlikely if it is just the formula, but it would be good to spend a little time to see if that is possible.

@JulienCochuyt

JulienCochuyt commented Jul 3, 2020

Copy link
Copy Markdown
Contributor Author

To reduce the diff and limit the API impact for add-ons, I did not rename ExcelCellInfo.formula nor add a formulaLocal member. Instead, I simply filled the existing structure member with the appropriate value.
Please let me know if you feel this is less readable and prefer I proceed otherwise.

My only concern with this is if NVDA / other code (addons?) is looking for "known values" in the non-localized version of this. It seem unlikely if it is just the formula, but it would be good to spend a little time to see if that is possible.

Indeed only the formula is concerned by the proposed change.
And yes, any attempt on parsing/processing/identifying standardized English Excel function identifier is thus affected, which motivated my warning.
I'm not aware of any add-on that would be affected though, but you for sure have a wider view than I do in that matter.
As mentioned in #11329 (comment), my guess is that the formula is only ever used for presentation to the user.
Still, if you prefer ensure supporting current or future formula parsing, let me know and I'll add both versions in the structure - with a slight performance penalty.

EDIT: Regarding the possible customized processing of some specific spreadsheet as might be required by our customers here at Accessolutions, we could not foresee a case where the same code would need to apply in different locale, thus the localized version still meets our needs in that matter. Only speaking in our name, though.

@michaelDCurran

Copy link
Copy Markdown
Member

I am fine with reusing the existing struct member for the localized formula. I cannot think of a situation where an appModule developer could fairly argue they wanted to match logic against a raw formula.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, I think this is fine in that case. It would be worth putting something detailed in the "changes for developers" section of the change-log to call attention to this. I'll merge this shortly.

@feerrenrut feerrenrut self-assigned this Jul 6, 2020
@feerrenrut feerrenrut added feature/i18n Internationalization features app/microsoft-office labels Jul 6, 2020
@feerrenrut feerrenrut merged commit 810cee5 into nvaccess:master Jul 6, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.3 milestone Jul 6, 2020
@feerrenrut

Copy link
Copy Markdown
Contributor

I wasn't able to work out a good way to explain this change as it might appear to an add-on developer. I didn't add anything to the changes for developers section for this. Suggestions / PR welcome!

feerrenrut added a commit that referenced this pull request Jul 6, 2020
@JulienCochuyt JulienCochuyt deleted the i9144-excelFormulaLocal branch July 8, 2020 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app/microsoft-office feature/i18n Internationalization features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In MS Excel elements list formulas are always reported in English regardless of the Excel language.

5 participants