Skip to content
iPlugin

Internationalization (i18n) Languages

Display content based on the client's language settings

Functionality

With internationalization (i18n) language configuration, the plugin automatically loads text content in the corresponding language based on the player's client language settings. If there is no matching i18n file for the player's client language, the plugin will automatically use the default text from the original quest or conversation files to ensure normal content display.

Important Note

Quests, Conversations, and Quest Groups all support nested directory configuration

The structure of i18n files (under the quest, conversation, and group directories in core/lang) can be set freely, and does not need to strictly match the nested structure of the original function files.

Directory Structure

I18n language configuration files use core directory mapping corresponding to the original function files for easy maintenance and identification. Configurations for quests, conversations, quest groups, etc., all support nested directories. The directory structure of the corresponding i18n files can be set freely and does not need to strictly match the nested structure of the original function files. You can create subdirectories under these directories to classify configuration files.

Core Directory

en_US.yml
zh_TW.yml
en_US.yml
zh_TW.yml
en_US.yml
zh_TW.yml
en_US.yml
zh_TW.yml
en_US.yml
zh_TW.yml
  • Language Code Standard: Refer to the Minecraft Wiki language code standard (e.g., en_US for English, zh_CN for Simplified Chinese).
  • Core Directory Mapping Rules:
    • All i18n files under core/lang/quest uniformly correspond to the translation of all quest configurations in the core/quest directory.
    • All i18n files under core/lang/group uniformly correspond to the translation of all quest group configurations in the core/group directory.
    • All i18n files under core/lang/conversation uniformly correspond to the translation of all conversation configurations in the core/conversation directory.
    • core/lang/navigate corresponds to the translation of core/module/navigate.yml.
    • core/lang/scoreboard corresponds to the translation of core/module/scoreboard.yml.

Quest Module

I18n files are named by language (e.g., en_US.yml for American English). The translated content in these files will automatically override the corresponding text in the original quest configuration. This works normally regardless of whether the i18n file is placed in a subdirectory or not.

I18n Configuration File (Root Directory Example)

core/lang/quest/en_US.yml
# The root node of the file must be "quest", and the ID must match the original quest ID
quest:
  example_1:
    meta:
      name: "Test Quest"
    objective:
      1:
        agent:
          track:
            action: |
              tell "Go go go, complete the quest!"
            navigate:
              title: "Mine"
          complete: |
            title color "&a! &fCompleted Objective"
            subtitle "First step as a miner"
            by 10 40 10
      2:
        agent:
          complete: |
            tell "Completed digging 5 Grass Blocks"
    addon:
      display:
        - "&rObjective:"
        - "&7- Mine Stone Blocks {progress_1}/2 {is_complete_1}"
        - "&7- Mine Grass Blocks {progress_2}/5 {is_complete_2}"
    trigger:
      accept: |
        tell color "&a&l! &rAccept Quest"
      complete: |
        tell color "&a&l! &rQuest Completed"
      timeout: |
        tell color "&c&l! &rQuest Timed Out"

I18n Configuration File (Subdirectory Example)

core/lang/quest/daily_quests/en_US.yml
# Files in subdirectories also take effect; the root node remains "quest", and the ID must match the original quest ID
quest:
  daily_mine:
    meta:
      name: "Daily Mining Quest"
    objective:
      1:
        agent:
          complete: |
            tell "Dig 10 Stone Blocks to finish!"
    trigger:
      complete: |
        tell color "&a&l! &rDaily Quest Cleared!"

Quest Group Module

I18n files are named by language (e.g., en_US.yml for American English). The translated content in these files will automatically override the corresponding text in the original quest group configuration. This works normally regardless of whether the i18n file is placed in a subdirectory or not.

core/lang/group/en_US.yml
# The root node of the file must be "group", and the ID must match the original quest group ID
group:
  test:
    meta:
      name: "Test Category"
  daily_group:
    meta:
      name: "Daily Quests Category"

Conversation Module

I18n files for the conversation module are translated based on conversation IDs, including conversation text, option text, and NPC names. This works normally regardless of whether the i18n file is placed in a subdirectory or not.

core/lang/conversation/npc_shop/en_US.yml
# Files in subdirectories also take effect; the root node remains "conversation", and the ID must match the original conversation ID
conversation:
  shop_keeper:
    name: "Shop Owner"
    content:
      - "Welcome to my shop, {{ player name }}! Need any tools?"
    answer:
      0:
        text: "Show me your pickaxes!"
        action: |
          tell "Here are all pickaxes in stock!"
      1:
        text: "How much is this sword?"
        action: |
          tell "This iron sword costs 50 coins!"

Internationalization for the navigation module mainly targets hologram text. The content list in the i18n file will automatically override the same-named list in the original navigation configuration.

core/lang/navigate/en_US.yml
# The root node must be "navigate", corresponding to the original navigation theme
navigate:
  hologram:
    content:
      - "&6Navigation Tracking"
      - "&a{name} &7- &a{title}"
      - "&f({distance}m)"

Scoreboard Module

Internationalization for the scoreboard mainly involves translating titles and fixed text.

core/lang/scoreboard/en_US.yml
# The root node must be "scoreboard", corresponding to the original scoreboard content
scoreboard:
  content:
    - "&6&lTracking Quest"
    - ""
    - "  &a{name}"
    - "  {ui_display}"
    - ""