Bug #4105
closedCB does not load language files at needed locations
Description
CB is oddly loading language strings at incorrect locations. For example CB Password Strength with nothing else installed is not being translated on frontend profile edit and registration. This plugin uses the onAftergetFieldRow trigger and there's no reason for language plugins to not be loaded by then.
Updated by krileon over 11 years ago
Suggest to place the below.
if ( $_CB_framework->getUi() == 1 ) {
cbimport( 'language.front' );
} else {
cbimport( 'language.all' );
}
At the bottom of the foundation file to ensure lang files are always loaded.
Updated by krileon over 11 years ago
Backend ends up loading frontend with the proposal due to UI not being set yet. Maybe implement a global var or something that is set before including the foundation so UI can be set before language is included?
Updated by krileon over 11 years ago
Fixed with the following.
@if ( $cmsUi !== null ) {
$_CB_framework->cbset( '_ui', $cmsUi );
}
if ( $cmsUi === 1 ) {
cbimport( 'language.front' );
cbimport( 'language.cbteamplugins' );
} else {
cbimport( 'language.front' );
cbimport( 'language.cbteamplugins' );
cbimport( 'language.admin' );
}
@
$cmsUi is set within each CMS switch case. Existing usages do not need to be changed as there is caching in cbimport to prevent duplicate loading.
Updated by krileon over 11 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100