Language matching is case-sensitive

More
5 years 11 months ago #2958 by studenman
I love how flexible I2L is when setting the languages, it's able to find an effective matching language without regard to word order. However, I'm using it with Steam and they refer to languages with lower-case strings like "english."

In LanguageSource.GetLanguageIndex, it calls GetCommonWordInLanguageNames, but this method is case-sensitive.

Slightly funny is that the comment above this code reads:
// Then allow matching "English (Canada)" to "english"
but I don't think it would actually work with lower-case "english". ;)

My solution is to modify these lines in GetCommonWordInLanguageNames:
	string[] Words1 = Language1.ToLower().Split(separators);
	string[] Words2 = Language2.ToLower().Split(separators);

Follow Tiny Bubbles Development:
Twitter | Facebook | Web

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago #2959 by Frank
Thanks for looking into this!
You are absolutely right, AreSameLanguages is correctly using the IgnoreCase comparison, but GetCommonWordInLanguaNames is not.
I will correct this in the next beta.

Thanks for reporting it!!!
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
The following user(s) said Thank You: studenman

Please Log in or Create an account to join the conversation.

Time to create page: 0.529 seconds
Template by JoomlaShine