skip to Main Content

I’m trying to translate Stardew Valley into toki pona(a constructed language), and if you want to do this you should edit a file called "AdditionalLanguages.json" The input below is the whole file after I entered:

{
    "header": {
        "target": "w",
        "formatVersion": 5,
        "hidef": true,
        "compressed": 128
    },
    "readers": [
        {
            "type": "Microsoft.Xna.Framework.Content.ListReader`1[[StardewValley.GameData.ModLanguage, StardewValley.GameData, Version=1.6.8.24119, Culture=neutral, PublicKeyToken=null]]",
            "version": 0
        },
        {
            "type": "Microsoft.Xna.Framework.Content.ReflectiveReader`1[[StardewValley.GameData.ModLanguage, StardewValley.GameData, Version=1.6.8.24119, Culture=neutral, PublicKeyToken=null]]",
            "version": 0
        },
        {
            "type": "Microsoft.Xna.Framework.Content.StringReader",
            "version": 0
        },
        {
            "type": "Microsoft.Xna.Framework.Content.BooleanReader",
            "version": 0
        },
        {
            "type": "Microsoft.Xna.Framework.Content.SingleReader",
            "version": 0
        },
        {
            "type": "Microsoft.Xna.Framework.Content.Int32Reader",
            "version": 0
        },
        {
            "type": "Microsoft.Xna.Framework.Content.DictionaryReader`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]",
            "version": 0
        }
    ],
"Content": [
    "Tokipona_Tokipona": {
        "ID": "tokipona_tokipona",
        "LanguageCode": "tp",
        "ButtonTexture": "Content/LooseSprites/LanguageButton.tp-MP.xnb",
        "UseLatinFont": false,
        "TimeFormat": "[HOURS_24_00]:[MINUTES]",
        "ClockTimeFormat": "[HOURS_24_00]:[MINUTES]",
        "ClockDateFormat": "󱥤[DAY_OF_WEEK]/󱥤[DAY_OF_MONTH]",
        "FontFile": "Content/Fonts/sitelenpona.fnt",
        "FontPixelZoom": 1.5
    }
]
}

First I was getting an error that said that I should remove the : and the { after "Tokipona_Tokipona" I tried moving some things around and then it gave me this error: Unexpected end of JSON input

Further details, I’m using a software called Xnbcli for converting my .json file to a .xnb file

EDIT:
This is the full error message I’m getting now:

SyntaxError: Unexpected token : in JSON at position 1420
    at JSON.parse (<anonymous>)
    at resolveImports (C:snapshotxnbcliappPorter.js:0:0)
    at processPack (C:snapshotxnbclixnbcli.js:0:0)
    at Walker.walker.on (C:snapshotxnbclixnbcli.js:0:0)
    at Walker.emit (events.js:198:13)
    at Object.emitSingleEvents [as emitNodeType] (C:snapshotxnbclinode_moduleswalklibnode-type-emitter.js:58:13)
    at Walker._wLstatHandler (C:snapshotxnbclinode_moduleswalklibwalk.js:88:19)
    at C:snapshotxnbclinode_moduleswalklibwalk.js:106:12
    at FSReqWrap.oncomplete (fs.js:154:5)

I also don’t get the Unexpected end of JSON input error anymore since I added the extra bracket (thanks @ajc2000)

2

Answers


  1. The file is not a valid JSON, try setting content: {...} instead of content: [...] example:

    "Content": {
        "Tokipona_Tokipona": {
            "ID": "tokipona_tokipona",
            "LanguageCode": "tp",
            "ButtonTexture": "Content/LooseSprites/LanguageButton.tp-MP.xnb",
            "UseLatinFont": false,
            "TimeFormat": "[HOURS_24_00]:[MINUTES]",
            "ClockTimeFormat": "[HOURS_24_00]:[MINUTES]",
            "ClockDateFormat": "󱥤[DAY_OF_WEEK]/󱥤[DAY_OF_MONTH]",
            "FontFile": "Content/Fonts/sitelenpona.fnt",
            "FontPixelZoom": 1.5
        }
    }
    

    if content must be an array, you cannot use a key:value inside of it, try instead:

    "Content": [
        {
            "ID": "tokipona_tokipona",
            "LanguageCode": "tp",
            "ButtonTexture": "Content/LooseSprites/LanguageButton.tp-MP.xnb",
            "UseLatinFont": false,
            "TimeFormat": "[HOURS_24_00]:[MINUTES]",
            "ClockTimeFormat": "[HOURS_24_00]:[MINUTES]",
            "ClockDateFormat": "󱥤[DAY_OF_WEEK]/󱥤[DAY_OF_MONTH]",
            "FontFile": "Content/Fonts/sitelenpona.fnt",
            "FontPixelZoom": 1.5
        }
    ]
    
    Login or Signup to reply.
  2. You need to wrap this node in curly braces

    
    "Content": [
        {"Tokipona_Tokipona": {
            "ID": "tokipona_tokipona",
            "LanguageCode": "tp",
            "ButtonTexture": "Content/LooseSprites/LanguageButton.tp-MP.xnb",
            "UseLatinFont": false,
            "TimeFormat": "[HOURS_24_00]:[MINUTES]",
            "ClockTimeFormat": "[HOURS_24_00]:[MINUTES]",
            "ClockDateFormat": "󱥤[DAY_OF_WEEK]/󱥤[DAY_OF_MONTH]",
            "FontFile": "Content/Fonts/sitelenpona.fnt",
            "FontPixelZoom": 1.5
          }
        }
    ]
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search