Index: trunk/tools/wp-photocommons/inc/class-photocommons.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | */ |
21 | 21 | class PhotoCommons { |
| 22 | + const PLUGIN = "wp-photocommons"; |
22 | 23 | const PLUGIN_PATH = '/wp-photocommons/'; |
23 | 24 | const FILEPATH_PATTERN = 'http://commons.wikimedia.org/w/index.php?title=Special:FilePath&file=%s&width=%s'; |
24 | 25 | const FILEPAGE_PATTERN = 'http://commons.wikimedia.org/w/index.php?title=File:%s'; |
— | — | @@ -61,6 +62,7 @@ |
62 | 63 | |
63 | 64 | private function enqueue_scripts() { |
64 | 65 | // Register some of our own scripts |
| 66 | + wp_register_script( 'translations', plugins_url() . self::PLUGIN_PATH . 'js/translations.php' ); |
65 | 67 | wp_register_script( 'admin', plugins_url() . self::PLUGIN_PATH . 'js/admin.js' ); |
66 | 68 | wp_register_script( 'search', plugins_url() . self::PLUGIN_PATH . 'js/search.js' ); |
67 | 69 | wp_register_script( 'suggestions', plugins_url() . self::PLUGIN_PATH . 'js/jquery.suggestions.js' ); |
— | — | @@ -71,6 +73,7 @@ |
72 | 74 | wp_enqueue_script( 'jquery-ui-dialog' ); |
73 | 75 | |
74 | 76 | // Enqueue our own scripts |
| 77 | + wp_enqueue_script( 'translations' ); |
75 | 78 | wp_enqueue_script( 'admin' ); |
76 | 79 | wp_enqueue_script( 'search' ); |
77 | 80 | wp_enqueue_script( 'suggestions' ); |
Index: trunk/tools/wp-photocommons/search.php |
— | — | @@ -1,4 +1,6 @@ |
2 | 2 | <?php |
| 3 | +require_once '../../wp-load.php'; |
| 4 | + |
3 | 5 | $path = dirname( $_SERVER['PHP_SELF'] ); |
4 | 6 | // Standalone is used to debug/test this page directly, |
5 | 7 | // without having to the HEAD/BODY with it in admin. |
— | — | @@ -16,7 +18,7 @@ |
17 | 19 | <body> |
18 | 20 | <?php endif; ?> |
19 | 21 | |
20 | | - <label for="wp-photocommons-search">Zoek:</label> |
| 22 | + <label for="wp-photocommons-search"><?php _e("Search", "wp-photocommons"); ?>:</label> |
21 | 23 | <input type="search" id="wp-photocommons-search" /> |
22 | 24 | |
23 | 25 | <ul id="wp-photocommons-results"></ul> |
Index: trunk/tools/wp-photocommons/js/admin.js |
— | — | @@ -1,9 +1,13 @@ |
2 | 2 | (function($) { |
3 | 3 | var PATH = '../wp-content/plugins/wp-photocommons'; |
4 | 4 | |
| 5 | + function _(msg) { |
| 6 | + return window.PhotoCommons.translations[msg]; |
| 7 | + } |
| 8 | + |
5 | 9 | function addButtons() { |
6 | 10 | $('#media-buttons').append(''.concat( |
7 | | - '<a id="photocommons-add" title="Afbeeldingen invoegen van Wikimedia Commons" style="padding-left:4px;">', |
| 11 | + '<a id="photocommons-add" title="' + _("Insert images from Wikimedia Commons") + '" style="padding-left:4px;">', |
8 | 12 | '<img src="' + PATH + '/img/button.png"/>', |
9 | 13 | '</a>' |
10 | 14 | )); |
— | — | @@ -18,7 +22,7 @@ |
19 | 23 | var $self = $('#photocommons-dialog'); |
20 | 24 | |
21 | 25 | $self.dialog({ |
22 | | - title : 'PhotoCommons - Afbeelingen invoegen van Wikimedia Commons', |
| 26 | + title : _('PhotoCommons') + ' - ' + _("Insert images from Wikimedia Commons"), |
23 | 27 | width : 800, |
24 | 28 | height : 500 |
25 | 29 | }); |
Index: trunk/tools/wp-photocommons/js/translations.php |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +<?php |
| 3 | + require_once "../../../../wp-load.php"; |
| 4 | +?> |
| 5 | +// This is a Javascript file generated by PHP for the translations |
| 6 | + |
| 7 | +if ( !window.PhotoCommons ) { |
| 8 | + window.PhotoCommons = {}; |
| 9 | +} |
| 10 | + |
| 11 | +window.PhotoCommons.translations = { |
| 12 | + "Insert images from Wikimedia Commons" : "<?php _e("Insert images from Wikimedia Commons", "wp-photocommons"); ?>", |
| 13 | + "PhotoCommons" : "<?php _e("PhotoCommons", "wp-photocommons"); ?>" |
| 14 | +}; |
\ No newline at end of file |
Property changes on: trunk/tools/wp-photocommons/js/translations.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 15 | + native |