Allow using different translations.

This commit is contained in:
Benjamin A. Shelton 2026-10-14 15:37:21 -06:00
commit 195d58165a
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -24,8 +24,18 @@ type verse struct {
func (m *verse) AddVerse(ctx context.Context, cmd *cli.Command) error {
logger := logging.Get("commands")
logger.SetFormat("verse add: {{message}}")
format := cmd.String("format")
_ = format
logger.SetLevel(logging.Info)
tn := strings.ToLower(cmd.String("translation"))
switch tn {
case "bsb":
logger.Info("using translation: BSB")
case "kjv":
logger.Info("using translation: KJV")
default:
logger.Warning("invalid translation:", tn)
return nil
}
tnfs := m.fs.Clone()
if err := tnfs.Chdir("data"); err != nil {
@ -51,11 +61,11 @@ func (m *verse) AddVerse(ctx context.Context, cmd *cli.Command) error {
VerseStop: ref.Verses.Stop,
}
tn, err := bible.LoadTranslations(tnfs)
txn, err := bible.LoadTranslations(tnfs)
if err != nil {
return err
}
bbl, err := tn.OpenBible("bsb")
bbl, err := txn.OpenBible(tn)
if err != nil {
return err
}