Remove obsolete LOCALE_PREFIX and update documentation.

master
Torsten Paul 2014-11-13 00:39:17 +01:00
parent ca3672b19c
commit 99c617562c
5 changed files with 16 additions and 257 deletions

4
.gitignore vendored
View File

@ -13,8 +13,8 @@ parser_yacc.h
/tmp
/OpenSCAD.app
*/#*#
/po/*/*/*.mo
/po/POTFILES
/locale/*/*/*.mo
/locale/POTFILES
/nbproject
/openscad
/tests/openscad_nogui

View File

@ -15,13 +15,13 @@ There is a script included, translation-update.sh, that automates this process.
File layout:
============
./po/*.po - .po files, one per language
./po/openscad.pot - .pot template, generated by xgettext
./po/POTFILES.in - list of source code files with translatable strings
./po/LINGUAS - list of language codes for which .po files exist
./locale/*.po - .po files, one per language
./locale/openscad.pot - .pot template, generated by xgettext
./locale/POTFILES - list of source files with translatable strings (generated)
./locale/LINGUAS - list of language codes for which .po files exist
./src/qtgettext.h - wrapper code between QT and GNU gettext
./scripts/translation-update.sh - simple unix helper script
./po/xx/LC_MESSAGES/openscad.mo - 'binaries' of .po files, built by script
./locale/xx/LC_MESSAGES/openscad.mo - 'binaries' of .po files, built by script
To translate the strings:
=========================
@ -49,27 +49,26 @@ files.
$ make clean && qmake && make
Now make sure your .cc and ui_xxxx.h files are listed in po/POTFILES.in.
Then run the script to scan them, and regenerate .pot & .po files.
Then run the script to scan the source files, and regenerate .pot & .po files.
$ ./scripts/translate.sh updateall
$ ./scripts/translation-make.sh
This will create new .po files with any new untranslated strings you
added to the source code. These .po files can be distributed to
translators for translation. After the translated .po file is obtained,
overwrite the old .po and run the same script to update the .mo files.
$ ./scripts/translate.sh updateall
$ ./scripts/translation-make.sh
To add a new language:
======================
First add the language code to file ./po/LINGUAS. Then run msginit, replacing
$LANGCODE with the language code you want.
First add the language code to file ./locale/LINGUAS. Then run msginit,
replacing $LANGCODE with the language code you want.
$ msginit -l $LANGCODE -o ./po/$LANGCODE.po -i ./po/openscad.pot
$ msginit -l $LANGCODE -o ./locale/$LANGCODE.po -i ./locale/openscad.pot
You will now have a new ./po/xx.po file to edit and translate
You will now have a new ./locale/xx.po file to edit and translate
Testing:
========

View File

@ -1,228 +0,0 @@
./objects/ui_AboutDialog.h
./objects/ui_FontListDialog.h
./objects/ui_launchingscreen.h
./objects/ui_LibraryInfoDialog.h
./objects/ui_MainWindow.h
./objects/ui_OpenCSGWarningDialog.h
./objects/ui_Preferences.h
./objects/ui_ProgressWidget.h
src/AboutDialog.h
src/AppleEvents.h
src/AutoUpdater.h
src/boost-utils.h
src/boosty.h
src/builtin.h
src/cache.h
src/calc.h
src/Camera.h
src/cgaladvnode.h
src/CGALCache.h
src/cgalfwd.h
src/cgal.h
src/CGAL_Nef3_workaround.h
src/CGAL_Nef_polyhedron.h
src/CGAL_OGL_Polyhedron.h
src/CGALRenderer.h
src/cgalutils.h
src/CGAL_workaround_Mark_bounded_volumes.h
src/cgalworker.h
src/clipper-utils.h
src/CocoaUtils.h
src/colormap.h
src/colornode.h
src/context.h
src/CsgInfo.h
src/csgnode.h
src/CSGTermEvaluator.h
src/csgterm.h
src/csgtermnormalizer.h
src/Dock.h
src/DrawingCallback.h
src/dxfdata.h
src/dxfdim.h
src/editor.h
src/enums.h
src/evalcontext.h
src/EventFilter.h
src/export.h
src/expression.h
src/fbo.h
src/feature.h
src/fileutils.h
src/FontCache.h
src/FontListDialog.h
src/FreetypeRenderer.h
src/function.h
src/GeometryCache.h
src/GeometryEvaluator.h
src/Geometry.h
src/GLView.h
src/grid.h
src/handle_dep.h
src/highlighter.h
src/imageutils.h
src/importnode.h
src/launchingscreen.h
src/legacyeditor.h
src/LibraryInfoDialog.h
src/LibraryInfo.h
src/linalg.h
src/linearextrudenode.h
src/localscope.h
src/lodepng.h
src/MainWindow.h
src/mathc99.h
src/memory.h
src/modcontext.h
src/ModuleCache.h
src/module.h
src/nodecache.h
src/nodedumper.h
src/node.h
src/OffscreenContext.h
src/OffscreenView.h
src/offsetnode.h
src/OGL_helper.h
src/OpenCSGRenderer.h
src/OpenCSGWarningDialog.h
src/openscad.h
src/parsersettings.h
src/parser_yacc.h
src/PlatformUtils.h
src/Polygon2d-CGAL.h
src/Polygon2d.h
src/polyset.h
src/polyset-utils.h
src/Preferences.h
src/printutils.h
src/progress.h
src/ProgressWidget.h
src/projectionnode.h
src/QGLView.h
src/qtgettext.h
src/Reindexer.h
src/renderer.h
src/rendernode.h
src/rendersettings.h
src/rotateextrudenode.h
src/scadlexer.h
src/scintillaeditor.h
src/SparkleAutoUpdater.h
src/state.h
src/stl-utils.h
src/svg.h
src/system-gl.h
src/textnode.h
src/ThrownTogetherRenderer.h
src/transformnode.h
src/traverser.h
src/Tree.h
src/typedefs.h
src/UIUtils.h
src/value.h
src/version_check.h
src/visitor.h
src/AppleEvents.cc
src/AutoUpdater.cc
src/boost-utils.cc
src/builtin.cc
src/calc.cc
src/Camera.cc
src/cgaladv.cc
src/CGALCache.cc
src/CGAL_Nef_polyhedron.cc
src/CGAL_Nef_polyhedron_DxfData.cc
src/CGALRenderer.cc
src/cgalutils.cc
src/cgalutils-tess.cc
src/cgalworker.cc
src/clipper-utils.cc
src/color.cc
src/colormap.cc
src/context.cc
src/control.cc
src/csgops.cc
src/csgterm.cc
src/CSGTermEvaluator.cc
src/csgtermnormalizer.cc
src/Dock.cc
src/DrawingCallback.cc
src/dxfdata.cc
src/dxfdim.cc
src/editor.cc
src/evalcontext.cc
src/export.cc
src/export_png.cc
src/expr.cc
src/fbo.cc
src/feature.cc
src/fileutils.cc
src/FontCache.cc
src/FontListDialog.cc
src/FreetypeRenderer.cc
src/func.cc
src/GeometryCache.cc
src/Geometry.cc
src/GeometryEvaluator.cc
src/GLView.cc
src/handle_dep.cc
src/highlighter.cc
src/imageutils.cc
src/imageutils-lodepng.cc
src/imageutils-macosx.cc
src/import.cc
src/launchingscreen.cc
src/legacyeditor.cc
src/LibraryInfo.cc
src/LibraryInfoDialog.cc
src/linalg.cc
src/linearextrude.cc
src/localscope.cc
src/mainwin.cc
src/mathc99.cc
src/modcontext.cc
src/ModuleCache.cc
src/module.cc
src/node.cc
src/nodedumper.cc
src/NULLGL.cc
src/OffscreenContextGLX.cc
src/OffscreenContextNULL.cc
src/OffscreenContextWGL.cc
src/OffscreenView.cc
src/offset.cc
src/OpenCSGRenderer.cc
src/OpenCSGWarningDialog.cc
src/openscad.cc
src/parsersettings.cc
src/PlatformUtils.cc
src/PlatformUtils-posix.cc
src/PlatformUtils-win.cc
src/Polygon2d.cc
src/Polygon2d-CGAL.cc
src/polyset.cc
src/polyset-utils.cc
src/polyset-utils-old.cc
src/Preferences.cc
src/primitives.cc
src/printutils.cc
src/progress.cc
src/ProgressWidget.cc
src/projection.cc
src/QGLView.cc
src/render.cc
src/renderer.cc
src/rendersettings.cc
src/rotateextrude.cc
src/stl-utils.cc
src/surface.cc
src/svg.cc
src/system-gl.cc
src/text.cc
src/ThrownTogetherRenderer.cc
src/transform.cc
src/traverser.cc
src/Tree.cc
src/UIUtils.cc
src/value.cc
src/version_check.cc

View File

@ -12,14 +12,6 @@
#
# PREFIX defines the base installation folder
#
# LOCALE_PREFIX can overwrite the location of the gettext message catalogs
#
# For linux packages that want to install the localization files into
# a folder shared by all packages, specify the LOCALE_PREFIX which will
# force usage of the given folder.
# The default layout is created by: LOCALE_PREFIX=<prefix>/share/locale
# where <prefix> is the base installation folder.
#
# Please see the 'Building' sections of the OpenSCAD user manual
# for updated tips & workarounds.
#
@ -490,14 +482,13 @@ isEmpty(PREFIX):PREFIX = /usr/local
target.path = $$PREFIX/bin/
INSTALLS += target
!isEmpty(LOCALE_PREFIX): DEFINES += LOCALE_PREFIX=\'\"$$LOCALE_PREFIX\"\'
isEmpty(LOCALE_PREFIX): LOCALE_PREFIX = $$PREFIX/share/openscad/locale
# Run translation update scripts as last step after linking the target
QMAKE_POST_LINK += $$PWD/scripts/translation-make.sh
# Create install targets for the languages defined in LINGUAS
LINGUAS = $$cat(locale/LINGUAS)
LOCALE_PREFIX = $$PREFIX/share/openscad/locale
for(language, LINGUAS) {
catalog = locale/$$language/LC_MESSAGES/openscad.mo
exists($$catalog) {

View File

@ -161,12 +161,9 @@ static void info()
* files.
*/
void localization_init() {
#ifdef LOCALE_PREFIX
std::string locale_path(LOCALE_PREFIX);
#else
fs::path po_dir(PlatformUtils::resourcePath("locale"));
std::string locale_path(po_dir.string());
#endif
if (fs::is_directory(locale_path)) {
setlocale(LC_ALL, "");
bindtextdomain("openscad", locale_path.c_str());