- The compiled binary translation files cannot be larger than 4GB
- Translations:
- YAML and JSON files must be valid utf8
- A translation string cannot be larger than 64KB unless
global_settings.AllowBigStrings
is true - A Translation ID cannot be larger than 64KB
- A Namespace name cannot be longer than 255 bytes
- Variables:
- Names cannot be longer than 255 bytes
- Cannot have more than 255 variables per translation string
- Printf format specifiers numbers cannot be larger than 255
- Plural function Operators:
- Numbers following operators can be between 0 and 255
- The second number of the Between operator can be at most 63 higher than the first number
- There cannot be more than 255 operators on a translation
These limits have been introduced to protect systems from badly formed translation files, but they can be changed in the source code
- The total length of all the translation strings together is capped at 3.5GB
- The total number of Plural function operators is capped at 1 million
- The total number of namespaces is capped at 1,000
- The total number of translations is capped at 1 million
- The total length of all the translation IDs together is capped at 32MB
- The total length of all the namespace names together is capped at 1MB
- Embedded Static Translations cannot recurse more than 100 times
- When building with this library:
- If you include
-tags gol10n_read_compiled_only
, then only the functionality to read compiled files is included. This cuts 100KB-150KB from your executable. - If you include
-ldflags "-s"
this will decrease your executable size by stripping the symbol table.
- If you include
- Make sure files are ran through gofmt -s before submitting pull requests. I’m trying to keep the at 100%.
- This project is licensed under the 3-clause BSD