czcorpus / cnc-masm

Manatee Assets, Services and Metadata - a complementary service for KonText
Other
2 stars 1 forks source link

Replace misc. general functions with the ones from the cnc-gokit #67

Closed tomachalek closed 6 months ago

tomachalek commented 1 year ago

General rules:

  1. In case a function from a general package is not in cnc-gokit, move it there and upgrade cnc-gokit.
  2. In case a local function is slightly different than the cnc-gokit one, then upgrade local code (i.e. avoit modifying cnc-gokit as much as possible)

Namely:

tomachalek commented 1 year ago

A note to the EmailNotification: To keep custom methods (e.g. DefaultSignature()) without moving them to the cnc-gokit too, please use a wrapping struct:

type EmailNotification struct {
    Wrapped mail.NotificationConf
}

func (enConf EmailNotification) DefaultSignature(lang string) string {
    if lang == "cs" || lang == "cs-CZ" {
        return "Váš CNC-MASM"
    }
    return "Your CNC-MASM"
}

// etc.

Once an instance of mail.NotificationConf is needed, you can just use myInst.Wrapped.

tomachalek commented 6 months ago

Already fixed