Browse Source

Merged Translations.ini into RenX.Core.ini

pull/3/head
Jessica James 9 years ago
parent
commit
e4b4608065
  1. 72
      Configs/RenX.Core.ini
  2. BIN
      Release/Plugins/RenX.Core.lib
  3. 8
      RenX.Core/RenX_Core.cpp
  4. 8
      RenX.Core/RenX_Core.h
  5. 52
      RenX.Core/RenX_Functions.cpp
  6. 2
      RenX.Core/RenX_Tags.cpp
  7. 72
      Translations.ini

72
Configs/RenX.Core.ini

@ -7,9 +7,8 @@
;
; Settings:
; Servers=String (Format: Server1 Server2)
; TranslationsFile=String (Default: Translations.ini)
; CommandsFile=String (Default: RenXGameCommands.ini)
; TagDefinitions=String (Default: RenX.Tags)
; TagDefinitions=String (Default: Tags)
;
Servers=Server1 Server2
@ -257,6 +256,73 @@ IRCPrefix=07[Marathon]
; LoseScoreTag=String (Default: {LOSESCORE}; used exclusively for GameOver formats)
;
[RenX.Tags]
[Tags]
; [Name]
; This section translates names of presets to more human-friendly strings.
; These override the default presets.
; Example: Rx_Vehicle_Artillery=Nod Artillery
;
[Name]
; [TeamColor]
; Overrides the color strings for IRC message formatting.
;
; Settings:
; Nod=String (Default: 04)
; GDI=String (Default: 08)
; Other=String (Default: 14)
;
[TeamColor]
; [LongTeamName]
; Overrides the long team name translations
;
; Settings:
; Nod=String (Default: Brotherhood of Nod)
; GDI=String (Default: Global Defense Initiative)
; Other=String (Default: Unknown)
[LongTeamName]
; [ShortTeamName]
; Overrides the short team name translations
;
; Settings:
; Nod=String (Default: Nod)
; GDI=String (Default: GDI)
; Other=String (Default: Other)
[ShortTeamName]
; [WinType]
; This section translates win types into human-readable strings.
;
; Settings:
; Score=String (Default: Domination (High Score))
; Base=String (Default: Conquest (Base Destruction))
; Beacon=String (Default: Espionage (Beacon))
; Tie=String (Default: Draw (Tie))
; Shutdown=String (Default: Ceasefire (Shutdown))
; Unknown=String (Default: Aliens (Unknown))
;
[WinType]
; [WinTypePlain]
; This section translates plain win types into human-readable strings.
;
; Settings:
; Score=String (Default: High Score)
; Base=String (Default: Base Destruction)
; Beacon=String (Default: Beacon)
; Tie=String (Default: Tie)
; Shutdown=String (Default: Shutdown)
; Unknown=String (Default: Unknown)
;
[WinTypePlain]
;EOF

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

8
RenX.Core/RenX_Core.cpp

@ -43,10 +43,9 @@ bool RenX::Core::initialize()
RenX::banDatabase->initialize();
RenX::exemptionDatabase->initialize();
RenX::tags->initialize();
RenX::initTranslations(this->config);
const Jupiter::ReadableString &serverList = this->config.get(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("Servers"));
RenX::Core::translationsFile.readFile(this->config.get(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("TranslationsFile"), STRING_LITERAL_AS_REFERENCE("Translations.ini")));
RenX::initTranslations(RenX::Core::translationsFile);
RenX::Core::commandsFile.readFile(this->config.get(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("CommandsFile"), STRING_LITERAL_AS_REFERENCE("RenXGameCommands.ini")));
unsigned int wc = serverList.wordCount(WHITESPACE);
@ -152,11 +151,6 @@ Jupiter::ArrayList<RenX::Plugin> *RenX::Core::getPlugins()
return &(RenX::Core::plugins);
}
Jupiter::INIFile &RenX::Core::getTranslationsFile()
{
return RenX::Core::translationsFile;
}
Jupiter::INIFile &RenX::Core::getCommandsFile()
{
return RenX::Core::commandsFile;

8
RenX.Core/RenX_Core.h

@ -150,13 +150,6 @@ namespace RenX
*/
Jupiter::ArrayList<RenX::Plugin> *getPlugins();
/**
* @brief Fetches the translations override file.
*
* @return INIFile containing translations overrides.
*/
Jupiter::INIFile &getTranslationsFile();
/**
* @brief Fetches the commands settings file.
*
@ -191,7 +184,6 @@ namespace RenX
/** Inaccessible private members */
Jupiter::ArrayList<RenX::Server> servers;
Jupiter::ArrayList<RenX::Plugin> plugins;
Jupiter::INIFile translationsFile;
Jupiter::INIFile commandsFile;
};

