spullara / spullara/mustache.java

In Turkish locale, fields starting with the character "i" are lost

Open
#309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2k
Forks
281
PR merge metrics
No merged PRs in 30d

Description

Not repeated in other locales.
In Turkish locale, the @JvmField annotation can be used as a workaround.

Kotlin JUnit example:

data class Pizza(
    //@JvmField
    val ingredients: String,
    //@JvmField
    val sauces: String,
)

@Test
fun testMustacheInTurkishLocale() {
    Locale.setDefault(Locale("tr", "TR"))
    val factory = DefaultMustacheFactory()
    val ingredients = "cheese, pepperoni"
    val sauces = "tomato"
    val template = "pizza: ingredients: {{ingredients}}; sauces: {{sauces}}."
    val mustache = ByteArrayInputStream(template.toByteArray()).use { input ->
        factory.compile(input.bufferedReader(), "template_name")
    }
    val pizza = Pizza(ingredients, sauces)
    val actual = ByteArrayOutputStream().use { out ->
        PrintWriter(out).use { writer ->
            mustache.execute(writer, pizza)
        }
        String(out.toByteArray(), Charsets.UTF_8)
    }
    println(actual)
    val expected = "pizza: ingredients: $ingredients; sauces: $sauces."
    assertEquals(expected, actual)
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the Kotlin JUnit example with Locale.setDefault(Locale("tr", "TR")) and trace the behavior from DefaultMustacheFactory. Done means the ingredients and sauces fields render correctly in the Turkish locale without requiring @JvmField, while the existing behavior in other locales remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.