Skip to content

Commit 7626d00

Browse files
authored
Merge pull request #840 from ybw0014/fix/locale-language-range
fix: use standard bcp 47 code from Locale to construct LanguageRange
2 parents c90b80a + 8dd4d5b commit 7626d00

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rebar/src/main/kotlin/io/github/pylonmc/rebar/i18n/RebarTranslator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class RebarTranslator private constructor(private val addon: RebarAddon) : Trans
125125
val lookupList = LocaleUtils.localeLookupList(locale)
126126
lookupList.reversed()
127127
.mapIndexed { index, value ->
128-
Locale.LanguageRange(value.toString().replace('_', '-'), (index + 1.0) / lookupList.size)
128+
Locale.LanguageRange(value.toLanguageTag(), (index + 1.0) / lookupList.size)
129129
}
130130
.sortedByDescending { it.weight }
131131
}

0 commit comments

Comments
 (0)