locales

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

README

I18N

Usage

In the source code, use the function i18n.Tr("message", ...args) to get a localized string. This tool parses the source using the go/ast package to generate the en locale using these messages.

Updating messages to reflect code changes

The following command updates the locales present in the source code to reflect addition/removal of messages.

task i18n:update

Syncing the catalog with transifex

Environment variables

Set the following environment variables according to the project

Variable Description
TRANSIFEX_PROJECT Name of the transifex project
TRANSIFEX_RESOURCE Name of the transifex translation resource
TRANSIFEX_API_KEY API Key to access the transifex project
Push
task i18n:push
Pull
task i18n:pull

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJavaToGoSyntax

func FromJavaToGoSyntax(s string) string

FromJavaToGoSyntax convert a translation string made for Java to a one suitable for golang (printf-style). The conversion transforms java placeholders like "{0}","{1}","{2}",etc... with the equivalent for golang "%[1]v","%[2]v","%[3]v",etc... A pair of adjacent single-quote characters "'" (U+0027) is replaced with one only.

func Init

func Init(configLocale string)

Init initializes the i18n module, setting the locale according to this order of preference: 1. Locale specified via the function call 2. OS Locale 3. en (default)

Types

This section is empty.

Directories

Path Synopsis
cmd
ast
po

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy