Skip to content

File Organization

Vitor Albert edited this page Mar 6, 2026 · 1 revision

πŸ“ File Organization & Best Practices

Recommendation: Use multi-folders to organize your language files!

Root Files (Legacy/Simple)

Files directly inside the language folder (e.g., langs/pt_br/messages.yml) do NOT use the filename as a prefix.

  • Key welcome in messages.yml β†’ %lang_welcome%
  • ⚠️ Warning: If two root files have the same key welcome, they will conflict!

Multi-Folders (Recommended)

Files inside subfolders use the folder and filename as a prefix. This prevents conflicts and keeps things organized.

  • File: langs/pt_br/menus/main.yml
  • Key: title
  • Placeholder: %lang_menus.main_title% (Format: folder.filename_key)

Example Structure

plugins/IGLanguages/langs/
β”œβ”€β”€ en_us/
β”‚   β”œβ”€β”€ example.yml              β†’ %lang_keyname%
β”‚   β”œβ”€β”€ menus/
β”‚   β”‚   └── main.yml             β†’ %lang_menus.main_keyname%
β”‚   └── messages/
β”‚       └── system.yml           β†’ %lang_messages.system_keyname%
β”œβ”€β”€ pt_br/
β”‚   β”œβ”€β”€ example.yml
β”‚   β”œβ”€β”€ menus/
β”‚   β”‚   └── main.yml
β”‚   └── messages/
β”‚       └── system.yml
└── th_th/
    └── example.yml

Key Resolution Rules

File Location Key in YAML Resulting Placeholder
langs/en_us/example.yml welcome %lang_welcome%
langs/en_us/menus/main.yml title %lang_menus.main_title%
langs/en_us/messages/system.yml greeting %lang_messages.system_greeting%
langs/en_us/systems/board.yml money %lang_systems.board_money%

Tip: All keys are case-insensitive. %lang_Welcome% and %lang_welcome% resolve to the same translation.


Next: Examples

Clone this wiki locally