Jump to content

Localization for PopUps

Pending 1.1.3

IsraRust
IsraRust

Posted

hello all! Im using only serverpanelpopups. How can I  add localization files for popups (Without UI)? 
exsample part of config file to localize:

"Text": [
                "Welcome to <color=#f54242>Rust</color><color=#f5ef42>a</color><color=#45f542>Man</color> X5 server",
                "",
                "Rates - Gather X5 | Loot X5 | Crafting time 50% | Stack Size X5 | Recycler Speed 50%.",
                "",
                "Map Size - 4250. <color=#f54242>Rust</color><color=#f5ef42>a</color><color=#45f542>Man</color> Generated, All Monuments.",
                "Blueprints Wipe & Map Wipe - Monthly at First Thusday of each Month.",
                "",
                "Enjoy, Play and become a part of Our community.",
                "Play Like a Honored Ruster.",
                "Join our Discord and Stay Tuned, find team mates - <color=#92cbd6>discord.gg/gYEWcyTpga</color>",
                "VIP Players gets more! Become VIP at <color=#92cbd6>rustaman.com</color>"
              ],

 

Mevent

Posted

  1. Locate the Localization File:
    The file is located at: oxide/data/ServerPanelPopUps/Localization.json
  2. File Structure:
    The file is structured as an object named Localization Settings containing a section called UI Elements. Each key in this section corresponds to the Name field from the "Content Elements" config section. For example, PopUp.ServerCommands.Description is the identifier for that element.
  3. Setting Up Localization:
    Inside each UI element, there is a Messages object where translations for each language are defined. For each language (e.g., "fr" for French or "en" for English), an array of strings is provided under the key Text. These strings will be displayed in the popup.

    Example: 
    {
      "Localization Settings": {
        "UI Elements": {
          "PopUp.ServerCommands.Description": {
            "Messages": {
              "fr": {
                "Text": [
                  "<color=#CF432D>/info</color> - ouvrir ce menu",
                  "<color=#CF432D>/trade player_name</color> - échange sécurisé avec d'autres joueurs",
                  "<color=#CF432D>/online</color> - afficher le nombre de joueurs en ligne"
                ]
              },
              "en": {
                "Text": [
                  "<color=#CF432D>/info</color> - open this menu",
                  "<color=#CF432D>/trade player_name</color> - safe trading",
                  "<color=#CF432D>/online</color> - show online players count"
                ]
              }
            }
          }
        }
      }
    }

     

 
  • Like 1
IsraRust

Posted

Thank you for yore quick and comprehensive answer! 
so, can I leave text field empty in configuration file and all texts write in localization file?

1.6m

Downloads

Total number of downloads.

7.7k

Customers

Total customers served.

115.3k

Files Sold

Total number of files sold.

2.3m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.