MessagesProviderViaLoadingText

abstract class MessagesProviderViaLoadingText(expectedLocale: Locale? = null) : MessagesProviderViaLoading

Loads a messages array from a text file

Format

  • Elements are split by a line starting with "^" followed by optional whitespace and a new line

  • All other "^" at beginnings of line are removed

  • If a line in a text starts with "^" and additional "^" has to be added before.

  • The first element is the locale tag, see de.comahe.i18n4k.toTag.

  • The following elements form the array of message strings.

Example

en_US
^
yes
^
no
^
Multi
Line
Text
with empty

lines
^
^^Text with a "^" at the beginning
^
Mult line
^^text with a "^" at
the beginning
^
some text
^
^
above is a null text
^

^
above is a empty text

Inheritors

MessagesProviderViaResource

Constructors

Link copied to clipboard
constructor(expectedLocale: Locale? = null)

Properties

Link copied to clipboard
open override val locale: Locale

which locale does the provider use

Link copied to clipboard
open override val size: Int

count of strings in this provider

Functions

Link copied to clipboard
open operator override fun get(index: Int): String?

get message at index