-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Incorrect output of _translateFormulaToEnglish() function #2533
Comments
This is an interesting problem. The translations use regular expressions to find the function name preceded by a non-word character. This works for Latin alphabets, but not so well for Cyrillic. I think that, instead of |
@oleibman Thanks for the reply. I hope this bug will be fixed in near future. Thanks for your work. |
I'm afraid the formula language translation code is a bit basic, dating back to when a only very few languages were available; and the code may not handle languages that have been added more recently. The regexp should probably be greedy and check for a word boundary, and should (as @oleibman says) use the It might also be useful if you could check the contents of the |
It would probably also be neater and less risky if it was modified to use a |
On the good news side... the fact that you've identified this issue justifies the effort in providing a mechanism to handle formula translations, and in maintaining the translations language locale data |
I will provide you updated |
Thanks, much appreciated; every new release of Excel seems to add new functions, or new aliases for existing functions |
|
@MarkBaker @oleibman Any news? |
The code change is now in the |
Thank you guys! |
Issue seems resolved; closing ticket. |
This is:
Incorrect output of _translateFormulaToEnglish() if function name in Russian ends with "И" and translation of this function is below line 214 in src/PhpSpreadsheet/Calculation/locale/ru/functions.
What is the expected behavior?
=ЕСЛИ(1;1;1) -> =IF(1;1;1)
=ИСКЛИЛИ(1;1) -> =XOR(1;1)
What is the current behavior?
=ЕСЛИ(1;1;1) -> =ЕСЛAND(1;1;1)
=ИСКЛИЛИ(1;1) -> =ИСКЛИЛAND(1;1)
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
The text was updated successfully, but these errors were encountered: