How language string Works in Joomla!

Joomla takes internationalization very seriously. Because of this, even if you aren't planning on translating your component, you're still going to end up working with a few language strings. Let's take a look at them now. In this example file, we have a call to Jtext::_ and then an argument that says TPL_BEEZ2_POWERED_BY

Jtext language string in joomla

This is a language string key. If there is a value that goes along with this key in the language string file, it will use that string in place of this call. If there is no value that goes with this key, it'll simply display the key on screen, and that's how you know you're missing a language string. Sometimes Joomla uses this Jtext_function to do translations, and sometimes it just expects strings based on a certain naming convention.

So let's take a look at the language string files themselves.

Joomla Language files

In the backend of Joomla we have two different language string files; we have .ini and one that's .sys.ini. The difference is the .sys.ini file contains language strings that are specifically designed for the menu that Joomla generates that includes all of the components throughout Joomla So, Joomla will pick up the .sys.ini files, so that it doesn't have to pull the full language string files and that way, it improves performance a little bit.

A lot of these language strings are not strictly required, but the ones that I have marked here as Required in the .SYS. INI file and in the .INI file usually are.

# Required mycomponent.ini
COM_NOIDACITY_CONFIGURATION="Noida City Configuration"
COM_NOIDACITY_PLACES_N_ITEMS_TRASHED="%s places trashed"
COM_NOIDACITY_PLACES_N_ITEMS_TRASHED_1="%s place trashed."
COM_NOIDACITY_PLACES_N_ITEMS_DELETED="%s places deleted."
COM_NOIDACITY_PLACES_N_ITEMS_DELETED_1="place deleted."
COM_NOIDACITY_PLACES_N_ITEMS_PUBLISHED="%s places published."
COM_NOIDACITY_PLACES_N_ITEMS_PUBLISHED_1="place published."
COM_NOIDACITY_PLACES_N_ITEMS_UNPUBLISHED="%s places unpublished."
COM_NOIDACITY_PLACES_N_ITEMS_UNPUBLISHED_1="place unpublished."
COM_NOIDACITY_PLACES_N_ITEMS_ARCHIVED="%s places archived."
COM_NOIDACITY_PLACES_N_ITEMS_ARCHIVED_1="place archived."
COM_NOIDACITY_MALLS_N_ITEMS_TRASHED="%s malls trashed"
COM_NOIDACITY_MALLS_N_ITEMS_TRASHED_1="%s mall trashed."
COM_NOIDACITY_MALLS_N_ITEMS_DELETED="%s malls deleted."
COM_NOIDACITY_MALLS_N_ITEMS_DELETED_1="mall deleted."
COM_NOIDACITY_MALLS_N_ITEMS_PUBLISHED="%s malls published."
COM_NOIDACITY_MALLS_N_ITEMS_PUBLISHED_1="mall published."
COM_NOIDACITY_MALLS_N_ITEMS_UNPUBLISHED="%s malls unpublished."
COM_NOIDACITY_MALLS_N_ITEMS_UNPUBLISHED_1="mall unpublished."
COM_NOIDACITY_MALLS_N_ITEMS_ARCHIVED="%s malls archived."
COM_NOIDACITY_MALLS_N_ITEMS_ARCHIVED_1="mall archived."
# Required mycomponent.sys.ini
COM_NOIDACITY="Noida City"
COM_NOIDACITY_PLACES_VIEW_DEFAULT_TITLE="Places"
COM_NOIDACITY_MALLS_VIEW_DEFAULT_TITLE="Malls"
COM_NOIDACITY_MALL_VIEW_DEFAULT_TITLE="Mall Base Link"
COM_NOIDACITY_PLACE_VIEW_DEFAULT_TITLE="Place Base Link"
COM_NOIDACITY_PLACES="Places"
COM_NOIDACITY_MALLS="Malls"

And even if you're targeting your component for one language, language strings are going to be a part of your code. When you know how Joomla's! language strings work, you can take care of the required ones and plan ahead for the level of internationalization you need.