Quote from: Everett at Apr 29, 2010, 05:09 PM
So the settings_ prefix is special in the world of _lang keys... but what exactly does it do?
And the _desc suffix is also special, yes? But what exactly does it do?
Yes, it’s special in the sense that when the Settings grids (system,context,user) encounter a Setting that has a namespace other than ’core’, they attempt to:
- Load the ’namespace:default’ topic.
- If loaded, then look for the setting with key: ’setting_[key]’ for the name, and ’setting_[key]_desc’ for the description.
So, if you had a Setting with a key of ’myextra.use_secure’, then it would:
- Attempt to load the ’myextra:default’ topic
- If loaded, look for Lexicon Entries with keys:
-- ’setting_myextra.use_secure’ for the translation of the name of the setting
-- ’setting_myextra.use_secure_desc’ for the translation of the description of the setting
So really, we’re talking about something like
$_lang[ $key ] = ’Translations’;
Where:
$key = ’optional special_ prefix’ . ’optional-component-name.’ . ’lexicon_key’;
Is that correct?
No, wait. 99% of custom lexicon entries should be: $_lang[’comp_prefix.entry_key’];
The only special ones are ones that deal with Settings.