Package-level declarations

Types

Link copied to clipboard
@CacheableTask
abstract class GenerateI18nTask : DefaultTask

Gradle task that generates type-safe Kotlin classes from JSON translation files.

Link copied to clipboard
abstract class I18nGeneratorConfig @Inject constructor(val name: String, objects: ObjectFactory)

Configuration block for a single translation generator.

Link copied to clipboard
class I18nPlugin : Plugin<Project>

The entry point for the Octavius I18n Gradle plugin.

Link copied to clipboard
abstract class OctaviusI18nExtension @Inject constructor(objects: ObjectFactory)

Main Gradle extension for configuring the Octavius I18n plugin.

Link copied to clipboard
internal sealed class TranslationEntry

Represents the type of a translation entry in JSON.

Link copied to clipboard
internal class TrGenerator(packageName: String, objectName: String)

Generates the main Tr.kt file with registry and type-safe accessors.

Properties

Link copied to clipboard
internal val PARAM_REGEX: Regex

Matches positional placeholders such as {0}, {1} inside a translation template.

Link copied to clipboard
internal val PLURAL_KEYS: Set<String>

JSON object keys recognized as plural form suffixes (e.g. _one, _few).

Functions

Link copied to clipboard
internal fun escapeName(name: String): String

Escapes the name if it is a Kotlin keyword.

Link copied to clipboard
internal fun isKotlinKeyword(name: String): Boolean

Checks if the name is a reserved Kotlin keyword.

Link copied to clipboard
internal fun mergeJsonElements(target: MutableMap<String, JsonElement>, source: JsonObject)

Recursively merges source into target in place. Nested JSON objects are merged key by key instead of being replaced wholesale, so translations split across multiple files can contribute to the same nested structure.

Link copied to clipboard
internal fun toCamelCase(input: String): String

Converts a string to camelCase (first letter lowercase).

Link copied to clipboard
internal fun toPascalCase(input: String): String

Converts snake_case or kebab-case to PascalCase.