Jump to content

Recommended Posts

hi to all, i have a problem with localization, does it load stringable before gui hpp? or not...

some where in gui code :
class RscButton_1600: RscButton
{
	idc = 1600;
	x = 0.2525 * safezoneW + safezoneX;
	y = 0.159 * safezoneH + safezoneY;
	w = 0.159844 * safezoneW;
	h = 0.319 * safezoneH;
	text = $STR_LocalizedString; //--- ToDo: Localize;
};

and the stringtable.xml

Some key :
<Key ID="LocalizedString">
	<Original>New Game</Original>
	<Italian>Nuova Missione</Italian>
	<Russian>Новая игра</Russian>
</Key>

....in game when i open the gui it doesn't show nothing... like it tryied to localize but he don't found nothing and output nothing

😕

 

if i try to localize it afther all loading througt a script, like ... finddisplay 00000 ctrldisplay 0000 ctrlsettext...it work 😐

  • Haha 1

Share this post


Link to post
Share on other sites
9 minutes ago, ZeroAinz said:

does it load stringable before

yes

9 minutes ago, ZeroAinz said:

gui hpp?

Don't know what thats supposed to be.

 

9 minutes ago, ZeroAinz said:

text = $STR_LocalizedString; //--- ToDo: Localize;

you mean

text="$STR_LocalizedString"

?

 

9 minutes ago, ZeroAinz said:

<Key ID="LocalizedString">

but you wanted STR_LocalizedString, and here you only have LocalizedString. You are missing the STR_

 

https://community.bistudio.com/wiki/Stringtable.xml

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
8 minutes ago, Dedmen said:

yes

Don't know what thats supposed to be.

 

you mean


text="$STR_LocalizedString"

?

 

but you wanted STR_LocalizedString, and here you only have LocalizedString. You are missing the STR_

 

https://community.bistudio.com/wiki/Stringtable.xml

for gui hpp i mean the file where you store the all classes of controls outputed from gui editor...

i've tryied how did you say but nothing, the string wich is show is : LocalizedString

 

However, if you are also going to use stringtable.xml with configs, you must use special prefix $STR (dollar sign $ followed by uppercase STR) to reference Key ID in config. The Key IDs in stringtable.xml will have to start with "str" or "STR" accordingly, case doesn't matter here.

ⓘ
By convention, an underscore _ is added to the prefix STR_ ($STR_). It provides clarity and makes stringtable.xml universally compatible with both scripts and configs.

this is from stringtable.xml wiki, and i try to use it whatever this is a configfile(the hpp)

 

Share this post


Link to post
Share on other sites

I realized what is the error....to use $STR localization in the configfile  you need to have in stringable this :

this STR_     -> is like a key to use with $ witchout this style in stringable it doesn't work and the _ is for clarity

<Key ID="STR_LocalizedString">
	<Original>New Game</Original>
	<Italian>Nuova Missione</Italian>
	<Russian>Новая игра</Russian>
</Key>

and in the gui.hpp configfile

class RscButton_1600: RscButton
{
	idc = 1600;
	x = 0.2525 * safezoneW + safezoneX;
	y = 0.159 * safezoneH + safezoneY;
	w = 0.159844 * safezoneW;
	h = 0.319 * safezoneH;
	text = $STR_LocalizedString; //--- THIS $STR TELL GAME THIS IS TO LOCALZE
};

......
just write with red for next people who will read this page, after a time....

this is the solution...can close 😀

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×