fn(text$0, language$1) =>
match @std.string-starts-with(value: $0, prefix: "(") {
false =>
match @core.equal(left: $1, right: "en") {
true =>
$0,
false =>
""
},
true =>
let padded$2 = @core.string-concat(left: " ", right: $0);
let at$3 = @core.string-index-of(text: $2, target: @core.string-join(items: [" (", $1, ") "], separator: ""), start: 0);
match @core.less-than(left: $3, right: 0) {
true =>
"",
false =>
let from$4 = @core.plus(left: $3, right: 6);
let next$5 = @html-ui.min-found(
a: @core.string-index-of(text: $2, target: " (en) ", start: $4),
b: @html-ui.min-found(
a: @core.string-index-of(text: $2, target: " (ja) ", start: $4),
b: @core.string-index-of(text: $2, target: " (eo) ", start: $4)
)
);
@core.string-slice(
value: $2,
start: $4,
end: match @core.less-than(left: $5, right: 0) {
true =>
@core.string-length(value: $2),
false =>
$5
}
)
}
}