Skip to content

Commit

Permalink
Publisher i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
nb committed Jan 20, 2013
1 parent d24363f commit ab7d20d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions js/liveblog-publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 9 additions & 2 deletions liveblog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
) );
}

/**
Expand Down

0 comments on commit ab7d20d

Please sign in to comment.