Changeset 165415
- Timestamp:
- 10/21/2009 08:05:54 AM (16 years ago)
- Location:
- cache-translation-object/trunk
- Files:
-
- 3 added
- 2 edited
-
cache-translation-object.php (modified) (6 diffs)
-
cache-translation-sv_SE.mo (added)
-
cache-translation-sv_SE.po (added)
-
cache-translation.pot (added)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cache-translation-object/trunk/cache-translation-object.php
r164287 r165415 6 6 Author: Johan Eenfeldt 7 7 Author URI: http://devel.kostdoktorn.se 8 Version: 1. 08 Version: 1.1 9 9 10 10 Copyright 2009 Johan Eenfeldt … … 29 29 /* 30 30 * Todo: 31 * - Add .pot, translate it32 31 * - Add storage: memcached 33 32 * - check out how to handle multiple locale plugins & WPMU 33 * register_deactivation_hook(__FILE__, 'cachet_clear_caches'); 34 34 */ 35 35 … … 55 55 $cache_translation_cached = false; 56 56 57 /* Plugin setup */ 58 function cachet_init() { 59 load_plugin_textdomain('cache-translation', false 60 , dirname(plugin_basename(__FILE__))); 61 } 62 add_action('plugins_loaded', 'cachet_init'); 63 57 64 /* Check if caching is enabled */ 58 65 function cachet_is_enabled() { … … 124 131 cachet_store($l10n); 125 132 } 126 add_action('shutdown', 'cachet_action_store_translation' , 10, 2);133 add_action('shutdown', 'cachet_action_store_translation'); 127 134 128 135 … … 185 192 /* Get current storage type */ 186 193 function cachet_get_type() { 187 $type = get_option('cachet_type', false); 188 if (!cachet_check_type($type)) 189 $type = cachet_set_default_type(); 190 191 return $type; 192 } 193 194 /* Set (and return) a default storage type */ 195 function cachet_set_default_type() { 196 global $cache_translation_storage; 197 198 $type = ''; 199 200 foreach ($cache_translation_storage as $t => $ignore) { 201 if (cachet_storage_available($t)) { 202 $type = $t; 203 break; 204 } 205 } 206 207 update_option('cachet_type', $type); 194 $type = get_option('cachet_type', ''); 195 208 196 return $type; 209 197 } … … 330 318 echo ' (' . sprintf(__('%s bytes cached','cache-translation'), $size) . ')'; 331 319 } else { 332 echo __(' Caching disabled','cache-translation');320 echo __('Enable caching','cache-translation'); 333 321 } 334 322 ?> -
cache-translation-object/trunk/readme.txt
r164287 r165415 1 1 === Cache Translation Object === 2 2 Contributors: johanee 3 Tags: performance, translation, localization, i18n3 Tags: cache, caching, performance, translation, localization, i18n 4 4 Requires at least: 2.8 5 5 Tested up to: 2.8.4 … … 44 44 = How do I make the file writable? = 45 45 46 http://codex.wordpress.org/Changing_File_Permissions 46 `http://codex.wordpress.org/Changing_File_Permissions` 47 47 48 48 The file must be writable by the webserver when using file storage. … … 59 59 == Change Log == 60 60 61 = Version 1.1 = 62 * Do not default to any specific storage type, make user choose 63 * Added plugin localization 64 * Added Swedish translation 65 61 66 = Version 1.0 = 62 67 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.