Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 9
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 627 times and has 8 replies Next Thread
YGYL
Advanced Member
Member's Avatar


Joined: Feb 5, 2013
Post Count: 102
Status: Offline
Reply to this Post  Reply with Quote 
shock Sweet Home 3D 6.5A bug was found in Sweet Home 3D

In SweetHome3D.jar inside com\eteks\sweethome3d\model\LengthUnit_zh_CN.properties
Inside should be changed to
centimerUnit=\u5398\u7c73
The original has a few extra letters in front of it

This can lead to errors in area calculation units
Please fix as soon as possible

The full content of the correct LengthUnit_zh_CN.properties
----------------------------------------------
# LengthUnit_zh_CN.properties 16 Mar. 2009
#
# Translated to Chinese (Simplified) by Zhao Si-cong
#
# Sweet Home 3D, Copyright (c) 2008 Emmanuel PUYBARET / eTeks <info@eteks.com>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA

# Units (\u00b2 is the symbol for supercript 2)
centimerUnit=\u5398\u7c73
inchUnit=\u82f1\u5bf8
millimeterUnit=\u6beb\u7c73
meterUnit=\u7c73
squareMeterUnit=m\u00b2
squareFootUnit=\u5e73\u65b9\u82f1\u5c3a
[Dec 4, 2021, 6:05:00 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 8002
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

I checked, even double checked with a binary editor and don’t see any hidden character in the centimeterUnit line of LengthUnit_zh_CN.properties.
How do you see the bug that you encountered?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
----------------------------------------
[Edit 1 times, last edit by Puybaret at Dec 5, 2021, 8:08:47 PM]
[Dec 4, 2021, 6:39:15 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
YGYL
Advanced Member
Member's Avatar


Joined: Feb 5, 2013
Post Count: 102
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

centimerUnit
centimeterUnit
These 2 words are not the same
[Dec 5, 2021, 5:45:13 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
YGYL
Advanced Member
Member's Avatar


Joined: Feb 5, 2013
Post Count: 102
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

It seems that the same mistake occurs in Russian
[Dec 5, 2021, 5:47:19 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
dorin
Advanced Member
Member's Avatar

Romania
Joined: Apr 24, 2014
Post Count: 314
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

@YGYL You've right. That is what I've discover earlier.
BUT
@Emmanuel Is something strange:
centimeterUnit must be the correct.
In this case CN & RU don't work as aspect but TW which have centimerUnit = work.
If change CN & RU to incorrect form = work.
I suspect it is also a misspelling in other place of translations.
How to verify and reproduce:
1. Open a home with rooms;
2. Set preferences to English & centimeter;
3. Menu->Tools->RoomsInfo ==> in table are m₂ => OK
4. Set preferences to Chinese or Russian and repeat step 3 ==> ft₂ => Not OK.
If change centimerUnit with centimerUnit in CN & RU files will work but it has no logic (at least for me).
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law
[Dec 5, 2021, 6:38:04 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 8002
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

I fixed this error in LengthUnit_zh_TW.properties, but it was the only wrong file.
In all cases, surface texts shouldn't be based on centimerUnit property but on squareMeterUnit or squareFootUnit properties according to the current unit set in preferences, and to avoid wondering how to format surface texts, programs should use getAreaFormatWithUnit in LengthUnit class, like in the PlanComponent class.
Dorin, did you use the same way?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 5, 2021, 8:29:21 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
dorin
Advanced Member
Member's Avatar

Romania
Joined: Apr 24, 2014
Post Count: 314
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

@Emmanuel
I don't remember what I've use (it was long time ago) but probably I don't use this way.
At the moment I steel fight with roofs.
After I finish somehow this, I'll reanalyze RoomsInfo plugin and I'll tray to improve it.
Thanks for the clue!! I really need it.
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law
[Dec 6, 2021, 10:37:49 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 8002
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

I just checked the source code of the TotalResult class you programmed, and you formatted surface texts another way in UpdateCalc method.
As you compute the text of the surface unit unitSurf from the name of the current length unit, this can lead to errors for languages where this name is localized (like Chinese or Russian).

A quick fix could consist of testing the current unit and not its name. Therefore, the line:
if (unitName.equalsIgnoreCase("mm") || unitName.equalsIgnoreCase("cm") || unitName.equalsIgnoreCase("m")) {
should rather be:
if (preferences.getLengthUnit() == LengthUnit.MILLIMETER || preferences.getLengthUnit() == LengthUnit.CENTIMETER || preferences.getLengthUnit() == LengthUnit.METER) {

Good luck for the roofs!
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Dec 6, 2021, 11:33:38 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
dorin
Advanced Member
Member's Avatar

Romania
Joined: Apr 24, 2014
Post Count: 314
Status: Offline
Reply to this Post  Reply with Quote 
Re: Sweet Home 3D 6.5A bug was found in Sweet Home 3D

Many thanks Emmanuel!!
Today I'll take a break from roof and I'll try to fix RoomsInfo.
If succeed I'll publish a fixed version.
Thanks again, without You, I have to spend mounts to find the bug (if I find)
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law
[Dec 6, 2021, 2:04:05 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2022 eTeks - All rights reserved