| | 122 | |
| | 123 | == Translating splash block == |
| | 124 | |
| | 125 | '''''This manual is for Dolphin 7.1.x'''''.[[BR]] |
| | 126 | |
| | 127 | To translate the splash block, you'll need to make some code changes. These changes will affect only your current template while the base template will remain intact. |
| | 128 | |
| | 129 | 1. So, navigate to ''Admin Panel -> Settings -> Basic Settings -> Splash''. |
| | 130 | |
| | 131 | 2. Edit the HTML code so the text you wish to translate would have underscores before it (to make sure you won't translate anything you don't want to). For example: `_Join`, `_Login`, `_Welcome to the community!` |
| | 132 | |
| | 133 | 3. Open the file '''templates/base/scripts/BxBaseFunctions.php''' and copy the signature and body of the function '''genSiteSplash''': |
| | 134 | |
| | 135 | {{{ |
| | 136 | function genSiteSplash() |
| | 137 | { |
| | 138 | $sVisibility = getParam('splash_visibility'); |
| | 139 | $bLogged = getParam('splash_logged') == 'on'; |
| | 140 | |
| | 141 | if($sVisibility == BX_DOL_SPLASH_VIS_DISABLE || ($sVisibility == BX_DOL_SPLASH_VIS_INDEX && !defined('BX_INDEX_PAGE')) || ($bLogged && isLogged())) |
| | 142 | return ''; |
| | 143 | |
| | 144 | return DesignBoxContent('', getParam('splash_code'), 3); |
| | 145 | } |
| | 146 | }}} |
| | 147 | |
| | 148 | Open the file '''templates/YOUR_TMPL_NAME/scripts/BxTemplFunctions.php''' (where '''YOUR_TMPL_FOLDER''' is the folder of your current template, for example '''tmpl_alt'''). |
| | 149 | |
| | 150 | Paste the copied code after: |
| | 151 | {{{ |
| | 152 | function BxTemplFunctions() |
| | 153 | { |
| | 154 | parent::BxBaseFunctions(); |
| | 155 | } |
| | 156 | }}} |
| | 157 | |
| | 158 | Modify the pasted code this way: |
| | 159 | {{{ |
| | 160 | function genSiteSplash() |
| | 161 | { |
| | 162 | $sVisibility = getParam('splash_visibility'); |
| | 163 | $bLogged = getParam('splash_logged') == 'on'; |
| | 164 | |
| | 165 | if($sVisibility == BX_DOL_SPLASH_VIS_DISABLE || ($sVisibility == BX_DOL_SPLASH_VIS_INDEX && !defined('BX_INDEX_PAGE')) || ($bLogged && isLogged())) |
| | 166 | return ''; |
| | 167 | |
| | 168 | $result = str_replace('_Join', _t('_Join'), getParam('splash_code')); |
| | 169 | $result = str_replace('_Login', _t('_Login'), $result); |
| | 170 | $result = str_replace('_Welcome to the community!', _t('_Welcome to the community!'), $result); |
| | 171 | return DesignBoxContent('', $result, 3); |
| | 172 | } |
| | 173 | }}} |
| | 174 | |
| | 175 | Save the file. |
| | 176 | |
| | 177 | 4. Now you only need to make sure that the language keys `_Join`, `_Login` and `_Welcome to the community!` exist in the database. Navigate to ''Admin Panel -> Settings -> Language Settings'' -> enter the name of the key in the field '''Filter''', click '''Apply'''. If the key doesn't exist, create it clicking '''Add Key'''. |
| | 178 | |
| | 179 | The keys `_Join` and `_Login` are already present in the database. The key `_Welcome to the community!` should be created. |