give more local functions internal linkage

This commit is contained in:
Marco Antonio J. Costa
2026-07-21 18:39:50 -03:00
committed by majcosta
parent af4eeb09f4
commit 4be9b106f4
+17 -19
View File
@@ -354,10 +354,9 @@ bool Loc::ExportStrings()
#include <vfs/Core/vfs_file_raii.h> #include <vfs/Core/vfs_file_raii.h>
#include "Encrypted File.h" #include "Encrypted File.h"
namespace Loc namespace {
wchar_t ToPolish(wchar_t siChar)
{ {
wchar_t ToPolish(wchar_t siChar)
{
switch( siChar ) switch( siChar )
{ {
case 165: siChar = 260; break; case 165: siChar = 260; break;
@@ -382,10 +381,10 @@ namespace Loc
case 159: siChar = 378; break; case 159: siChar = 378; break;
} }
return siChar; return siChar;
} }
wchar_t ToRussian(wchar_t siChar) wchar_t ToRussian(wchar_t siChar)
{ {
switch( siChar ) switch( siChar )
{ {
//capital letters //capital letters
@@ -471,9 +470,10 @@ namespace Loc
case 255: siChar = 1103; break; //U+044F d1 8f CYRILLIC SMALL LETTER YA case 255: siChar = 1103; break; //U+044F d1 8f CYRILLIC SMALL LETTER YA
} }
return siChar; return siChar;
} }
bool Translate(vfs::String::char_t* str, int len, i18n::Lang lang)
{ bool Translate(vfs::String::char_t* str, int len, i18n::Lang lang)
{
switch (lang) { switch (lang) {
case i18n::Lang::en: case i18n::Lang::en:
case i18n::Lang::de: case i18n::Lang::de:
@@ -497,10 +497,8 @@ namespace Loc
return false; return false;
} }
return false; return false;
} }
}; // namespace Loc
namespace {
void ExportMercBio() void ExportMercBio()
{ {
#define SIZE_MERC_BIO_INFO 400 * 2 #define SIZE_MERC_BIO_INFO 400 * 2
@@ -519,12 +517,12 @@ void ExportMercBio()
// //
file.read((vfs::Byte*)pInfoString, SIZE_MERC_BIO_INFO); file.read((vfs::Byte*)pInfoString, SIZE_MERC_BIO_INFO);
DecodeString(pInfoString,SIZE_MERC_BIO_INFO); DecodeString(pInfoString,SIZE_MERC_BIO_INFO);
Loc::Translate(pInfoString, SIZE_MERC_BIO_INFO, g_lang); Translate(pInfoString, SIZE_MERC_BIO_INFO, g_lang);
props.setStringProperty(L"Bio", vfs::toString<wchar_t>(i), pInfoString); props.setStringProperty(L"Bio", vfs::toString<wchar_t>(i), pInfoString);
file.read((vfs::Byte*)pAddInfo, SIZE_MERC_ADDITIONAL_INFO); file.read((vfs::Byte*)pAddInfo, SIZE_MERC_ADDITIONAL_INFO);
DecodeString(pAddInfo, SIZE_MERC_ADDITIONAL_INFO); DecodeString(pAddInfo, SIZE_MERC_ADDITIONAL_INFO);
Loc::Translate(pAddInfo, SIZE_MERC_ADDITIONAL_INFO, g_lang); Translate(pAddInfo, SIZE_MERC_ADDITIONAL_INFO, g_lang);
props.setStringProperty(L"Add", vfs::toString<wchar_t>(i), pAddInfo); props.setStringProperty(L"Add", vfs::toString<wchar_t>(i), pAddInfo);
} }
props.writeToXMLFile(L"Localization/AimBiographies.xml", vfs::PropertyContainer::TagMap()); props.writeToXMLFile(L"Localization/AimBiographies.xml", vfs::PropertyContainer::TagMap());
@@ -544,7 +542,7 @@ void ExportAIMHistory()
// //
file.read((vfs::Byte*)pHistLine, AIM_HISTORY_LINE_SIZE); file.read((vfs::Byte*)pHistLine, AIM_HISTORY_LINE_SIZE);
DecodeString(pHistLine,AIM_HISTORY_LINE_SIZE); DecodeString(pHistLine,AIM_HISTORY_LINE_SIZE);
Loc::Translate(pHistLine, AIM_HISTORY_LINE_SIZE, g_lang); Translate(pHistLine, AIM_HISTORY_LINE_SIZE, g_lang);
props.setStringProperty(L"Line", vfs::toString<wchar_t>(i), pHistLine); props.setStringProperty(L"Line", vfs::toString<wchar_t>(i), pHistLine);
} }
props.writeToXMLFile(L"Localization/AimHistory.xml", vfs::PropertyContainer::TagMap()); props.writeToXMLFile(L"Localization/AimHistory.xml", vfs::PropertyContainer::TagMap());
@@ -565,7 +563,7 @@ void ExportAIMPolicy()
// //
file.read((vfs::Byte*)pPolLine, AIM_HISTORY_LINE_SIZE); file.read((vfs::Byte*)pPolLine, AIM_HISTORY_LINE_SIZE);
DecodeString(pPolLine,AIM_HISTORY_LINE_SIZE); DecodeString(pPolLine,AIM_HISTORY_LINE_SIZE);
Loc::Translate(pPolLine, AIM_HISTORY_LINE_SIZE, g_lang); Translate(pPolLine, AIM_HISTORY_LINE_SIZE, g_lang);
props.setStringProperty(L"Line", vfs::toString<wchar_t>(i), pPolLine); props.setStringProperty(L"Line", vfs::toString<wchar_t>(i), pPolLine);
} }
props.writeToXMLFile(L"Localization/AimPolicy.xml", vfs::PropertyContainer::TagMap()); props.writeToXMLFile(L"Localization/AimPolicy.xml", vfs::PropertyContainer::TagMap());
@@ -585,7 +583,7 @@ void ExportAlumniName()
// //
file.read((vfs::Byte*)pAlumniName, AIM_ALUMNI_NAME_SIZE); file.read((vfs::Byte*)pAlumniName, AIM_ALUMNI_NAME_SIZE);
DecodeString(pAlumniName,AIM_ALUMNI_NAME_SIZE); DecodeString(pAlumniName,AIM_ALUMNI_NAME_SIZE);
Loc::Translate(pAlumniName, AIM_ALUMNI_NAME_SIZE, g_lang); Translate(pAlumniName, AIM_ALUMNI_NAME_SIZE, g_lang);
props.setStringProperty(L"Line", vfs::toString<wchar_t>(i), pAlumniName); props.setStringProperty(L"Line", vfs::toString<wchar_t>(i), pAlumniName);
} }
props.writeToXMLFile(L"Localization/AlumniName.xml", vfs::PropertyContainer::TagMap()); props.writeToXMLFile(L"Localization/AlumniName.xml", vfs::PropertyContainer::TagMap());
@@ -615,7 +613,7 @@ void ExportDialogues()
if(file.read((vfs::Byte*)pDiagLine, DIALOGUESIZE) > 0) if(file.read((vfs::Byte*)pDiagLine, DIALOGUESIZE) > 0)
{ {
DecodeString(pDiagLine,DIALOGUESIZE); DecodeString(pDiagLine,DIALOGUESIZE);
Loc::Translate(pDiagLine, DIALOGUESIZE, g_lang); Translate(pDiagLine, DIALOGUESIZE, g_lang);
if(wcslen(pDiagLine)) if(wcslen(pDiagLine))
{ {
props.setStringProperty(vfs::toString<wchar_t>(id),vfs::toString<wchar_t>(i), pDiagLine); props.setStringProperty(vfs::toString<wchar_t>(id),vfs::toString<wchar_t>(i), pDiagLine);
@@ -662,7 +660,7 @@ void ExportNPCDialogues()
if(file.read((vfs::Byte*)pDiagLine, SIZE) > 0) if(file.read((vfs::Byte*)pDiagLine, SIZE) > 0)
{ {
DecodeString(pDiagLine,SIZE); DecodeString(pDiagLine,SIZE);
Loc::Translate(pDiagLine, SIZE, g_lang); Translate(pDiagLine, SIZE, g_lang);
if(wcslen(pDiagLine)) if(wcslen(pDiagLine))
{ {
props.setStringProperty(id,vfs::toString<wchar_t>(i), pDiagLine); props.setStringProperty(id,vfs::toString<wchar_t>(i), pDiagLine);