Project

General

Profile

Actions

Bug #4105

closed

CB does not load language files at needed locations

Added by krileon over 11 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
10 July 2013
Due date:
% Done:

100%

Estimated time:

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.

https://www.joomlapolis.com/forum/153-professional-member-support/221878-solved-cb-password-strength-translation?start=6#230417

Actions #1

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.

Actions #2

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?

Actions #3

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.

Actions #4

Updated by krileon over 11 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by beat about 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF