Go JSON Free
ByCrowdinVerified Author

Localization of the go-i18n JSON files

Try Crowdin

Go JSON translation with Crowdin

Copy link

go-i18n is one of the most popular internationalization (i18n) libraries for the Go programming language. Crowdin has native support for JSON files produced by go-i18n.

The placeholder syntax can be {{ var }}, {var}, or %[1]d. Crowdin will automatically detect the most widely used variable formats, and highlight and validate them in the editor.

File Format Details

Copy link
Attribute Value
File Extension .json
API Type go_json
Source can be edited in Crowdin No
Generating translated files via Bundles Search Crowdin Store
Supports pluralization Yes
WYSIWYG Preview in the editor No
Supported types of contextual information Text comments, Screenshots, In-Context
Custom attributes No
Existing translations import possibility Key-value mapping

Sample File

Copy link
{
    "language": "en",
    "messages": [
        {
            "id": "Error",
            "message": "Error",
            "translation": "Error",
            "comment": "This is context",
            "fuzzy": true
        },
        {
            "id": "Invalid IP address",
            "message": "Invalid IP address",
            "translation": "Invalid IP address",
            "translatorComment": "Copied from source.",
            "fuzzy": true
        },
        {
            "id": "Invalid network prefix length",
            "message": "Invalid network prefix length",
            "translation": "Invalid network prefix length"
        },
        {
            "id": "Usage: {Args0} \n[{String}]",
            "message": "Usage: {Args0} \n[{String}]",
            "translation": "Usage: {Args0} \n[{String}]",
            "translatorComment": "Copied from source.",
            "placeholders": [
                {
                    "id": "Args0",
                    "string": "%[1]s",
                    "type": "string",
                    "underlyingType": "string",
                    "argNum": 1,
                    "expr": "os.Args[0]"
                },
                {
                    "id": "String",
                    "string": "%[2]s",
                    "type": "string",
                    "underlyingType": "string",
                    "argNum": 2,
                    "expr": "builder.String()"
                }
            ],
            "fuzzy": true
        },
        {
            "id": "{Years} year(s)",
            "message": "{Years} year(s)",
            "translation": {
                "select": {
                    "feature": "plural",
                    "arg": "Years",
                    "cases": {
                        "one": {
                            "msg": "{Years} year"
                        },
                        "other": {
                            "msg": "{Years} years"
                        }
                    }
                }
            },
            "placeholders": [
                {
                    "id": "Years",
                    "string": "%[1]d",
                    "type": "int64",
                    "underlyingType": "int64",
                    "argNum": 1,
                    "expr": "years"
                }
            ]
        },
        {
            "id": "{Hours} hour(s)",
            "message": "{Hours} hour(s)",
            "translation": {
                "select": {
                    "feature": "plural",
                    "arg": "Hours",
                    "cases": {
                        "one": {
                            "msg": "{Hours} hour"
                        },
                        "other": {
                            "msg": "{Hours} hours"
                        }
                    }
                }
            },
            "placeholders": [
                {
                    "id": "Hours",
                    "string": "%[1]d",
                    "type": "int64",
                    "underlyingType": "int64",
                    "argNum": 1,
                    "expr": "hours"
                }
            ]
        },
        {
            "id": "{Hours} hour(s)",
            "message": "{Hours} hour(s)",
            "translation": {
                "select": {
                    "feature": "plural",
                    "arg": "Hours",
                    "cases": {
                        "one": "{Hours} hour",
                        "other": "{Hours} hours"
                    }
                }
            },
            "placeholders": [
                {
                    "id": "Hours",
                    "string": "%[1]d",
                    "type": "int64",
                    "underlyingType": "int64",
                    "argNum": 1,
                    "expr": "hours"
                }
            ]
        }
    ]
}

Translating Go JSON

Copy link

Note: To upload Go JSON, use API or CLI specifying the localization type: “go_json”

Crowdin is a platform that helps you manage and translate content into different languages. Integrate Crowdin with your repo, CMS, or other systems. Source content is always up to date for your translators, and translated content is returned automatically.

Learn More
Categories
File Formats
Works with
  • Crowdin Enterprise
  • crowdin.com
Details

Released on May 16, 2022

Updated on Feb 23, 2024

Published by Crowdin

Identifier:go-json