Skip to content

Commit

Permalink
Feature i18n (#21)
Browse files Browse the repository at this point in the history
Traslation subsystem.
  • Loading branch information
enriquesomolinos authored Jul 18, 2019
1 parent 5b7fd6e commit 006f70b
Show file tree
Hide file tree
Showing 14 changed files with 376 additions and 69 deletions.
7 changes: 7 additions & 0 deletions DreeRally.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@
<ClCompile Include="raceResults.c" />
<ClCompile Include="savegame.c" />
<ClCompile Include="minifmod_modified\soundSystem.c" />
<ClCompile Include="i18n\i18n.c" />
<ClCompile Include="util.c" />
<ClCompile Include="util\hash.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="race\3dSystem.h" />
Expand Down Expand Up @@ -219,7 +221,9 @@
<ClInclude Include="minifmod_modified\soundSystem.h" />
<ClInclude Include="minifmod_modified\system_memory.h" />
<ClInclude Include="race\terrain.h" />
<ClInclude Include="i18n\i18n.h" />
<ClInclude Include="util.h" />
<ClInclude Include="util\hash.h" />
<ClInclude Include="variables.h" />
<ClInclude Include="raceResults.h" />
<ClInclude Include="minifmod_modified\xmeffects.h" />
Expand All @@ -231,6 +235,9 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="lang\langEs.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
32 changes: 32 additions & 0 deletions DreeRally.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@
<Filter Include="Source Files\popup">
<UniqueIdentifier>{05c38d85-362d-47aa-b0fc-9f32074b7d2e}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\i18n">
<UniqueIdentifier>{4f0a99e6-3999-4119-baba-06eba08d0381}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\i18n">
<UniqueIdentifier>{c197791c-9c41-43c1-a016-2e5899a8317b}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\util">
<UniqueIdentifier>{46c7b985-1419-4744-b2e6-9dcd3c08789d}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\util">
<UniqueIdentifier>{6fe8fa32-7524-4db3-b6db-3284b19f5dce}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files\lang">
<UniqueIdentifier>{de194950-f540-4591-a1a2-4d3cc1d493cd}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="anim.c">
Expand Down Expand Up @@ -129,6 +144,12 @@
<ClCompile Include="blackmarket\blackMarket.c">
<Filter>Source Files\blackmarket</Filter>
</ClCompile>
<ClCompile Include="i18n\i18n.c">
<Filter>Source Files\i18n</Filter>
</ClCompile>
<ClCompile Include="util\hash.c">
<Filter>Source Files\util</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cars.h">
Expand Down Expand Up @@ -221,5 +242,16 @@
<ClInclude Include="blackmarket\blackMarket.h">
<Filter>Header Files\blackmarket</Filter>
</ClInclude>
<ClInclude Include="i18n\i18n.h">
<Filter>Header Files\i18n</Filter>
</ClInclude>
<ClInclude Include="util\hash.h">
<Filter>Header Files\util</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="lang\langEs.txt">
<Filter>Resource Files\lang</Filter>
</None>
</ItemGroup>
</Project>
11 changes: 10 additions & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@
#include "defs.h"
#include <string.h>
#include "hof/hallOfFame.h"
#include "i18n/i18n.h"




MainArgs mainArgs = { 0,1,1,1,1 };
MainArgs mainArgs = { 0,1,1,1,1,NULL };

Configuration configuration;


int checkArgs(char * args)
{
int result = 0;
char delim[] = "=";
char *s;

if (strstr(args, "-nosound"))
mainArgs.configNoSound = 0;
Expand All @@ -34,6 +37,12 @@ int checkArgs(char * args)
mainArgs.configGL = 0;
if (strstr(args, "-smooth"))
mainArgs.configSmooth = 0;
if (strstr(args, "-lang=")){
s = strstr(args, "-lang=");
s = strstr(args, "=");
mainArgs.language = &s[1];

}
result = strstr(args, "-window");
if (result)

Expand Down
3 changes: 3 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include "hof/hallOfFame.h"



typedef struct MainArgs {
int configNoSound;
int configSmooth;
int configGL;
int configWindow;
int configNoSoundEffect;
char * language;
} MainArgs;

typedef struct Configuration {
Expand Down
Loading

0 comments on commit 006f70b

Please sign in to comment.