We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example:
locales/en-US.yml en-US: demo: hi: "hello"
locales/ru-RU.yml ru-RU: demo: hi: "привет"
main.go package main import ( "fmt" "github.com/qor/i18n" "github.com/qor/i18n/backends/yaml" ) func main() { I18n := i18n.New(yaml.New("locales")) I18n.FallbackLocales = map[string][]string{"ru-RU": []string{"fr-FR", "de-DE", "zh-CN"}} fmt.Printf("%v\n", I18n.T("en-US", "demo.hi")) fmt.Printf("%v\n", I18n.T("ru-RU", "demo.hi")) fmt.Printf("%v\n", I18n.T("zh-CN", "demo.hi")) }
Output:
go run main.go hello привет hello
According to documentation i should see in the last line translation from locales/ru-RU.yml but I see from default locales/en-US.yml.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example:
Output:
According to documentation i should see in the last line translation from locales/ru-RU.yml but I see from default locales/en-US.yml.
The text was updated successfully, but these errors were encountered: