From 36c5b05230b16a06589b37cb9dfb372171645b43 Mon Sep 17 00:00:00 2001 From: Ozh Date: Sun, 10 Feb 2013 21:19:26 +0000 Subject: [PATCH] Aaaaaaand more translation. Aaaaaaand I think that's it! git-svn-id: http://yourls.googlecode.com/svn/trunk@871 12232710-3e20-11de-b438-597f59cd7555 --- admin/plugins.php | 9 +- includes/functions-formatting.php | 17 +- includes/functions-html.php | 8 +- includes/functions-l10n.php | 421 ++++++++++++++++++++++++++++++ yourls-api.php | 8 + yourls-infos.php | 109 ++++---- 6 files changed, 510 insertions(+), 62 deletions(-) diff --git a/admin/plugins.php b/admin/plugins.php index cef6f1e..81df0c5 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -46,10 +46,13 @@ } // Handle message upon succesfull (de)activation -if( isset( $_GET['success'] ) ) { - if( $_GET['success'] == 'activated' OR $_GET['success'] == 'deactivated' ) { - yourls_add_notice( yourls_s( 'Plugin has been %s', $_GET['success'] ) ); +if( isset( $_GET['success'] ) && ( ( $_GET['success'] == 'activated' ) OR ( $_GET['success'] == 'deactivated' ) ) ) { + if( $_GET['success'] == 'activated' ) { + $message = yourls_s( 'Plugin has been activated' ); + } elseif ( $_GET['success'] == 'deactivated' ) { + $message = yourls_s( 'Plugin has been deactivated' ); } + yourls_add_notice( $message ); } yourls_html_head( 'plugins', yourls__( 'Manage Plugins' ) ); diff --git a/includes/functions-formatting.php b/includes/functions-formatting.php index a133e2a..ea662fc 100644 --- a/includes/functions-formatting.php +++ b/includes/functions-formatting.php @@ -488,4 +488,19 @@ function yourls_encodeURI( $url ) { '%26' => '&', '%3D' => '=', '%2B' => '+', '%24' => '$', '%21' => '!', '%2A' => '*', '%27' => '\'', '%28' => '(', '%29' => ')', '%23' => '#', ) ); -} \ No newline at end of file +} + +/** + * Adds backslashes before letters and before a number at the start of a string. Stolen from WP. + * + * @since 1.6 + * + * @param string $string Value to which backslashes will be added. + * @return string String with backslashes inserted. + */ +function yourls_backslashit($string) { + $string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string); + $string = preg_replace('/([a-z])/i', '\\\\\1', $string); + return $string; +} + diff --git a/includes/functions-html.php b/includes/functions-html.php index 5df74c3..148c4e6 100644 --- a/includes/functions-html.php +++ b/includes/functions-html.php @@ -272,7 +272,7 @@ function yourls_html_tfooter( $params = array() ) { $p_end = min( max( 5, $page + 2 ), $total_pages ); if( $p_start >= 2 ) { $link = yourls_add_query_arg( array_merge( $params, array( 'page' => 1 ) ), $base_page ); - echo '' . yourls_( '« First' ) . ''; + echo '' . yourls__( '« First' ) . ''; echo ''; } for( $i = $p_start ; $i <= $p_end; $i++ ) { @@ -353,9 +353,9 @@ function yourls_share_box( $longurl, $shorturl, $title = '', $text='', $shortlin

-

Short URL: +

1 ) - echo ' '; + echo ' '; } ?>

-

Long URL:

+

-

Traffic statistics

+

@@ -251,10 +251,10 @@ 'Last 24 hours', - '7' => 'Last 7 days', - '30' => 'Last 30 days', - 'all'=> 'All time' + '24' => yourls__( 'Last 24 hours' ), + '7' => yourls__( 'Last 7 days' ), + '30' => yourls__( 'Last 30 days' ), + 'all'=> yourls__( 'All time' ), ); // Which graph to generate ? @@ -291,13 +291,13 @@ "; - echo "

Number of hits : $graphtitle

"; + echo '

' . yourls_s( 'Number of hits : %s' , $graphtitle ) . '

'; switch( $graph ) { case '24': yourls_stats_line( $last_24h, "stat_line_$graph" ); @@ -329,16 +329,16 @@ -

Historical click count

+

-

Short URL created on

+

    0 ) - $stat = round( ( ${'hits_'.$graph} / $ago ) * 100 ) / 100 . ' per day'; + $stat = yourls_s( '%s per day', round( ( ${'hits_'.$graph} / $ago ) * 100 ) / 100 ); } } - $hits = yourls_plural( 'hit', ${'hits_'.$graph} ); + $hits = sprintf( yourls_n( '%s hit', '%s hits', ${'hits_'.$graph} ), ${'hits_'.$graph} ); echo "
  • $link ${'hits_'.$graph} $hits $stat
  • \n"; } ?>
-

Best day

+

-

on . - Click for more details

+

%s hit on %s', '%s hits on %s', $best['max'] ), $best['max'], yourls_date_i18n( "F j, Y", strtotime( $best['day'] ) ) ); ?>. +

-

Traffic location

+

@@ -438,9 +438,9 @@ @@ -460,13 +460,13 @@ No country data.

"; + echo '

' . yourls__( 'No country data.' ) . '

'; } ?>
-

Traffic Sources

+

@@ -475,22 +475,23 @@
-

Top 5 countries

+

-

Click for more details

+

-

Overall traffic

+

@@ -527,7 +528,7 @@ No referrer data.

"; + echo '

' . yourls__( 'No referrer data.' ) . '

'; } ?> @@ -536,9 +537,9 @@
-

Share

+

- Short link', '

Quick Share

'); ?> + ' . yourls__( 'Short link' ) . '', '

' . yourls__( 'Quick Share ' ) . '

'); ?>
-- 2.45.0
-

Referrer shares

+

1 ) - $referrer_sort['Others'] = count( $referrers ); + $referrer_sort[ yourls__( 'Others' ) ] = count( $referrers ); yourls_stats_pie( $referrer_sort, 5, '440x220', 'stat_tab_source_ref' ); unset( $referrer_sort['Others'] ); ?> -

Referrers

+

    $count ) { $i++; $favicon = yourls_get_favicon_url( $site ); - echo "
  • $site: $count (details)
  • \n"; + echo "
  • $site: $count " . yourls__( '(details)' ) . "
  • \n"; echo "
-

Direct vs Referrer Traffic

+

$direct, 'Referrers'=> $notdirect), 5, '440x220', 'stat_tab_source_direct' ); + yourls_stats_pie( array( yourls__( 'Direct' ) => $direct, yourls__( 'Referrers' ) => $notdirect ), 5, '440x220', 'stat_tab_source_direct' ); ?> -

Direct traffic:

-

Referrer traffic:

+

%s hit', '%s hits', $direct ), $direct ); ?>

+

%s hit', '%s hits', $notdirect ), $direct ); ?>