Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-10-19 20:43:10 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-10-19 20:43:10 +0400
commitf72f1dca6c70bd4597f0106adbd50608cdd8c01b (patch)
tree88d45cbf4d7b2afdf881f4db4d3aa2339308d6fa /source/blender/blenloader
parent97c68098cca15480f07afb28261021bb3548c89b (diff)
More UI messages fixes and tweaks, BKE_report<->BKE_reportf, and stuff to translate...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/CMakeLists.txt5
-rw-r--r--source/blender/blenloader/SConscript5
-rw-r--r--source/blender/blenloader/intern/readfile.c28
-rw-r--r--source/blender/blenloader/intern/runtime.c8
-rw-r--r--source/blender/blenloader/intern/writefile.c6
5 files changed, 31 insertions, 21 deletions
diff --git a/source/blender/blenloader/CMakeLists.txt b/source/blender/blenloader/CMakeLists.txt
index 74df5211dad..3c5812fa513 100644
--- a/source/blender/blenloader/CMakeLists.txt
+++ b/source/blender/blenloader/CMakeLists.txt
@@ -25,6 +25,7 @@
set(INC
.
+ ../blenfont
../blenkernel
../blenlib
../makesdna
@@ -62,4 +63,8 @@ if(WITH_BUILDINFO)
add_definitions(-DWITH_BUILDINFO)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_blenloader "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript
index 20b560744b3..49e8869637e 100644
--- a/source/blender/blenloader/SConscript
+++ b/source/blender/blenloader/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('intern/*.c')
-incs = '. #/intern/guardedalloc ../blenlib ../blenkernel'
+incs = '. #/intern/guardedalloc ../blenfont ../blenlib ../blenkernel'
incs += ' ../makesdna ../editors/include'
incs += ' ../render/extern/include ../makesrna ../nodes ../bmesh ../imbuf'
@@ -11,6 +11,9 @@ incs += ' ' + env['BF_ZLIB_INC']
defs = []
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [167,30]) #, cc_compileflags=['/WX'] )
else:
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 3d7c9c21eca..41a635a5e01 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -105,6 +105,8 @@
#include "BLI_math.h"
#include "BLI_edgehash.h"
+#include "BLF_translation.h"
+
#include "BKE_anim.h"
#include "BKE_action.h"
#include "BKE_armature.h"
@@ -976,13 +978,13 @@ static FileData *blo_decode_and_check(FileData *fd, ReportList *reports)
if (fd->flags & FD_FLAGS_FILE_OK) {
if (!read_file_dna(fd)) {
- BKE_reportf(reports, RPT_ERROR, "Failed to read blend file: \"%s\", incomplete", fd->relabase);
+ BKE_reportf(reports, RPT_ERROR, "Failed to read blend file '%s', incomplete", fd->relabase);
blo_freefiledata(fd);
fd = NULL;
}
}
else {
- BKE_reportf(reports, RPT_ERROR, "Failed to read blend file: \"%s\", not a blend file", fd->relabase);
+ BKE_reportf(reports, RPT_ERROR, "Failed to read blend file '%s', not a blend file", fd->relabase);
blo_freefiledata(fd);
fd = NULL;
}
@@ -999,7 +1001,8 @@ FileData *blo_openblenderfile(const char *filepath, ReportList *reports)
gzfile = BLI_gzopen(filepath, "rb");
if (gzfile == (gzFile)Z_NULL) {
- BKE_reportf(reports, RPT_WARNING, "Unable to open \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error reading file");
+ BKE_reportf(reports, RPT_WARNING, "Unable to open '%s': %s",
+ filepath, errno ? strerror(errno) : TIP_("Unknown error reading file"));
return NULL;
}
else {
@@ -1017,7 +1020,7 @@ FileData *blo_openblenderfile(const char *filepath, ReportList *reports)
FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports)
{
if (!mem || memsize<SIZEOFBLENDERHEADER) {
- BKE_report(reports, RPT_WARNING, (mem)? "Unable to read": "Unable to open");
+ BKE_report(reports, RPT_WARNING, (mem) ? TIP_("Unable to read"): TIP_("Unable to open"));
return NULL;
}
else {
@@ -4764,8 +4767,7 @@ static void lib_link_scene(FileData *fd, Main *main)
base->object = newlibadr_us(fd, sce->id.lib, base->object);
if (base->object == NULL) {
- BKE_reportf_wrap(fd->reports, RPT_WARNING,
- "LIB ERROR: Object lost from scene:'%s\'",
+ BKE_reportf_wrap(fd->reports, RPT_WARNING, "LIB ERROR: object lost from scene: '%s'",
sce->id.name + 2);
BLI_remlink(&sce->base, base);
if (base == sce->basact) sce->basact = NULL;
@@ -6613,7 +6615,7 @@ void convert_tface_mt(FileData *fd, Main *main)
G.main = main;
if (!(do_version_tface(main, 1))) {
- BKE_report(fd->reports, RPT_WARNING, "Texface conversion problem (error in console)");
+ BKE_report(fd->reports, RPT_WARNING, "Texface conversion problem (see error in console)");
}
//XXX hack, material.c uses G.main allover the place, instead of main
@@ -7396,8 +7398,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
prop = BKE_bproperty_object_get(ob, "Text");
if (prop) {
BKE_reportf_wrap(fd->reports, RPT_WARNING,
- "Game property name conflict in object: \"%s\".\nText objects reserve the "
- "[\"Text\"] game property to change their content through Logic Bricks.",
+ "Game property name conflict in object '%s':\ntext objects reserve the "
+ "['Text'] game property to change their content through logic bricks",
ob->id.name + 2);
}
}
@@ -9681,7 +9683,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if (fd == NULL) {
/* printf and reports for now... its important users know this */
BKE_reportf_wrap(basefd->reports, RPT_INFO,
- "read library: '%s', '%s'",
+ "Read library: '%s', '%s'",
mainptr->curlib->filepath, mainptr->curlib->name);
fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
@@ -9735,7 +9737,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if (fd == NULL) {
BKE_reportf_wrap(basefd->reports, RPT_WARNING,
- "Can't find lib '%s'",
+ "Cannot find lib '%s'",
mainptr->curlib->filepath);
}
}
@@ -9754,7 +9756,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
append_id_part(fd, mainptr, id, &realid);
if (!realid) {
BKE_reportf_wrap(fd->reports, RPT_WARNING,
- "LIB ERROR: %s:'%s' missing from '%s'",
+ "LIB ERROR: %s: '%s' missing from '%s'",
BKE_idcode_to_name(GS(id->name)),
id->name+2, mainptr->curlib->filepath);
}
@@ -9786,7 +9788,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if (id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
BKE_reportf_wrap(basefd->reports, RPT_WARNING,
- "LIB ERROR: %s:'%s' unread libblock missing from '%s'",
+ "LIB ERROR: %s: '%s' unread libblock missing from '%s'",
BKE_idcode_to_name(GS(id->name)), id->name + 2, mainptr->curlib->filepath);
change_idid_adr(mainlist, basefd, id, NULL);
diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c
index eaf725dda9e..4136f71f050 100644
--- a/source/blender/blenloader/intern/runtime.c
+++ b/source/blender/blenloader/intern/runtime.c
@@ -104,7 +104,7 @@ BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
fd = BLI_open(path, O_BINARY | O_RDONLY, 0);
if (fd == -1) {
- BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", path, strerror(errno));
+ BKE_reportf(reports, RPT_ERROR, "Unable to open '%s': %s", path, strerror(errno));
goto cleanup;
}
@@ -115,15 +115,15 @@ BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
datastart = handle_read_msb_int(fd);
if (datastart == -1) {
- BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (problem seeking)", path);
+ BKE_reportf(reports, RPT_ERROR, "Unable to read '%s' (problem seeking)", path);
goto cleanup;
}
else if (read(fd, buf, 8) != 8) {
- BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (truncated header)", path);
+ BKE_reportf(reports, RPT_ERROR, "Unable to read '%s' (truncated header)", path);
goto cleanup;
}
else if (memcmp(buf, "BRUNTIME", 8) != 0) {
- BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (not a blend file)", path);
+ BKE_reportf(reports, RPT_ERROR, "Unable to read '%s' (not a blend file)", path);
goto cleanup;
}
else {
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ab7f5d46f8b..274762679fe 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3026,7 +3026,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
file = BLI_open(tempname, O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
if (file == -1) {
- BKE_reportf(reports, RPT_ERROR, "Can't open file %s for writing: %s", tempname, strerror(errno));
+ BKE_reportf(reports, RPT_ERROR, "Cannot open file %s for writing: %s", tempname, strerror(errno));
return 0;
}
@@ -3094,7 +3094,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
if (0==ret) {
/* now rename to real file name, and delete temp @ file too */
if (BLI_rename(gzname, filepath) != 0) {
- BKE_report(reports, RPT_ERROR, "Can't change old file (file saved with @)");
+ BKE_report(reports, RPT_ERROR, "Cannot change old file (file saved with @)");
return 0;
}
@@ -3110,7 +3110,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
}
}
else if (BLI_rename(tempname, filepath) != 0) {
- BKE_report(reports, RPT_ERROR, "Can't change old file (file saved with @)");
+ BKE_report(reports, RPT_ERROR, "Cannot change old file (file saved with @)");
return 0;
}