Skip to content
New issue

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

Translate project #14

Open
kerunaru opened this issue Nov 27, 2023 · 1 comment
Open

Translate project #14

kerunaru opened this issue Nov 27, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@kerunaru
Copy link
Member

English translation of comments, documentation, and literal strings

@kerunaru kerunaru added the enhancement New feature or request label Nov 27, 2023
@jaimeph jaimeph added this to the Release 1.0.0 milestone Sep 3, 2024
@sergiotejon
Copy link
Contributor

I believe that this application has been completely translated into English. Would we like to translate it into other languages, for example, using go-i18n library?...

package main

import (
    "fmt"
    "github.com/nicksnyder/go-i18n/v2/i18n"
    "golang.org/x/text/language"
)

func main() {
    bundle := i18n.NewBundle(language.English)
    bundle.LoadMessageFile("es.json") // Carga un archivo de traducción en español.

    localizer := i18n.NewLocalizer(bundle, "es")
    message, _ := localizer.Localize(&i18n.LocalizeConfig{
        MessageID: "HelloWorld",
    })

    fmt.Println(message) // Imprime el mensaje traducido.
}

es.json:

{
  "HelloWorld": "Hola Mundo"
}

If not, I think this issue could be closed. @jaimeph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants