Information Translation strings are held, per language, in text files (either YAML or JSON), and compile into .gtr or .gtr.gz (gzip compressed) files.
Translations can be referenced in Go code either by an index, or a namespace and translation ID. Referencing by index is the fastest, most efficient, and what this library was built for. Indexes are stored as constants in generated Go dictionary files by namespace, and are also held in the dictionary.
See the github page for full documentation. Content Features:
- Translations are created in YAML or JSON config files
- Translations are compiled into optimized binary files for super-fast and space-efficient loading and use
- Go [enum] dictionary files are created so translations can be accessed by constant index within namespaces
- Command line interface and golang library level access are both available
- Translations can be separated into namespaces
- Typed variables inside translation strings
- Fallback languages
- Printf type formatters are available and also contain i18n outputs
- Plurality rules
- Embedded translations
Translation data and rules are stored in optimized blobs similar to how Go’s native i18n package stores its data.
Instead of trying to extract your in-source-code translations though a tool, this lets you handle them manually. I find that keeping translation strings outside of source files and instead using constants is much cleaner.
Gol10n is available under the same style of BSD license as the Go language, which can be found in the LICENSE file. ConceptsInternationalization, LocalizationUpdatesGol10n project added @ 2024-03-16 05:30:21 - Download
Gol10n is a highly space and memory optimized l10n (localization) library for Go (GoLang) pronounced “Goal Ten”. While this project was first released in December of 2023 on github and has already had 5 releases there, I’ve finally gotten around to adding it here. I don’t anticipate there being many more releases any time soon as the project is feature complete. To add comments, please go to the forum page for this project (guest comments are allowed for the Projects, Posts, and Updates Forums). Comments are owned by the user who posted them. We accept no responsibility for the contents of these comments.
|