Package ai.tock.translator
Interface I18nDAO
-
- All Implemented Interfaces:
public interface I18nDAOI18n storage.
-
-
Method Summary
Modifier and Type Method Description abstract UnitlistenI18n(Function1<Id<I18nLabel>, Unit> listener)Listen all i18n changes. abstract List<I18nLabel>getLabels(String namespace, I18nLabelFilter filter)Gets all labels for the specified namespace with filters abstract I18nLabelgetLabelById(Id<I18nLabel> id)Gets label by id. abstract Unitsave(I18nLabelContract label)Saves label. abstract Unitsave(List<I18nLabelContract> i18n)Saves all specified labels. abstract UnitsaveIfNotExist(List<I18nLabelContract> i18n)Saves all labels that does not exist yet. abstract UnitdeleteByNamespaceAndId(String namespace, Id<I18nLabel> id)Delete the label of specified id if and only if it has the specified namespace. abstract UnitaddAlternativeIndex(I18nLabel label, I18nLocalizedLabel localized, Integer alternativeIndex, String contextId)Marks an alternative index as used, for the given localized label and context identifier. abstract UnitdeleteAlternativeIndexes(I18nLabel label, I18nLocalizedLabel localized, String contextId)Removes all alternative indexes for the given localized label and context identifier. abstract Set<Integer>getAlternativeIndexes(I18nLabel label, I18nLocalizedLabel localized, String contextId)Gets all current alternative indexes for the given localized label and context identifier. abstract UnitincrementLabelStat(I18nLabelStat stat)Increments I18nLabelStat usage. abstract List<I18nLabelStat>getLabelStats(String namespace)Gets all label stats for the specified namespace. abstract Set<Id<I18nLabel>>getLabelIdsFromStats(String namespace, Instant timeMarker)Gets all label stats for the specified namespace. -
-
Method Detail
-
listenI18n
abstract Unit listenI18n(Function1<Id<I18nLabel>, Unit> listener)
Listen all i18n changes.
-
getLabels
abstract List<I18nLabel> getLabels(String namespace, I18nLabelFilter filter)
Gets all labels for the specified namespace with filters
-
getLabelById
abstract I18nLabel getLabelById(Id<I18nLabel> id)
Gets label by id.
-
save
abstract Unit save(I18nLabelContract label)
Saves label.
-
save
abstract Unit save(List<I18nLabelContract> i18n)
Saves all specified labels.
-
saveIfNotExist
abstract Unit saveIfNotExist(List<I18nLabelContract> i18n)
Saves all labels that does not exist yet.
-
deleteByNamespaceAndId
abstract Unit deleteByNamespaceAndId(String namespace, Id<I18nLabel> id)
Delete the label of specified id if and only if it has the specified namespace.
-
addAlternativeIndex
abstract Unit addAlternativeIndex(I18nLabel label, I18nLocalizedLabel localized, Integer alternativeIndex, String contextId)
Marks an alternative index as used, for the given localized label and context identifier.
-
deleteAlternativeIndexes
abstract Unit deleteAlternativeIndexes(I18nLabel label, I18nLocalizedLabel localized, String contextId)
Removes all alternative indexes for the given localized label and context identifier.
-
getAlternativeIndexes
abstract Set<Integer> getAlternativeIndexes(I18nLabel label, I18nLocalizedLabel localized, String contextId)
Gets all current alternative indexes for the given localized label and context identifier.
-
incrementLabelStat
abstract Unit incrementLabelStat(I18nLabelStat stat)
Increments I18nLabelStat usage.
-
getLabelStats
abstract List<I18nLabelStat> getLabelStats(String namespace)
Gets all label stats for the specified namespace.
-
getLabelIdsFromStats
abstract Set<Id<I18nLabel>> getLabelIdsFromStats(String namespace, Instant timeMarker)
Gets all label stats for the specified namespace.
-
-
-
-