Skip to content

<div style="display: none;" hidden="true" aria-hidden="true">Are you an LLM? You can read better optimized documentation at /guides/LangFiles.md for this page in Markdown format</div>

Home | Changelog

#Lang files

MUI is still in specs so expect updates (more steps and changes on undelivered steps)

Step 1

Step 1 was to set all client having same lang core files

Theme/front lang files now are ecommercen/language/xxxx/adv_theme_lang.php and application/language/xxxx/default_theme_lang.php Admin lang files are ecommercen/language/xxxx/adv_advisable_lang.php and application/language/xxxx/advisable_lang.php

We introduce an extra file in this release not yet loaded (oups) which will contain lang files that are not tied to ui. Example values would be ie for sms or email.

Core lang is loaded before application lang, so it's values can be easily overridden

The reason of having it in an array is to prevent duplicate keys hard to catch from editors caused by reassignments, plus as a bonus it allows empty array $lang = []; without a key due to the lang loader of codeigniter.

Lang file format is (same thing for front, admin and external):

php
$lang = [
    // this client
];

The comment // this client separates overrides from extra keys. We set the ones we override above, and the ones that are extra for this client below the comment.

Step 2

We removed existing keys from core adv_theme_lang and adv_advisable_lang.

All adv_theme_lang keys that were deleted are in keysNotFoundInAdvThemeLang and keysNotFoundInAdvThemeLangEnglish snippets and all from adv_advisable_lang are
in adminLangKeysRemoved and adminLangKeysRemovedEn snippets, in case they are needed.

New language file ecommercen/languages/xxx/adv_external_lang.php to keep keys for mail, sms, and other non web values. This file shouldn't be used for core keys or keys used in web views as it will not be available until requested on demand.

for now it is loaded in base controller but in future it will be loaded on demand from the class that needs it

Core theme and admin language files have keys grouped per view file, and a global/shared section that for keys that are used in

For clients when changing a value's key we should check if it is in shared/global section in order to determine what it affects

Step 3

  1. Fix theme and admin lang files missing keys
  2. Fix language files' loading

Regarding loading fix:

  • base controller loads nothing
  • front controller loads theme
  • admin controller loads advisable
  • whoever needs to send sms and email loads external language

to ensure that we can send from a single instance more than one language translations for emails or sms get the translations as a return value, so we can swipe languages. More info on this will when it is implemented in changelog notes

Step 4

Optional steps (not yet discussed)

make some keys based on their context shared and remove multiple key values for same domain object

Step 5

We will introduce new keys and remove existing ones.

Some will take param from t(), others might be moved to external lang file, other might need to be subcontent (with or without mark up)

.....