Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better localisation #644

Merged
merged 10 commits into from Oct 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions classes/class-wp-stream-admin.php
Expand Up @@ -251,7 +251,7 @@ public static function register_menu() {
self::$screen_id['settings'] = add_submenu_page(
self::RECORDS_PAGE_SLUG,
__( 'Stream Settings', 'stream' ),
__( 'Settings', 'default' ),
__( 'Settings', 'stream' ),
self::SETTINGS_CAP,
self::SETTINGS_PAGE_SLUG,
array( __CLASS__, 'render_settings_page' )
Expand All @@ -260,7 +260,7 @@ public static function register_menu() {
self::$screen_id['account'] = add_submenu_page(
self::RECORDS_PAGE_SLUG,
__( 'Stream Account', 'stream' ),
__( 'Account', 'default' ),
__( 'Account', 'stream' ),
self::SETTINGS_CAP,
self::ACCOUNT_PAGE_SLUG,
array( __CLASS__, 'render_account_page' )
Expand Down Expand Up @@ -537,7 +537,7 @@ public static function plugin_action_links( $links, $file ) {
if ( plugin_basename( WP_STREAM_DIR . 'stream.php' ) === $file ) {
$admin_page_url = add_query_arg( array( 'page' => self::SETTINGS_PAGE_SLUG ), admin_url( self::ADMIN_PARENT_PAGE ) );

$links[] = sprintf( '<a href="%s">%s</a>', esc_url( $admin_page_url ), esc_html__( 'Settings', 'default' ) );
$links[] = sprintf( '<a href="%s">%s</a>', esc_url( $admin_page_url ), esc_html__( 'Settings', 'stream' ) );
}

return $links;
Expand Down
10 changes: 5 additions & 5 deletions classes/class-wp-stream-dashboard-widget.php
Expand Up @@ -98,7 +98,7 @@ public static function pagination( $args = array() ) {
'view-all',
esc_attr__( 'View all records', 'stream' ),
esc_url( $records_link ),
esc_html__( 'View All', 'default' )
esc_html__( 'View All', 'stream' )
);

$page_links = array();
Expand All @@ -116,15 +116,15 @@ public static function pagination( $args = array() ) {
$page_links[] = sprintf(
'<a class="%s" title="%s" href="%s" data-page="1">%s</a>',
'first-page' . $disable_first,
esc_attr__( 'Go to the first page', 'default' ),
esc_attr__( 'Go to the first page', 'stream' ),
esc_url( remove_query_arg( 'paged', $records_link ) ),
'&laquo;'
);

$page_links[] = sprintf(
'<a class="%s" title="%s" href="%s" data-page="%s">%s</a>',
'prev-page' . $disable_first,
esc_attr__( 'Go to the previous page', 'default' ),
esc_attr__( 'Go to the previous page', 'stream' ),
esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $records_link ) ),
max( 1, $current - 1 ),
'&lsaquo;'
Expand All @@ -136,7 +136,7 @@ public static function pagination( $args = array() ) {
$page_links[] = sprintf(
'<a class="%s" title="%s" href="%s" data-page="%s">%s</a>',
'next-page' . $disable_last,
esc_attr__( 'Go to the next page', 'default' ),
esc_attr__( 'Go to the next page', 'stream' ),
esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $records_link ) ),
min( $total_pages, $current + 1 ),
'&rsaquo;'
Expand All @@ -145,7 +145,7 @@ public static function pagination( $args = array() ) {
$page_links[] = sprintf(
'<a class="%s" title="%s" href="%s" data-page="%s">%s</a>',
'last-page' . $disable_last,
esc_attr__( 'Go to the last page', 'default' ),
esc_attr__( 'Go to the last page', 'stream' ),
esc_url( add_query_arg( 'paged', $total_pages, $records_link ) ),
$total_pages,
'&raquo;'
Expand Down
2 changes: 1 addition & 1 deletion classes/class-wp-stream-date-interval.php
Expand Up @@ -45,7 +45,7 @@ public function get_predefined_intervals() {
'wp_stream_predefined_date_intervals',
array(
'today' => array(
'label' => esc_html__( 'Today', 'default' ),
'label' => esc_html__( 'Today', 'stream' ),
'start' => Carbon::today( $timezone )->startOfDay(),
'end' => Carbon::today( $timezone )->endOfDay(),
),
Expand Down
14 changes: 7 additions & 7 deletions classes/class-wp-stream-list-table.php
Expand Up @@ -65,9 +65,9 @@ function get_columns(){
return apply_filters(
'wp_stream_list_table_columns',
array(
'date' => __( 'Date', 'default' ),
'summary' => __( 'Summary', 'default' ),
'author' => __( 'Author', 'default' ),
'date' => __( 'Date', 'stream' ),
'summary' => __( 'Summary', 'stream' ),
'author' => __( 'Author', 'stream' ),
'context' => __( 'Context', 'stream' ),
'action' => __( 'Action', 'stream' ),
'ip' => __( 'IP Address', 'stream' ),
Expand Down Expand Up @@ -603,7 +603,7 @@ function filters_form() {
}
}

$filters_string .= sprintf( '<input type="submit" id="record-query-submit" class="button" value="%s" />', __( 'Filter', 'default' ) );
$filters_string .= sprintf( '<input type="submit" id="record-query-submit" class="button" value="%s" />', __( 'Filter', 'stream' ) );

$url = self_admin_url( WP_Stream_Admin::ADMIN_PARENT_PAGE );

Expand Down Expand Up @@ -718,7 +718,7 @@ function filter_date( $items ) {

<select class="field-predefined hide-if-no-js" name="date_predefined" data-placeholder="<?php _e( 'All Time', 'stream' ); ?>">
<option></option>
<option value="custom" <?php selected( 'custom' === $date_predefined ); ?>><?php esc_attr_e( 'Custom', 'default' ) ?></option>
<option value="custom" <?php selected( 'custom' === $date_predefined ); ?>><?php esc_attr_e( 'Custom', 'stream' ) ?></option>
<?php foreach ( $items as $key => $interval ) {
printf(
'<option value="%s" data-from="%s" data-to="%s" %s>%s</option>',
Expand All @@ -734,13 +734,13 @@ function filter_date( $items ) {
<div class="date-inputs">
<div class="box">
<i class="date-remove dashicons"></i>
<input type="text" name="date_from" class="date-picker field-from" placeholder="<?php esc_attr_e( 'Start Date', 'default' ) ?>" value="<?php echo esc_attr( $date_from ) ?>" />
<input type="text" name="date_from" class="date-picker field-from" placeholder="<?php esc_attr_e( 'Start Date', 'stream' ) ?>" value="<?php echo esc_attr( $date_from ) ?>" />
</div>
<span class="connector dashicons"></span>

<div class="box">
<i class="date-remove dashicons"></i>
<input type="text" name="date_to" class="date-picker field-to" placeholder="<?php esc_attr_e( 'End Date', 'default' ) ?>" value="<?php echo esc_attr( $date_to ) ?>" />
<input type="text" name="date_to" class="date-picker field-to" placeholder="<?php esc_attr_e( 'End Date', 'stream' ) ?>" value="<?php echo esc_attr( $date_to ) ?>" />
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion classes/class-wp-stream-settings.php
Expand Up @@ -205,7 +205,7 @@ public static function get_fields() {
if ( empty( self::$fields ) ) {
$fields = array(
'general' => array(
'title' => esc_html__( 'General', 'default' ),
'title' => esc_html__( 'General', 'stream' ),
'fields' => array(
array(
'name' => 'role_access',
Expand Down
50 changes: 25 additions & 25 deletions connectors/class-wp-stream-connector-acf.php
Expand Up @@ -68,7 +68,7 @@ public static function is_dependency_satisfied() {
* @return string Translated connector label
*/
public static function get_label() {
return __( 'ACF', 'acf' );
return _x( 'ACF', 'acf', 'stream' );
}

/**
Expand All @@ -78,10 +78,10 @@ public static function get_label() {
*/
public static function get_action_labels() {
return array(
'created' => __( 'Created', 'stream' ),
'updated' => __( 'Updated', 'stream' ),
'added' => __( 'Added', 'stream' ),
'deleted' => __( 'Deleted', 'stream' ),
'created' => __( 'Created', 'acf', 'stream' ),
'updated' => __( 'Updated', 'acf', 'stream' ),
'added' => __( 'Added', 'acf', 'stream' ),
'deleted' => __( 'Deleted', 'acf', 'stream' ),
);
}

Expand Down Expand Up @@ -249,9 +249,9 @@ public static function check_meta( $type, $action, $meta_id, $object_id, $meta_k
}

$options = array(
'acf_after_title' => __( 'High (after title)', 'acf' ),
'normal' => __( 'Normal (after content)', 'acf' ),
'side' => __( 'Side', 'acf' ),
'acf_after_title' => _x( 'High (after title)', 'acf', 'stream' ),
'normal' => _x( 'Normal (after content)', 'acf', 'stream' ),
'side' => _x( 'Side', 'acf', 'stream' ),
);

self::log(
Expand All @@ -274,8 +274,8 @@ public static function check_meta( $type, $action, $meta_id, $object_id, $meta_k
}

$options = array(
'no_box' => __( 'Seamless (no metabox)', 'acf' ),
'default' => __( 'Standard (WP metabox)', 'acf' ),
'no_box' => _x( 'Seamless (no metabox)', 'acf', 'stream' ),
'default' => _x( 'Standard (WP metabox)', 'acf', 'stream' ),
);

self::log(
Expand All @@ -298,20 +298,20 @@ public static function check_meta( $type, $action, $meta_id, $object_id, $meta_k
}

$options = array(
'permalink' => __( 'Permalink', 'acf' ),
'the_content' => __( 'Content Editor', 'acf' ),
'excerpt' => __( 'Excerpt', 'default' ),
'custom_fields' => __( 'Custom Fields', 'acf' ),
'discussion' => __( 'Discussion', 'acf' ),
'comments' => __( 'Comments', 'default' ),
'revisions' => __( 'Revisions', 'default' ),
'slug' => __( 'Slug', 'acf' ),
'author' => __( 'Author', 'default' ),
'format' => __( 'Format', 'default' ),
'featured_image' => __( 'Featured Image', 'acf' ),
'categories' => __( 'Categories', 'default' ),
'tags' => __( 'Tags', 'default' ),
'send-trackbacks' => __( 'Send Trackbacks', 'acf' ),
'permalink' => _x( 'Permalink', 'acf', 'stream' ),
'the_content' => _x( 'Content Editor', 'acf', 'stream' ),
'excerpt' => _x( 'Excerpt', 'acf', 'stream' ),
'custom_fields' => _x( 'Custom Fields', 'acf', 'stream' ),
'discussion' => _x( 'Discussion', 'acf', 'stream' ),
'comments' => _x( 'Comments', 'acf', 'stream' ),
'revisions' => _x( 'Revisions', 'acf', 'stream' ),
'slug' => _x( 'Slug', 'acf', 'stream' ),
'author' => _x( 'Author', 'acf', 'stream' ),
'format' => _x( 'Format', 'acf', 'stream' ),
'featured_image' => _x( 'Featured Image', 'acf', 'stream' ),
'categories' => _x( 'Categories', 'acf', 'stream' ),
'tags' => _x( 'Tags', 'acf', 'stream' ),
'send-trackbacks' => _x( 'Send Trackbacks', 'acf', 'stream' ),
);

if ( count( $options ) === count( $meta_value ) ) {
Expand Down Expand Up @@ -380,7 +380,7 @@ public static function check_meta_values( $type, $action, $meta_id, $object_id,
} elseif ( 'user' === $type ) {
$user = new WP_User( $object_id );
$title = $user->get( 'display_name' );
$type_name = __( 'user', 'default' );
$type_name = __( 'user', 'stream' );
} elseif ( 'taxonomy' === $type ) {
$term = get_term( $term_id, $taxonomy );
$title = $term->name;
Expand Down
38 changes: 19 additions & 19 deletions connectors/class-wp-stream-connector-bbpress.php
Expand Up @@ -75,7 +75,7 @@ public static function is_dependency_satisfied() {
* @return string Translated connector label
*/
public static function get_label() {
return __( 'bbPress', 'bbpress' );
return _x( 'bbPress', 'bbpress', 'stream' );
}

/**
Expand All @@ -85,22 +85,22 @@ public static function get_label() {
*/
public static function get_action_labels() {
return array(
'created' => __( 'Created', 'stream' ),
'updated' => __( 'Updated', 'stream' ),
'activated' => __( 'Activated', 'stream' ),
'deactivated' => __( 'Deactivated', 'stream' ),
'deleted' => __( 'Deleted', 'stream' ),
'trashed' => __( 'Trashed', 'stream' ),
'untrashed' => __( 'Restored', 'stream' ),
'generated' => __( 'Generated', 'stream' ),
'imported' => __( 'Imported', 'stream' ),
'exported' => __( 'Exported', 'stream' ),
'closed' => __( 'Closed', 'stream' ),
'opened' => __( 'Opened', 'stream' ),
'sticked' => __( 'Sticked', 'stream' ),
'unsticked' => __( 'Unsticked', 'stream' ),
'spammed' => __( 'Marked as spam', 'stream' ),
'unspammed' => __( 'Unmarked as spam', 'stream' ),
'created' => _x( 'Created', 'bbpress', 'stream' ),
'updated' => _x( 'Updated', 'bbpress', 'stream' ),
'activated' => _x( 'Activated', 'bbpress', 'stream' ),
'deactivated' => _x( 'Deactivated', 'bbpress', 'stream' ),
'deleted' => _x( 'Deleted', 'bbpress', 'stream' ),
'trashed' => _x( 'Trashed', 'bbpress', 'stream' ),
'untrashed' => _x( 'Restored', 'bbpress', 'stream' ),
'generated' => _x( 'Generated', 'bbpress', 'stream' ),
'imported' => _x( 'Imported', 'bbpress', 'stream' ),
'exported' => _x( 'Exported', 'bbpress', 'stream' ),
'closed' => _x( 'Closed', 'bbpress', 'stream' ),
'opened' => _x( 'Opened', 'bbpress', 'stream' ),
'sticked' => _x( 'Sticked', 'bbpress', 'stream' ),
'unsticked' => _x( 'Unsticked', 'bbpress', 'stream' ),
'spammed' => _x( 'Marked as spam', 'bbpress', 'stream' ),
'unspammed' => _x( 'Unmarked as spam', 'bbpress', 'stream' ),
);
}

Expand All @@ -111,7 +111,7 @@ public static function get_action_labels() {
*/
public static function get_context_labels() {
return array(
'settings' => __( 'Settings', 'stream' ),
'settings' => _x( 'Settings', 'bbpress', 'stream' ),
);
}

Expand Down Expand Up @@ -149,7 +149,7 @@ public static function log_override( array $data ) {
$settings = bbp_admin_get_settings_fields();

/* fix for missing title for this single field */
$settings['bbp_settings_features']['_bbp_allow_threaded_replies']['title'] = __( 'Reply Threading', 'bbpress' );
$settings['bbp_settings_features']['_bbp_allow_threaded_replies']['title'] = __( 'Reply Threading', 'stream' );

$option = $data['args']['option'];
foreach ( $settings as $section => $fields ) {
Expand Down