© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
FridgePirate

❔ How can I read data from file called lang.json

using System;
using System.Collections.Generic;
using CitizenFX.Core;
using Newtonsoft.Json;
using static CitizenFX.Core.Native.API;

namespace QBCore_family
{
    public class FamilyServer : BaseScript
    {
        public FamilyServer()
        {
            RegisterCommand("setmother", new Action<int, List<object>, string>(SetMotherCommand), false);
        }

        private void SetMotherCommand(int source, List<object> args, string raw)
        {
            TriggerClientEvent("chat:addMessage", new
            {
                color = new[] { 255, 0, 0 },
                args = new[] { "[CarSpawner]", "Heller!" }
            });

        }
    }
}
using System;
using System.Collections.Generic;
using CitizenFX.Core;
using Newtonsoft.Json;
using static CitizenFX.Core.Native.API;

namespace QBCore_family
{
    public class FamilyServer : BaseScript
    {
        public FamilyServer()
        {
            RegisterCommand("setmother", new Action<int, List<object>, string>(SetMotherCommand), false);
        }

        private void SetMotherCommand(int source, List<object> args, string raw)
        {
            TriggerClientEvent("chat:addMessage", new
            {
                color = new[] { 255, 0, 0 },
                args = new[] { "[CarSpawner]", "Heller!" }
            });

        }
    }
}


I want to replace "Heller!" with "welcome" from:

Config = {}

Config.defaultlocale = "en" // default locale

Config.Locale = {
  "en": {
    "welcome": "Welcome to the server!",
    "farewell": "Goodbye, see you later!",
    "player_join": "{player} has joined the server."
  },
  "es": {
    "welcome": "¡Bienvenido al servidor!",
    "farewell": "¡Adiós, hasta luego!",
    "player_join": "{player} se ha unido al servidor."
  }
}
Config = {}

Config.defaultlocale = "en" // default locale

Config.Locale = {
  "en": {
    "welcome": "Welcome to the server!",
    "farewell": "Goodbye, see you later!",
    "player_join": "{player} has joined the server."
  },
  "es": {
    "welcome": "¡Bienvenido al servidor!",
    "farewell": "¡Adiós, hasta luego!",
    "player_join": "{player} se ha unido al servidor."
  }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Removing JSON data from JSON File
C#CC# / help
4y ago
❔ How can I import json file inside a sass file?
C#CC# / help
3y ago
❔ How to read json api data from remote server that uses paging?
C#CC# / help
4y ago