Permalink
Browse files

compiler/i18n: Modified .bowl/.pot generation to always use '/' for p…

…aths, so as not to have differences between .pot created on Windows or Unix systems; Only genearting .pot file when building from a release.* directory; Fixed broken .pot header (msgstr) that was preventing base path from working in PoEdit; Updated all .pot files
  • Loading branch information...
1 parent f913393 commit db3c6ca2b9c5ca1f60f869d7f960378cbf261f70 @jerstlouis jerstlouis committed Jul 11, 2012
@@ -2168,6 +2168,10 @@ extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__
extern void SetPrivateModule(struct __ecereNameSpace__ecere__com__Instance * module);
+extern char * GetSymbolsDir(void);
+
+extern char * __ecereNameSpace__ecere__sys__SearchString(char * buffer, int start, char * subStr, unsigned int matchCase, unsigned int matchWord);
+
extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__IteratorPointer;
struct __ecereNameSpace__ecere__com__IteratorPointer;
@@ -2381,6 +2385,8 @@ mainModule = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImpo
SetMainModule(mainModule);
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&_imports, mainModule);
{
+char * symbolsDir = GetSymbolsDir();
+unsigned int outputPot = symbolsDir && __ecereNameSpace__ecere__sys__SearchString(symbolsDir, 0, "release.", 0x0, 0x0);
struct __ecereNameSpace__ecere__com__Instance * intlStrings = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__com__Map_TPL_ContextStringPair__ecere__com__List_TPL_String___);
struct __ecereNameSpace__ecere__com__MapIterator it = (it.container = (void *)0, it.pointer = (void *)0, __ecereProp___ecereNameSpace__ecere__com__MapIterator_Set_map(&it, intlStrings), it);
@@ -2556,7 +2562,7 @@ if(!isDynamicLibrary)
thisAppClass = SearchAppClass_Module(privateModule);
}
WriteMain(output);
-if(((struct __ecereNameSpace__ecere__com__CustomAVLTree *)(((char *)intlStrings + 12)))->count)
+if(outputPot && ((struct __ecereNameSpace__ecere__com__CustomAVLTree *)(((char *)intlStrings + 12)))->count)
{
struct __ecereNameSpace__ecere__com__Instance * potFile;
char potFileName[797];
@@ -2569,7 +2575,7 @@ potFile = __ecereNameSpace__ecere__sys__FileOpen(potFileName, 2);
if(potFile)
{
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgid \"\"\n");
-((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgstr \n");
+((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgstr \"\"\n");
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Project-Id-Version: \\n\"\n");
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"POT-Creation-Date: \\n\"\n");
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"PO-Revision-Date: \\n\"\n");
@@ -2578,7 +2584,7 @@ if(potFile)
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"MIME-Version: 1.0\\n\"\n");
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Content-Type: text/plain; charset=iso-8859-1\\n\"\n");
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Content-Transfer-Encoding: 8bit\\n\"\n");
-((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"X-Poedit-Basepath: ..\\\\\\n\"\n");
+((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"X-Poedit-Basepath: ../\\n\"\n");
((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char * string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\n");
{
struct __ecereNameSpace__ecere__com__MapIterator i = (i.container = (void *)0, i.pointer = (void *)0, __ecereProp___ecereNameSpace__ecere__com__MapIterator_Set_map(&i, (intlStrings)), i);
@@ -4255,9 +4255,7 @@ extern char * __ecereNameSpace__ecere__sys__ChangeExtension(char * string, cha
extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__FileOpen(char * fileName, int mode);
-extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
-
-extern char * __ecereNameSpace__ecere__sys__GetSystemPathBuffer(char * d, char * p);
+extern char * __ecereNameSpace__ecere__sys__GetSlashPathBuffer(char * d, char * p);
extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__MapIterator;
@@ -4312,8 +4310,8 @@ if(f)
char * filePrefix = "";
if(!(srcFile[0] && (srcFile[1] == ':' || srcFile[0] == '/')))
-filePrefix = (__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? ".\\" : "./";
-__ecereNameSpace__ecere__sys__GetSystemPathBuffer(srcFileFixed, srcFile);
+filePrefix = "./";
+__ecereNameSpace__ecere__sys__GetSlashPathBuffer(srcFileFixed, srcFile);
{
struct __ecereNameSpace__ecere__com__MapIterator s = (s.container = (void *)0, s.pointer = (void *)0, __ecereProp___ecereNameSpace__ecere__com__MapIterator_Set_map(&s, (intlStrings)), s);
@@ -1,5 +1,5 @@
msgid ""
-msgstr
+msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
@@ -8,9 +8,9 @@ msgstr
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Basepath: ..\\\n"
+"X-Poedit-Basepath: ../\n"
-#: .\ecc.ec:308
+#: ./ecc.ec:308
msgid "Syntax:\n ecc [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n"
msgstr "Syntax:\n ecc [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n"
@@ -1,5 +1,5 @@
msgid ""
-msgstr
+msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
@@ -8,9 +8,9 @@ msgstr
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Basepath: ..\\\n"
+"X-Poedit-Basepath: ../\n"
-#: .\ecp.ec:1458
+#: ./ecp.ec:1458
msgid "Syntax:\n ecp [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n"
msgstr "Syntax:\n ecp [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n"
View
@@ -1727,6 +1727,9 @@ class SymbolgenApp : Application
//if(!strcmp(ext, "c"))
{
+ String symbolsDir = GetSymbolsDir();
+ // Only generating .pot files when building from release.* directory for now
+ bool outputPot = symbolsDir && SearchString(symbolsDir, 0, "release.", false, false);
Map<ContextStringPair, List<String> > intlStrings { };
MapIterator<ContextStringPair, List<String>> it { map = intlStrings };
@@ -1905,7 +1908,7 @@ class SymbolgenApp : Application
}
WriteMain(output);
- if(intlStrings.count)
+ if(outputPot && intlStrings.count)
{
File potFile;
char potFileName[MAX_LOCATION];
@@ -1920,7 +1923,7 @@ class SymbolgenApp : Application
{
// Write header:
potFile.Puts("msgid \"\"\n");
- potFile.Puts("msgstr ""\n");
+ potFile.Puts("msgstr \"\"\n");
potFile.Puts("\"Project-Id-Version: \\n\"\n");
potFile.Puts("\"POT-Creation-Date: \\n\"\n");
potFile.Puts("\"PO-Revision-Date: \\n\"\n");
@@ -1929,7 +1932,7 @@ class SymbolgenApp : Application
potFile.Puts("\"MIME-Version: 1.0\\n\"\n");
potFile.Puts("\"Content-Type: text/plain; charset=iso-8859-1\\n\"\n");
potFile.Puts("\"Content-Transfer-Encoding: 8bit\\n\"\n");
- potFile.Puts("\"X-Poedit-Basepath: ..\\\\\\n\"\n");
+ potFile.Puts("\"X-Poedit-Basepath: ../\\n\"\n");
potFile.Puts("\n");
for(i : intlStrings)
@@ -1,5 +1,5 @@
msgid ""
-msgstr
+msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
@@ -8,9 +8,9 @@ msgstr
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Basepath: ..\\\n"
+"X-Poedit-Basepath: ../\n"
-#: .\ecs.ec:1704
+#: ./ecs.ec:1704
msgid "Syntax:\n ecs [-t <target platform>] <input>[, <input>]* -o <output>\n"
msgstr "Syntax:\n ecs [-t <target platform>] <input>[, <input>]* -o <output>\n"
Oops, something went wrong.

0 comments on commit db3c6ca

Please sign in to comment.