52
RenX.Core/RenX_Functions.cpp

@ -492,7 +492,7 @@ const Jupiter::ReferenceString RenX::translateName(const Jupiter::ReadableString
if (obj.isEmpty())
return Jupiter::ReferenceString::empty;
Jupiter::ReferenceString iniTranslation = RenX::getCore()->getTranslationsFile().get(STRING_LITERAL_AS_REFERENCE("Name"), obj);
Jupiter::ReferenceString iniTranslation = RenX::getCore()->getConfig().get(STRING_LITERAL_AS_REFERENCE("Name"), obj);
if (iniTranslation.isNotEmpty())
return iniTranslation;
@ -837,31 +837,31 @@ const Jupiter::ReadableString &RenX::translateWinTypePlain(RenX::WinType winType
void RenX::initTranslations(Jupiter::INIFile &translationsFile)
{
NodColor = translationsFile.get(STRING_LITERAL_AS_REFERENCE("TeamColor"), STRING_LITERAL_AS_REFERENCE("Nod"), STRING_LITERAL_AS_REFERENCE("04"));
GDIColor = translationsFile.get(STRING_LITERAL_AS_REFERENCE("TeamColor"), STRING_LITERAL_AS_REFERENCE("GDI"), STRING_LITERAL_AS_REFERENCE("08"));
OtherColor = translationsFile.get(STRING_LITERAL_AS_REFERENCE("TeamColor"), STRING_LITERAL_AS_REFERENCE("Other"), STRING_LITERAL_AS_REFERENCE("14"));
NodShortName = translationsFile.get(STRING_LITERAL_AS_REFERENCE("ShortTeamName"), STRING_LITERAL_AS_REFERENCE("Nod"), STRING_LITERAL_AS_REFERENCE("Nod"));
GDIShortName = translationsFile.get(STRING_LITERAL_AS_REFERENCE("ShortTeamName"), STRING_LITERAL_AS_REFERENCE("GDI"), STRING_LITERAL_AS_REFERENCE("GDI"));
OtherShortName = translationsFile.get(STRING_LITERAL_AS_REFERENCE("ShortTeamName"), STRING_LITERAL_AS_REFERENCE("Other"), STRING_LITERAL_AS_REFERENCE("N/A"));
NodLongName = translationsFile.get(STRING_LITERAL_AS_REFERENCE("LongTeamName"), STRING_LITERAL_AS_REFERENCE("Nod"), STRING_LITERAL_AS_REFERENCE("Brotherhood of Nod"));
GDILongName = translationsFile.get(STRING_LITERAL_AS_REFERENCE("LongTeamName"), STRING_LITERAL_AS_REFERENCE("GDI"), STRING_LITERAL_AS_REFERENCE("Global Defense Initiative"));
OtherLongName = translationsFile.get(STRING_LITERAL_AS_REFERENCE("LongTeamName"), STRING_LITERAL_AS_REFERENCE("Other"), STRING_LITERAL_AS_REFERENCE("Unknown"));
scoreWinTypeTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinType"), STRING_LITERAL_AS_REFERENCE("Score"), STRING_LITERAL_AS_REFERENCE("Domination (High Score)"));
baseWinTypeTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinType"), STRING_LITERAL_AS_REFERENCE("Base"), STRING_LITERAL_AS_REFERENCE("Conquest (Base Destruction)"));
beaconWinTypeTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinType"), STRING_LITERAL_AS_REFERENCE("Beacon"), STRING_LITERAL_AS_REFERENCE("Espionage (Beacon)"));
tieWinTypeTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinType"), STRING_LITERAL_AS_REFERENCE("Tie"), STRING_LITERAL_AS_REFERENCE("Draw (Tie)"));
shutdownWinTypeTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinType"), STRING_LITERAL_AS_REFERENCE("Shutdown"), STRING_LITERAL_AS_REFERENCE("Ceasefire (Shutdown)"));
surrenderWinTypeTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinType"), STRING_LITERAL_AS_REFERENCE("Surrender"), STRING_LITERAL_AS_REFERENCE("Forfeit (Surrender)"));
unknownWinTypeTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinType"), STRING_LITERAL_AS_REFERENCE("Unknown"), STRING_LITERAL_AS_REFERENCE("Aliens (Unknown)"));
scoreWinTypePlainTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinTypePlain"), STRING_LITERAL_AS_REFERENCE("Score"), STRING_LITERAL_AS_REFERENCE("High Score"));
baseWinTypePlainTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinTypePlain"), STRING_LITERAL_AS_REFERENCE("Base"), STRING_LITERAL_AS_REFERENCE("Base Destruction"));
beaconWinTypePlainTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinTypePlain"), STRING_LITERAL_AS_REFERENCE("Beacon"), STRING_LITERAL_AS_REFERENCE("Beacon"));
tieWinTypePlainTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinTypePlain"), STRING_LITERAL_AS_REFERENCE("Tie"), STRING_LITERAL_AS_REFERENCE("Tie"));
shutdownWinTypePlainTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinTypePlain"), STRING_LITERAL_AS_REFERENCE("Shutdown"), STRING_LITERAL_AS_REFERENCE("Shutdown"));
unknownWinTypePlainTranslation = translationsFile.get(STRING_LITERAL_AS_REFERENCE("WinTypePlain"), STRING_LITERAL_AS_REFERENCE("Unknown"), STRING_LITERAL_AS_REFERENCE("Unknown"));
NodColor = translationsFile.get("TeamColor"_jrs, "Nod"_jrs, "04"_jrs);
GDIColor = translationsFile.get("TeamColor"_jrs, "GDI"_jrs, "08"_jrs);
OtherColor = translationsFile.get("TeamColor"_jrs, "Other"_jrs, "14"_jrs);
NodShortName = translationsFile.get("ShortTeamName"_jrs, "Nod"_jrs, "Nod"_jrs);
GDIShortName = translationsFile.get("ShortTeamName"_jrs, "GDI"_jrs, "GDI"_jrs);
OtherShortName = translationsFile.get("ShortTeamName"_jrs, "Other"_jrs, "N/A"_jrs);
NodLongName = translationsFile.get("LongTeamName"_jrs, "Nod"_jrs, "Brotherhood of Nod"_jrs);
GDILongName = translationsFile.get("LongTeamName"_jrs, "GDI"_jrs, "Global Defense Initiative"_jrs);
OtherLongName = translationsFile.get("LongTeamName"_jrs, "Other"_jrs, "Unknown"_jrs);
scoreWinTypeTranslation = translationsFile.get("WinType"_jrs, "Score"_jrs, "Domination (High Score)"_jrs);
baseWinTypeTranslation = translationsFile.get("WinType"_jrs, "Base"_jrs, "Conquest (Base Destruction)"_jrs);
beaconWinTypeTranslation = translationsFile.get("WinType"_jrs, "Beacon"_jrs, "Espionage (Beacon)"_jrs);
tieWinTypeTranslation = translationsFile.get("WinType"_jrs, "Tie"_jrs, "Draw (Tie)"_jrs);
shutdownWinTypeTranslation = translationsFile.get("WinType"_jrs, "Shutdown"_jrs, "Ceasefire (Shutdown)"_jrs);
surrenderWinTypeTranslation = translationsFile.get("WinType"_jrs, "Surrender"_jrs, "Forfeit (Surrender)"_jrs);
unknownWinTypeTranslation = translationsFile.get("WinType"_jrs, "Unknown"_jrs, "Aliens (Unknown)"_jrs);
scoreWinTypePlainTranslation = translationsFile.get("WinTypePlain"_jrs, "Score"_jrs, "High Score"_jrs);
baseWinTypePlainTranslation = translationsFile.get("WinTypePlain"_jrs, "Base"_jrs, "Base Destruction"_jrs);
beaconWinTypePlainTranslation = translationsFile.get("WinTypePlain"_jrs, "Beacon"_jrs, "Beacon"_jrs);
tieWinTypePlainTranslation = translationsFile.get("WinTypePlain"_jrs, "Tie"_jrs, "Tie"_jrs);
shutdownWinTypePlainTranslation = translationsFile.get("WinTypePlain"_jrs, "Shutdown"_jrs, "Shutdown"_jrs);
unknownWinTypePlainTranslation = translationsFile.get("WinTypePlain"_jrs, "Unknown"_jrs, "Unknown"_jrs);
}
Jupiter::String RenX::getFormattedPlayerName(const RenX::PlayerInfo *player)

2
RenX.Core/RenX_Tags.cpp

@ -54,7 +54,7 @@ bool TagsImp::initialize()
this->uniqueTag = "\0\0\0\0\0\0"_jrs;
const Jupiter::INIFile &config = RenX::getCore()->getConfig();
const Jupiter::ReadableString &configSection = config.get(Jupiter::ReferenceString::empty, "TagDefinitions"_jrs, "RenX.Tags"_jrs);
const Jupiter::ReadableString &configSection = config.get(Jupiter::ReferenceString::empty, "TagDefinitions"_jrs, "Tags"_jrs);
TagsImp::bar_width = config.getInt(configSection, "BarWidth"_jrs, 19);

72
Translations.ini

@ -1,72 +0,0 @@
; Translations.ini
; The name of this file can be specified in the primary configuration file
; as "TranslationsFile" under "RenX".
;
; [Name]
; This section translates names of presets to more human-friendly strings.
; These override the default presets.
; Example: Rx_Vehicle_Artillery=Nod Artillery
;
[Name]
; [TeamColor]
; Overrides the color strings for IRC message formatting.
;
; Settings:
; Nod=String (Default: 04)
; GDI=String (Default: 08)
; Other=String (Default: 14)
;
[TeamColor]
; [LongTeamName]
; Overrides the long team name translations
;
; Settings:
; Nod=String (Default: Brotherhood of Nod)
; GDI=String (Default: Global Defense Initiative)
; Other=String (Default: Unknown)
[LongTeamName]
; [ShortTeamName]
; Overrides the short team name translations
;
; Settings:
; Nod=String (Default: Nod)
; GDI=String (Default: GDI)
; Other=String (Default: Other)
[ShortTeamName]
; [WinType]
; This section translates win types into human-readable strings.
;
; Settings:
; Score=String (Default: Domination (High Score))
; Base=String (Default: Conquest (Base Destruction))
; Beacon=String (Default: Espionage (Beacon))
; Tie=String (Default: Draw (Tie))
; Shutdown=String (Default: Ceasefire (Shutdown))
; Unknown=String (Default: Aliens (Unknown))
;
[WinType]
; [WinTypePlain]
; This section translates plain win types into human-readable strings.
;
; Settings:
; Score=String (Default: High Score)
; Base=String (Default: Base Destruction)
; Beacon=String (Default: Beacon)
; Tie=String (Default: Tie)
; Shutdown=String (Default: Shutdown)
; Unknown=String (Default: Unknown)
;
[WinTypePlain]
; EOF
Loading…
Cancel
Save