Jump to content

locale_find: LOCALE_ERROR:


Recommended Posts

  • Gold

Hey guys,

someone got the same problem? I'm getting locale error with these defines. I have written these texts in locale_string.txt so it couldn't be a locale_string.txt problem. This locale error is caused by enabling empire bonuses.

Spoiler
const char * c_apszEmpireNames[EMPIRE_MAX_NUM] =
{
	"전제국",
	"신수국",
	"천조국",
	"진노국"
};

const char * c_apszPrivNames[MAX_PRIV_NUM] =
{
	"",
	"아이템이 나올 확률",
	"돈이 나올 확률",
	"돈 대박이 나올 확률",
	"경험치 배율",
};

const char * c_apszEmpireNames[EMPIRE_MAX_NUM] =
{
	"ŔüÁ¦±ą",
	"˝ĹĽö±ą",
	"õÁ¶±ą",
	"Ářłë±ą"
};

const char * c_apszPrivNames[MAX_PRIV_NUM] =
{
	"",
	"ľĆŔĚĹŰŔĚ łŞżĂ Č®·ü",
	"µ·ŔĚ łŞżĂ Č®·ü",
	"µ· ´ëąÚŔĚ łŞżĂ Č®·ü",
	"°ćÇčġ ąčŔ˛",
};


snprintf(buf, sizeof(buf), LC_TEXT("%s의 %s이 %d%% 증가했습니다!"), GetEmpireName(empire), GetPrivName(type), value);
snprintf(buf, sizeof(buf), LC_TEXT("%sŔÇ %sŔĚ %d%% Áő°ˇÇß˝Ŕ´Ď´Ů!"), GetEmpireName(empire), GetPrivName(type), value);

 

sysser:

Spoiler
SYSERR: Aug 20 20:38:45 :: locale_find: LOCALE_ERROR: "ľĆŔĚĹŰŔĚ łŞżĂ Č®·ü";
SYSERR: Aug 20 20:38:45 :: locale_find: LOCALE_ERROR: "Ářłë±ą";
SYSERR: Aug 20 20:38:45 :: locale_find: LOCALE_ERROR: "%sŔÇ %sŔĚ %d%% Áő°ˇÇß˝Ŕ´Ď´Ů!";

 

Thanks for answers!

Sincerely,

ReFresh

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Gold

@displayjokes Interesting thing is that the game found the string, because if not, it will show the korean text from source, but it's showing right text. So it seems to be some error output for some another reason. I searched in whole server source and I have no idea why it's giving me the error output.

I'll be always helpful! 👊 

Link to comment
Share on other sites

5 minutes ago, ReFresh said:

@displayjokes Interesting thing is that the game found the string, because if not, it will show the korean text from source, but it's showing right text. So it seems to be some error output for some another reason. I searched in whole server source and I have no idea why it's giving me the error output.

When it doesn't find the string the output is the string that is in the source, example:

In source:

ChatPacket(CHAT_TYPE_INFO, LC_TEXT("this is the text that will be translated."));

 

in locale_string.txt you'd have to add:

"this is the text that will be translated.";

"This is the text that will appear in game.";

 

Output in game:

This is the text that will appear in game.

 

IF it doesn't find the translation in the file locale_string.txt, the output would be:

this is the text that will be translated.

And it would be created that line of "locale_find: LOCALE_ERROR:". As you can read trought the error name "locale_find: LOCALE_ERROR:" it failed to find the string in the locale file.

 

Hope this helps you understand how it works.

It's all lies

Link to comment
Share on other sites

  • Gold

@displayjokes Thanks, but I know how it works. But it's still giving me the error outputs:

Spoiler
void CPrivManager::GiveEmpirePriv(BYTE empire, BYTE type, int value, BYTE bLog, time_t end_time_sec)
{
	if (MAX_PRIV_NUM <= type)
	{
		sys_err("PRIV_MANAGER: GiveEmpirePriv: wrong empire priv type(%u)", type);
		return;
	}

	sys_log(0, "Set Empire Priv: empire(%d) type(%d) value(%d) duration_sec(%d)", empire, type, value, end_time_sec-get_global_time());

	value = MINMAX(0, value, 200);
	end_time_sec = MINMAX(0, end_time_sec, get_global_time()+60*60*24*7);

	SPrivEmpireData& rkPrivEmpireData=m_aakPrivEmpireData[type][empire];
	rkPrivEmpireData.m_value = value;
	rkPrivEmpireData.m_end_time_sec = end_time_sec;
	
	const auto total_seconds = end_time_sec - get_global_time();
	const auto hours = total_seconds / 3600;

	if (value)
	{
		char buf[100];
		snprintf(buf, sizeof(buf), LC_TEXT("Empire %s just got higher %s %d%% (remain time %d hour)."), GetEmpireName(empire), GetPrivName(type), value, hours);

		if (empire)
			SendNotice(buf);
		else
			SendLog(buf);
	}
	else
	{
		char buf[100];
		snprintf(buf, sizeof(buf), LC_TEXT("Empire %s is now without the bonus %s - bonus just ended."), GetEmpireName(empire), GetPrivName(type));

		if (empire)
			SendNotice(buf);
		else
			SendLog(buf);
	}

	if (bLog)
	{
		LogManager::instance().CharLog(0, empire, type, value, "EMPIRE_PRIV", "", "");
	}
}

 

And locale_string.txt I have this:

Spoiler
"Empire %s just got higher %s %d%% (remain time %d hour).";
"Empire %s just got higher %s %d%% (remain time %d hour).";

"Empire %s is now without the bonus %s - bonus just ended.";
"Empire %s is now without the bonus %s - bonus just ended.";

 

 

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Gold

@displayjokes nope, sysers show the texts separately by %d and %s. So empire and bonus_name is in %s variable so if I'll activate drop bonus for empire Jinno it will show:

Spoiler
SYSERR: Aug 22 11:28:31 :: locale_find: LOCALE_ERROR: "chance to drop item";

 

Spoiler
SYSERR: Aug 22 11:32:05 :: locale_find: LOCALE_ERROR: "Jinno";

 

Spoiler
"Empire %s just got higher %s %d%% (remain time %d hour).";

 

And of course: c_apszPrivNames, c_apszEmpireNames are changed in source too.

Like this:

Spoiler
const char * c_apszEmpireNames[EMPIRE_MAX_NUM] =
{
	"All empires",
	"Shinsoo",
	"Chunjo",
	"Jinno"
};

const char * c_apszPrivNames[MAX_PRIV_NUM] =
{
	"",
	"chance to drop item",
	"chance to drop more yangs",
	"chance to drop yangs doubled",
	"chance to gain more experience",
};

 

Everything works but I don't really know from where the error is coming and why when all is done right.

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.