Permalink
Browse files

Publisher i18n

  • Loading branch information...
1 parent d24363f commit ab7d20d9f0537f186e0177d643116d5eac28c601 @nb nb committed Jan 20, 2013
Showing with 14 additions and 7 deletions.
  1. +5 −5 js/liveblog-publisher.js
  2. +9 −2 liveblog.php
View
@@ -10,8 +10,8 @@
tagName: "div",
className: "liveblog-form",
template: _.template($('#liveblog-form-template').html()),
- entry_tab_label: 'New Entry',
- submit_label: 'Publish Update',
+ entry_tab_label: liveblog_publisher_settings.new_entry_tab_label,
+ submit_label: liveblog_publisher_settings.new_entry_submit_label,
events: {
'click .cancel': 'cancel',
'click .liveblog-form-entry-submit': 'submit',
@@ -118,8 +118,8 @@
});
liveblog.EditEntryView = liveblog.InsertEntryView.extend({
- entry_tab_label: 'Edit Entry',
- submit_label: 'Update',
+ entry_tab_label: liveblog_publisher_settings.edit_entry_tab_label,
+ submit_label: liveblog_publisher_settings.edit_entry_submit_label,
initialize: function(options) {
this.$entry = options.entry;
this.$entry_text = this.$entry.find('.liveblog-entry-text');
@@ -153,7 +153,7 @@
};
data[liveblog_settings.nonce_key] = liveblog.publisher.nonce;
this.form.disable();
- this.$el.html('Loading preview…');
+ this.$el.html(liveblog_publisher_settings.loading_preview);
liveblog.ajax_request( liveblog_settings.endpoint_url + 'preview', data, _.bind(this.success, this), _.bind(this.error, this), 'POST' );
},
success: function(response) {
View
@@ -504,10 +504,17 @@ public static function enqueue_scripts() {
'delete_confirmation' => __( 'Do you really want do delete this entry? There is no way back.', 'liveblog' ),
'error_message_template' => __( 'Error {error-code}: {error-message}', 'liveblog' ),
'short_error_message_template' => __( 'Error: {error-message}', 'liveblog' ),
- 'new_update' => __( 'Liveblog: {number} new update' ),
- 'new_updates' => __( 'Liveblog: {number} new updates' ),
+ 'new_update' => __( 'Liveblog: {number} new update' , 'liveblog'),
+ 'new_updates' => __( 'Liveblog: {number} new updates' , 'liveblog'),
) )
);
+ wp_localize_script( 'liveblog-publisher', 'liveblog_publisher_settings', array(
+ 'loading_preview' => __( 'Loading preview…', 'liveblog' ),
+ 'new_entry_tab_label' => __( 'New Entry', 'liveblog' ),
+ 'new_entry_submit_label' => __( 'Publish Update', 'liveblog' ),
+ 'edit_entry_tab_label' => __( 'Edit Entry', 'liveblog' ),
+ 'edit_entry_submit_label' => __( 'Update', 'liveblog' ),
+ ) );
}
/**

0 comments on commit ab7d20d

Please sign in to comment.