Created attachment 83728 [details] A sheet with a button to reproduce the bug Problem description: Formula function will not be translated in FormulaLocal Steps to reproduce: If I create a formula in a macro like o_tab_arb.getcellbyposition(5,i).formula="=if(e"+format(str(i+1),0)+">0;""N"";"""")" or ....formula="=now()" the translation to FormulaLocal does not work, so I get an error. The cell contains =if(E5>0;... instead of=wenn(E5>0;... or now() instead of jetzt() Current behavior: Produces an Error #NAME? Expected behavior: No error an translation in FormulaLocal Operating System: openSUSE Version: 4.1.0.4 release Last worked in: 4.0.4.2 release
Last worked in: Version 4.0.5.2 (Build ID: 5464147a081647a250913f19c0715bca595af2f)
I am also looking at this to see if this is a bug (or not). I asked a person in Lithuania to run a simple example in LO 4.0 and 4.1. I am in the US so this is not an easy test for myself. In 4.0 the properties Formula and FormulaLocal give the expected result: cell.Formula = "=2.1*2" => 4,2 cell.Formula = "=2,1*2" => #NAME? cell.FormulaLocal = "=2,1*2" => 4,2 cell.FormulaLocal = "=2.1*2" => #NAME? In 4.1 the both properties Formula and FormulaLocal give the same result: cell.Formula = "=2,1*2" => 4,2 cell.Formula = "=2.1*2" => #NAME? cell.FormulaLocal = "=2,1*2" => 4,2 cell.FormulaLocal = "=2.1*2" => #NAME? Clearly something changed when they went to 4.1.
Note: to clarify the initial description, in a German UI and 'de-DE' locale with the testcase document it is the .Formula="=if(..." that does not work, a .FormulaLocal="=wenn(..." works. For "=2,1*2" or "=2.1*2" it depends on the current work locale (not UI language) what the actual result is, .Formula="=2.1*2" should always use 'en-US' locale and separators but apparently does not.
Yes, that about sums it up. Formula should always use en-US but does not. Spent some time poking around the code trying to find where this is done and I think that I found were FormulaLocal is set, but not Formula.
Taking.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a6fdfb960ad0f5b019adff700d0046f20a740996 resolved fdo#67836 do not overwrite already interpreted English cell The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Pending review for 4-1 as https://gerrit.libreoffice.org/5712
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-4-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2ea6f5e741bb21649fb438bf7b8b4ac523d0085e&h=libreoffice-4-1 resolved fdo#67836 do not overwrite already interpreted English cell It will be available in LibreOffice 4.1.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.