GetText function

Parameters:

  • lang string
  • name string

Returns:

  • string
Show/Hide Function Body
{
	content, err := os.ReadFile(fmt.Sprintf("lang/%s/%s", lang, name))
	if err != nil {
		log.Println("FATAL! Can't get translation file!")
		log.Fatal(err)
	}
	return string(content)
}

fmt import

Import example:

import "fmt"

log import

Import example:

import "log"

os import

Import example:

import "os"