Skip to main content

Version-Aware Language String Compilation

Ensure your extensions use Joomla-native language strings that adapt to the correct version context (J3, J4, J5) during compilation.

What Is It?

Joomla's language system has evolved across versions — with new constants introduced, others deprecated, and structural changes affecting how fields, options, and labels are handled.

Joomla Component Builder (JCB) introduces version-aware language string compilation: a system that dynamically maps and generates language constants according to the version(s) your component targets.

It ensures your compiled components:

  • Avoid deprecated language constants
  • Follow Joomla's latest language practices
  • Include only the necessary strings for the specified version
  • Maintain backward compatibility when required

Key Capabilities

  • Dynamic Constant Resolution
    JCB evaluates which language strings are appropriate per Joomla version and adapts them during compile time.
  • Per-Version Overrides
    Define language constants for J3, J4, and J5 separately inside JCB’s GUI (Field, View, or Global Lang settings). The compiler picks the correct one automatically.
  • Slimmer, Cleaner Language Files
    Only the strings relevant to the compiled version are included — avoiding unnecessary constants in the final .ini files.
  • Automatic Migration Hints
    If a J3 string is no longer valid in J4 or J5, JCB warns you and offers default mappings to current constants.

Used In:

  • Field labels, descriptions, options
  • View titles and menu entries
  • Toolbar buttons and permission strings
  • Snippets and templates that output translatable strings

How It Works in JCB

  • When building a field, view, or admin UI, define your translatable labels with a Language Key (e.g., <?php echo Text::_('Text'); ?> ).
  • Use the Language Translation to define the linked Entity of that key.
  • In the component configuration, set the target Joomla version.
  • On compile, JCB uses the appropriate language block for that version and generates a correct Languge file.
  • You can also export/import all language strings via Excel spreadsheets.

Benefits

  • Clean, compatible language across Joomla versions
  • Automatic pruning of obsolete/deprecated keys
  • Full control over wording based on platform context
  • Less need for language overrides after installation
  • Export/import-friendly via Excel workflow

Tips

  • Use descriptive language keys early in your project (don't hard-code values).
  • Maintain J3/J4/J5 language variations only when truly necessary.
  • Use JCB's "Language Reference Table" to audit usage and catch duplicates.
  • Avoid defining unnecessary strings for versions you don't compile for.

Summary

Version-aware language compilation in JCB guarantees your components stay up-to-date with Joomla's evolving language system — making multilingual support clean, future-proof, and contextually correct per version.