This code iterates over the detected languages, and chooses the language code that is the last entry.
I've seen for example, both a ja and no detected as languages with equal confidence. I'm not sure if multiple languages can appear with unequal confidence, but if so, it should preserve the most likely language. In the case of a tie, I think it should prefer the first entry.
This code iterates over the detected languages, and chooses the language code that is the last entry.
I've seen for example, both a
ja
andno
detected as languages with equal confidence. I'm not sure if multiple languages can appear with unequal confidence, but if so, it should preserve the most likely language. In the case of a tie, I think it should prefer the first entry.