All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.phraseapp.internal.xml.Models.kt Maven / Gradle / Ivy

The newest version!
package phraseapp.internal.xml

interface Translation {
    fun accept(visitor: Visitor)
}

interface StringsTranslationNode: Translation {
    val key: String
    val comment: CommentTranslation
    val translatable: Boolean
}

data class Resource(val strings: List) : Translation {
    override fun accept(visitor: Visitor) {
        visitor.visit(this)
    }
}

data class StringTranslation(
    override val key: String,
    val value: String,
    override val comment: CommentTranslation = CommentTranslation(""),
    override val translatable: Boolean = true
) : StringsTranslationNode {
    override fun accept(visitor: Visitor) {
        visitor.visit(this)
    }
}

data class StringsArrayTranslation(
    override val key: String,
    val values: List,
    override val comment: CommentTranslation = CommentTranslation(""),
    override val translatable: Boolean = true
) : StringsTranslationNode {
    override fun accept(visitor: Visitor) {
        visitor.visit(this)
    }
}

data class PluralsTranslation(
    override val key: String,
    val plurals: List,
    override val comment: CommentTranslation = CommentTranslation(""),
    override val translatable: Boolean = true
) : StringsTranslationNode {
    override fun accept(visitor: Visitor) {
        visitor.visit(this)
    }
}

data class CommentTranslation(val text: String) : Translation {
    override fun accept(visitor: Visitor) {
        visitor.visit(this)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy