SkaDate / Oxwall : what is “ language text key ” ?

Language text key is a unique ID given to each piece of text (site content) within the source code.

How text keys look like in SkaDate and Oxwall?

Admin panel interface example: {text key=’admin+admin_dashboard’} :

text keys example in oxwall / skadate

PHP file example: text(‘admin’, ‘admin_dashboard’); :

source code text key example in oxwall skadate

HTML file example: {text key=”admin+splash_screen_section_label”}:

using text keys in htm code oxwall skadat

Text key strucutre.

Text key consists of three parts:
1. Associated plugin prefix. Indicates which plugin/feature is responsible for this key.
2. Actual unique text key.
3. Text key value.

In our example: {text key=’admin+admin_dashboard‘}
1. ‘admin‘ – is a plugin prefix.
2. ‘admin_dashboard‘ – actual unique text key.
3. On front end users will see this text key as simple “Dashboard” text. Which is text key value.

Following prefixes belong to system features:
admin – prefix of all text keys used within core platform’s admin panel.
base – prefix of all text keys used within core platform’s front end.
mobile – prefix of all text keys used within core platform’s mobile version.

Here are couple of other examples.

{text key=’base+widgets_admin_dashboard_heading’}
{text key=’mobile+widgets_admin_dashboard_heading’}
{text key=’photo+album_description’}
{text key=’googlelocation+events_widget_label’}

Visually plugin prefix in Admin panel >> Settings >> Languages plugin prefix is connected to actual text key via “+” sign. Ex: {text key=’admin+admin_dashboard’}

Within the source code prefix and key itself are separated by “,” ( comma). Ex: text(‘admin’, ‘admin_dashboard’);

Where text keys are stored at in SkaDate and Oxwall software?

Text keys and their values are stored in following database table: ow_base_language_key

For performance optimization, SkaDate and Oxwall also store “cached” version of all keys for daily routine in following folder: ow_pluginfiles/base .

Language files are called lang_N.php. Where “N” represents the language ID. Example: lang_1.php or lang_32.php . Where 1 is the ID of, for example, English language and 32 is ID of French one.

Be aware that those files are just “cached” version of actual keys from the database. Therefore never edit those files.

Why SkaDate and Oxwall use text keys?

1.To keep actual product code nice and clean. Imagine every single text on your site being added directly to .html and .php file. Those files would have been huge and simply a mess.

2. To allow site admin easily edit text key values from admin panel. Imagine that to change one phrase you would have had to find corresponding .php or .html files and edit the text there.

3. To save text values even after updates. As you might already know, updates erase any custom code modifications. Since only text keys ( not their values) are used within the source code, your custom text key values won’t be erased by an update.

4. Last but not least. To allow having a multilingual websites. Same text key can be translated into as many languages as you wish.

Related posts:

Creating custom meta description text key for index page

3 thoughts on “SkaDate / Oxwall : what is “ language text key ” ?

Leave a comment