Created
March 6, 2021 02:05
-
-
Save stargazing-dino/7724ade54011b11e4129d15d295aa6fc to your computer and use it in GitHub Desktop.
The message format for ICU and arb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum ElementType { literal, argument, plural, gender, select } | |
class BaseElement { | |
final ElementType type; | |
final String value; | |
const BaseElement(this.type, this.value); | |
} | |
class Option { | |
final String name; | |
final List<BaseElement> value; | |
const Option(this.name, this.value); | |
} | |
class LiteralElement extends BaseElement { | |
const LiteralElement(String value) : super(ElementType.literal, value); | |
} | |
class ArgumentElement extends BaseElement { | |
const ArgumentElement(String value) : super(ElementType.argument, value); | |
} | |
class GenderElement extends BaseElement { | |
final List<Option> options; | |
const GenderElement(String value, this.options) : super(ElementType.gender, value); | |
} | |
class PluralElement extends BaseElement { | |
final List<Option> options; | |
const PluralElement(String value, this.options) : super(ElementType.plural, value); | |
} | |
class SelectElement extends BaseElement { | |
final List<Option> options; | |
const SelectElement(String value, this.options) : super(ElementType.select, value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment