![]() |
Features |
Download |
Online |
Gallery |
Blog |
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Translation guideIntroduction
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
The |
Before translating the .properties files, you should
rename each of them by adding to their name an underscore followed by
the 2 characters ISO code matching your language. You'll find this code
in the last column of the document http://www.loc.gov/standards/iso639-2/php/English_list.php.
Then, if you want to translate the help files, you should rename also
the en subdirectory of help with that 2 letters
code too.
For example, the ISO code for Czech is cs. If you want
to translate Sweet Home 3D into Czech, each file name should be suffixed
by _cs, and you should rename the files as shown in figure 2.

Figure 2. Properties files with their ISO code suffix
The .properties files are plain text files and you may
edit them with any text editor (for example Wordpad, TextEdit
or emacs). For example, the com/eteks/sweethome3d/package.properties
file in Sweet Home 3D 3.0 contains the following text:
# package.properties 10 oct. 2007
#
# Copyright (c) 2007 Emmanuel PUYBARET / eTeks <info@eteks.com>. All Rights Reserved.
#
# 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
# Resources for HomeFramePane class
HomeFramePane.untitled=Untitled
# Resources for MacOSXConfiguration class
MacOSXConfiguration.WINDOW_MENU.Name=Window
MacOSXConfiguration.MINIMIZE.Name=Minimize
MacOSXConfiguration.ZOOM.Name=Zoom
MacOSXConfiguration.BRING_ALL_TO_FRONT.Name=Bring all to front
# Resources for SweetHome3D class
SweetHome3D.3DError.message=<html>Sweet Home 3D will exit now because of a fatal error\
<br>in 3D rendering system. Please update the DirectX/OpenGL drivers\
<br>of your computer graphics card.
SweetHome3D.3DError.title=3D Error
SweetHome3D.confirmSaveAfter3DError.message=<html>Sweet Home 3D must exit now because of a fatal error in\
<br>3D rendering system. Do you want to save all modified homes?
SweetHome3D.confirmSaveAfter3DError.title=3D Error
SweetHome3D.confirmSaveAfter3DError.save=Save
SweetHome3D.confirmSaveAfter3DError.doNotSave=Do not save
A .properties file contains three kinds of lines:
.properties
file. =) and a text in a given language. Your job starts
from the equal signs. Don't change the text of the key and replace
the English text after the equal sign by its translation.Special cases:
<html>
tag contains some text at HTML format. These texts contain some other
HTML tags between <
and > signs, like
<br> in the previous
example which represents a carriage return in the middle of long texts.
Don't remove these HTML tags, they help Sweet Home 3D to present correctly
some texts. Translating text between HTML tags isn't very difficult,
except maybe for the worst HTML text which is the value of WallPanel.wallOrientationLabel.text
key.\, like the line starting
by SweetHome3D.3DError.message
in the previous example. In that case, don't remove the \
sign located at the end of a line because it indicates the next line
follows the current line. % sign, like %s, %d,
%1$s, %2$s... These characters sequence
will be replaced by a file name, a unit or a number when needed, so
don't remove them. %s
in the text of the following key HomeFurniturePanel.widthLabel.text:HomeFurniturePanel.widthLabel.text=Width (%s):will be replaced by the unit currently in use. The two character sequences
%1$d and %2$d
that appear in the text of the following key PrintPreviewPanel.pageLabel.text:PrintPreviewPanel.pageLabel.text=Page %1$d/%2$dwill appear at screen as a page number and the page count, and you should translate only the word
Page.\n, like in the following
example:
HomeController.saveError=Can't save home in\n"%s"This character sequence is displayed by Sweet Home 3D as a carriage return to split a line at screen, and you shouldn't remove them.
HelpController.helpIndex
indicates the directory where the help files can be found. If you
translate the .html help files, you should replace the
en subdirectory found by the 2 letters code of your language.
HelpController.helpIndex=/com/eteks/sweethome3d/viewcontroller/resources/help/cs/index.html
.mnemonic
are used by Sweet Home 3D to guess which letter in a label or a menu
item should be underlined for keyboard access. This mnemonic letter
depends on the displayed word and you should find a unique one per
dialog box or menu. HomeFurniturePanel.nameLabel.text=Name: HomeFurniturePanel.nameLabel.mnemonic=N HomeFurniturePanel.nameVisibleCheckBox.text=Display name in plan HomeFurniturePanel.nameVisibleCheckBox.mnemonic=S HomeFurniturePanel.widthLabel.text=Width (%s): HomeFurniturePanel.widthLabel.mnemonic=Wcan be translated in French by:
HomeFurniturePanel.nameLabel.text=Nom : HomeFurniturePanel.nameLabel.mnemonic=N HomeFurniturePanel.nameVisibleCheckBox.text=Afficher le nom dans le plan HomeFurniturePanel.nameVisibleCheckBox.mnemonic=S HomeFurniturePanel.widthLabel.text=Largeur (%s) : HomeFurniturePanel.widthLabel.mnemonic=L
.properties
files ending by Catalog.properties. If you translated texts into a language
with letters not belonging to ISO-8859-1
encoding (mainly Central and Eastern Europe languages and languages
with a non-latin alphabet), you'll have to convert all your .properties
files to an ASCII encoding supported by Sweet Home 3D. This conversion
can be done with the native2ascii tool provided with the
JDK or can be performed
with the following form.
For each .properties file, create a backup of that file,
copy/paste the text to convert in the following text area, click on
the Convert button and copy/paste the converted text back in
its .properties file.
The conversion tool will replace each non ASCII character (accented
latin letters and non-latin letters) by a sequence starting by \u
and followed by a 4 hexadecimal digits code matching that character
in Unicode. Miserably, this conversion will make your text quite unreadable
for a human, but if you don't perform it, Sweet Home 3D won't be able
to display the characters of your translation correctly. This is the
reason why you should create a backup of your original .properties
files, in case you want to change them later.
A good translation of Sweet Home 3D should also include the translation
of its help files. Translating all the .html files is a
long task, but it will really help the users to learn the software and
avoid some support requests in Sweet Home 3D forum. Use any HTML editor
to translate these files, trying to keep the links it contains and its
style sheet unchanged.
Once translated, you should also create screen captures of the dialog
boxes in your language to replace the images found in com/eteks/sweethome3d/viewcontroller/resources/help/en/images
(you'll probably have to update img width
and height attributes). To be able to create such screen
captures, create and test a first SH3L file with the following steps.
Once all the .properties and .html files
are translated and converted to ASCII if necessary (or even before if
you want to test this procedure), you should zip them in a file. Depending
on your system, creating a zip file can be done with the following procedure:
com folder containing all
the translated files and choose Send to > Compressed folder
from its contextual menu,com folder containing all
the translated files and choose File > Compress « com »
menu item,com folder containing all
the translated files, choose Create archive... from its contextual
menu then select .zip in the format list.Finally, change the .zip extension of the zip file and
to .sh3l. A SH3L file can have any name, but to avoid conflicts
with existing SH3L files, you should name it from the language it contains
and the version of Sweet Home 3D you translated (for example, French-3.0.sh3l
could be a good name for the French translation of Sweet Home 3D 3.0).
To test the translation, double-click on a SH3L file or choose it with the Import language library file button
displayed at the top of the Preferences pane. This will launch
Sweet Home 3D and translate its user interface to the language described
in the SH3L file. This will also copy the SH3L file in a folder depending
on your system:
Note also that during the development of your SH3L file, you'll probably have to relaunch Sweet Home 3D to see the changes in your SH3L file.
Once your SH3L file is ready, you can propose it to anyone, announce it to Sweet Home 3D users in the forum part reserved to foreign languages or in other places. If you agree, it can be made available on this web site in the page about translations supported by Sweet Home 3D.
Some releases of Sweet Home 3D bring new features to translate, some
don't. If you don't translate the user interface labels matching these
new features, Sweet Home 3D will work but all the new labels will appear
in English. To find the new keys and the updated keys in .properties
files, you can use a feature offered by SourceForge.net that lets you
compare two versions of a project file:
.properties or .html file
you want to update in figure 1,The last click will show you the differences between the two versions
of that .properties file (for example, this link
will show you the differences between the version 3.4 and the version
3.0 of the file com/eteks/sweethome3d/viewcontroller/package.properties).
Once you found the differences, udpate your translation, adding new key names if necessary, and release a new version of your translation.
Last update : December 26, 2011
| © Copyrights 2006-2012 eTeks - All rights reserved | ||||||