MetaPhrase

An open source translation editor for native mobile app localization.

View project on GitHub

//MetaPhrase/com.github.diegoberaldin.metaphrase.domain.project.repository/SegmentRepository

SegmentRepository

[jvm]
interface SegmentRepository

Contract for the segment repository.

Functions

Name Summary
create [jvm]
abstract suspend fun create(model: SegmentModel, languageId: Int): Int
Create a new segment.
createBatch [jvm]
abstract suspend fun createBatch(models: List<SegmentModel>, languageId: Int)
Create multiple segments in a single transaction.
delete [jvm]
abstract suspend fun delete(model: SegmentModel)
Delete a segment.
getAll [jvm]
abstract suspend fun getAll(languageId: Int): List<SegmentModel>
Get all segments for a given language within a given project.
getById [jvm]
abstract suspend fun getById(id: Int): SegmentModel?
Get a segment by its ID.
getByKey [jvm]
abstract suspend fun getByKey(key: String, languageId: Int): SegmentModel?
Get a segment by its key.
getUntranslatable [jvm]
abstract suspend fun getUntranslatable(languageId: Int): List<SegmentModel>
Get all untranslatable (source only) segments.
search [jvm]
abstract suspend fun search(languageId: Int, baseLanguageId: Int = 0, filter: TranslationUnitTypeFilter = TranslationUnitTypeFilter.ALL, search: String? = null, skip: Int = 0, limit: Int = 0): List<SegmentModel>
Get all the segments corresponding to a set of search criteria.
update [jvm]
abstract suspend fun update(model: SegmentModel)
Update a segment.