Skip to content

Commit

Permalink
group currencies when generating currency translation file
Browse files Browse the repository at this point in the history
  • Loading branch information
sal0max committed Jul 15, 2024
1 parent ede1aee commit a6f2082
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ fun main() {
<resources>
""".trimIndent()
)
var firstChar = 'a'
for (isoName in ISO_NAMES) {
try {
// group by first char
if (!isoName.first().equals(firstChar, true)) {
firstChar = isoName.first()
println()
}
// get localized currency name
val name = Currency.getInstance(isoName).getDisplayName(targetLanguage)
.replaceFirstChar { if (it.isLowerCase()) it.titlecase(targetLanguage) else it.toString() }
.replace("&", "&amp;")
Expand Down

0 comments on commit a6f2082

Please sign in to comment.