Select Language Term by Term
- chillerVille
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
8 years 11 months ago #1211
by chillerVille
Replied by chillerVille on topic Select Language Term by Term
If all it takes to change the font is to make this assignment:
Localize.SecondaryTranslation = fontName;
... I don't find a way to get that fontName for the chosen language.
Localize.SecondaryTranslation = fontName;
... I don't find a way to get that fontName for the chosen language.
Please Log in or Create an account to join the conversation.
8 years 11 months ago - 8 years 11 months ago #1212
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Select Language Term by Term
Hi,
Just need to get the termData for the secondary term as well and set that:
That should be work.
Also, in one of the latest versions, the CallBackTerm and CallBackSecondaryTerm was introduced to avoid having to call GetFinalTerms.
So, a simpler way its:
Hope that helps,
Frank
Just need to get the termData for the secondary term as well and set that:
public void OnModifyLocalization() {
string language = m_sceneManager.GetSystemLanguage();
string term, secondary;
GetComponent<I2.Loc.Localize>().GetFinalTerms(out term, out secondary);
var termData = LocalizationManager.GetTermData(term);
var secTermData = LocalizationManager.GetTermData(secondary); // added
int languageIndex = LocalizationManager.Sources[0].GetLanguageIndex(language);
if (languageIndex >= 0) {
if (termData != null)
Localize.MainTranslation = termData.Languages[languageIndex];
if (secTermData != null) // added
Localize.SecondaryTranslation = secTermData.Languages[languageIndex]; // added
}
}
That should be work.
Also, in one of the latest versions, the CallBackTerm and CallBackSecondaryTerm was introduced to avoid having to call GetFinalTerms.
So, a simpler way its:
public void OnModifyLocalization() {
string language = m_sceneManager.GetSystemLanguage();
int languageIndex = LocalizationManager.Sources[0].GetLanguageIndex(language);
if (languageIndex < 0)
return;
//--[ Text ]--------------
var termData = LocalizationManager.GetTermData(Localize.CallBackTerm);
if (termData != null)
Localize.MainTranslation = termData.Languages[languageIndex];
//--[ Font ]--------------
var secTermData = LocalizationManager.GetTermData(Localize.CallBackSecondaryTerm );
if (secTermData != null)
Localize.SecondaryTranslation = secTermData.Languages[languageIndex];
}
Hope that helps,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Last edit: 8 years 11 months ago by Frank.
Please Log in or Create an account to join the conversation.
- chillerVille
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
8 years 11 months ago #1213
by chillerVille
Thanks Frank, you just made my day, and fixed the one and only problem we had with I2 Localization system. I've seen what they use at Ubisoft, and a couple of other companies, but your localization system work just much better. 100%!
Replied by chillerVille on topic Select Language Term by Term
Frank wrote: Hi,
Just need to get the termData for the secondary term as well and set that:
public void OnModifyLocalization() { string language = m_sceneManager.GetSystemLanguage(); string term, secondary; GetComponent<I2.Loc.Localize>().GetFinalTerms(out term, out secondary); var termData = LocalizationManager.GetTermData(term); var secTermData = LocalizationManager.GetTermData(secondary); // added int languageIndex = LocalizationManager.Sources[0].GetLanguageIndex(language); if (languageIndex >= 0) { if (termData != null) Localize.MainTranslation = termData.Languages[languageIndex]; if (secTermData != null) // added Localize.SecondaryTranslation = secTermData.Languages[languageIndex]; // added } }
That should be work.
Also, in one of the latest versions, the CallBackTerm and CallBackSecondaryTerm was introduced to avoid having to call GetFinalTerms.
So, a simpler way its:
public void OnModifyLocalization() { string language = m_sceneManager.GetSystemLanguage(); int languageIndex = LocalizationManager.Sources[0].GetLanguageIndex(language); if (languageIndex < 0) return; //--[ Text ]-------------- var termData = LocalizationManager.GetTermData(Localize.CallBackTerm); if (termData != null) Localize.MainTranslation = termData.Languages[languageIndex]; //--[ Font ]-------------- var secTermData = LocalizationManager.GetTermData(Localize.CallBackSecondaryTerm ); if (secTermData != null) Localize.SecondaryTranslation = secTermData.Languages[languageIndex]; }
Hope that helps,
Frank
Thanks Frank, you just made my day, and fixed the one and only problem we had with I2 Localization system. I've seen what they use at Ubisoft, and a couple of other companies, but your localization system work just much better. 100%!
Please Log in or Create an account to join the conversation.
8 years 11 months ago #1214
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Select Language Term by Term
I'm glad it's working for you now!!!
Some big companies like SGN have been using it, but the more the merrier!
It will definitely be great if they start using I2L hahaI've seen what they use at Ubisoft, and a couple of other companies, but your localization system work just much better.
Some big companies like SGN have been using it, but the more the merrier!
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
Time to create page: 0.162 seconds