Plugin Directory

Changeset 807770


Ignore:
Timestamp:
11/20/2013 08:56:46 PM (12 years ago)
Author:
sebstein
Message:
  • allow translation of plugin
  • add German translation
Location:
g-crossposting/trunk
Files:
1 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • g-crossposting/trunk/admin.php

    r805313 r807770  
    1212}
    1313
    14 require_once dirname(__FILE__).'/gplus-crosspost.php';
    15 
    1614// register our admin actions
    1715add_action('admin_init', 'g_crossposting_register_options');
     
    2422if (array_key_exists('g_crossposting_manual_import', $_GET)) {
    2523    g_crossposting_update();
    26     g_crossposting_add_error('g_crossposting_err_import', __("Manual import of Google+ activities done."));
     24    g_crossposting_add_error('g_crossposting_err_import', __('Manual import of Google+ activities done.', 'g-crossposting'));
    2725}
    2826
     
    4240    if (function_exists('add_submenu_page')) {
    4341        // add menu entry for config page
    44         add_submenu_page('options-general.php', __('Google+ Crossposting Configuration'), __('Google+ Crossposting'), 'manage_options', 'g-crossposting-key-config', 'g_crossposting_conf');
     42        add_submenu_page('options-general.php', __('Google+ Crossposting Configuration', 'g-crossposting'), __('Google+ Crossposting', 'g-crossposting'), 'manage_options', 'g-crossposting-key-config', 'g_crossposting_conf');
    4543    }
    4644}
     
    5452
    5553    // add a section around our options
    56     add_settings_section('g_crossposting_section_main', 'Authentication Settings', 'g_crossposting_section_main_text', 'g_crossposting');
    57     add_settings_section('g_crossposting_section_options', 'Setup Options', 'g_crossposting_section_options_text', 'g_crossposting');
     54    add_settings_section('g_crossposting_section_main', __('Authentication Settings', 'g-crossposting'), 'g_crossposting_section_main_text', 'g_crossposting');
     55    add_settings_section('g_crossposting_section_options', __('Setup Options', 'g-crossposting'), 'g_crossposting_section_options_text', 'g_crossposting');
    5856
    5957    // add field for each option
    60     add_settings_field('g_crossposting_gplusid', __('Your Google+ ID'), 'g_crossposting_gplusid_field', 'g_crossposting', 'g_crossposting_section_main');
    61     add_settings_field('g_crossposting_apikey', __('Your Google API key'), 'g_crossposting_apikey_field', 'g_crossposting', 'g_crossposting_section_main');
    62     add_settings_field('g_crossposting_user', __('Wordpress user to set as author of imported Google+ activities'), 'g_crossposting_author_field', 'g_crossposting', 'g_crossposting_section_options');
    63     add_settings_field('g_crossposting_category', __('Category to use for imported Google+ activities'), 'g_crossposting_category_field', 'g_crossposting', 'g_crossposting_section_options');
    64     add_settings_field('g_crossposting_comment', __('Enable comments on imported Google+ activities'), 'g_crossposting_comment_field', 'g_crossposting', 'g_crossposting_section_options');
    65     add_settings_field('g_crossposting_maxactivities', __('Maximum number of new activities to import'), 'g_crossposting_maxactivities_field', 'g_crossposting', 'g_crossposting_section_options');
    66     add_settings_field('g_crossposting_titlelen', __('Maximum length of imported title (set to 0 for full length)'), 'g_crossposting_titlelen_field', 'g_crossposting', 'g_crossposting_section_options');
    67     add_settings_field('g_crossposting_addcanonical', __('Add canonical meta tag pointing to Google+'), 'g_crossposting_addcanonical_field', 'g_crossposting', 'g_crossposting_section_options');
     58    add_settings_field('g_crossposting_gplusid', __('Your Google+ ID', 'g-crossposting'), 'g_crossposting_gplusid_field', 'g_crossposting', 'g_crossposting_section_main');
     59    add_settings_field('g_crossposting_apikey', __('Your Google API key', 'g-crossposting'), 'g_crossposting_apikey_field', 'g_crossposting', 'g_crossposting_section_main');
     60    add_settings_field('g_crossposting_user', __('Wordpress user to set as author of imported Google+ activities', 'g-crossposting'), 'g_crossposting_author_field', 'g_crossposting', 'g_crossposting_section_options');
     61    add_settings_field('g_crossposting_category', __('Category to use for imported Google+ activities', 'g-crossposting'), 'g_crossposting_category_field', 'g_crossposting', 'g_crossposting_section_options');
     62    add_settings_field('g_crossposting_comment', __('Enable comments on imported Google+ activities', 'g-crossposting'), 'g_crossposting_comment_field', 'g_crossposting', 'g_crossposting_section_options');
     63    add_settings_field('g_crossposting_maxactivities', __('Maximum number of new activities to import', 'g-crossposting'), 'g_crossposting_maxactivities_field', 'g_crossposting', 'g_crossposting_section_options');
     64    add_settings_field('g_crossposting_titlelen', __('Maximum length of imported title (set to 0 for full length)', 'g-crossposting'), 'g_crossposting_titlelen_field', 'g_crossposting', 'g_crossposting_section_options');
     65    add_settings_field('g_crossposting_addcanonical', __('Add canonical meta tag pointing to Google+', 'g-crossposting'), 'g_crossposting_addcanonical_field', 'g_crossposting', 'g_crossposting_section_options');
    6866}
    6967
     
    155153function g_crossposting_section_main_text() {
    156154    echo '<p>';
    157     _e("The following settings specify your Google+ ID and your Google API key. Without those settings, the plugin won't work.");
     155    _e('The following settings specify your Google+ ID and your Google API key. Without those settings, the plugin won\'t work.', 'g-crossposting');
    158156    echo '</p>';
    159157}
     
    164162function g_crossposting_section_options_text() {
    165163    echo '<p>';
    166     _e("The following settings let you configure the behaviour of this plugin.");
     164    _e('The following settings let you configure the behaviour of this plugin.', 'g-crossposting');
    167165    echo '</p>';
    168166}
     
    177175    // trim Google API key
    178176    $new_input['apikey'] = trim($input['apikey']);
    179 
    180     // if API key and Google+ are given, check if they are valid
    181     if (! empty($new_input['gplusid']) && ! empty($new_input['apikey'])) {
    182         if (g_crossposting_api_activities_list($new_input['gplusid'], $new_input['apikey'], 1) == null) {
    183             // at least one of both must be wrong
    184             $new_input['gplusid'] = '';
    185             $new_input['apikey'] = '';
    186         }
    187     }
    188177
    189178    // validate number of maximum activities to import
     
    191180    if (! g_crossposting_check_maxactivities($new_input['maxactivities'])) {
    192181        $new_input['maxactivities'] = 1;
    193         g_crossposting_add_error('g_crossposting_err_maxactivities', __("The maximum number of activities to import must be a number between 1 and 100."));
     182        g_crossposting_add_error('g_crossposting_err_maxactivities', __('The maximum number of activities to import must be a number between 1 and 100.', 'g-crossposting'));
    194183    }
    195184
     
    198187    if (! g_crossposting_check_titlelen($new_input['titlelen'])) {
    199188        $new_input['titlelen'] = 0;
    200         g_crossposting_add_error('g_crossposting_err_titlelen', __("The maximum length of post title should be a number between 0 and 100."));
     189        g_crossposting_add_error('g_crossposting_err_titlelen', __('The maximum length of post title should be a number between 0 and 100.', 'g-crossposting'));
    201190    }
    202191
     
    242231?>
    243232<div class="wrap">
    244 <h2><?php _e('Google+ Crossposting Configuration'); ?></h2>
     233<h2><?php _e('Google+ Crossposting Configuration', 'g-crossposting'); ?></h2>
    245234<form action="options.php" method="post">
    246235<?php
     
    249238?>
    250239<p class="submit">
    251     <input type="submit" class='button-primary' name="Submit" value="<?php _e('Save Changes')?> &raquo;" />
     240    <input type="submit" class='button-primary' name="Submit" value="<?php _e('Save Changes', 'g-crossposting') ?> &raquo;" />
    252241</p>
    253242</form>
     
    255244    // add link to start manual mass import
    256245    echo '<div id="g-crossposting-manual-import"><strong>';
    257     _e('Manual mass import:');
     246    _e('Manual mass import:', 'g-crossposting');
    258247    echo '</strong> <a href="?page=g-crossposting-key-config&amp;g_crossposting_manual_import=true">';
    259     _e('manually check for new activities and import them');
     248    _e('manually check for new activities and import them', 'g-crossposting');
    260249    echo '</a></div>';
    261250/*
  • g-crossposting/trunk/g-crossposting.php

    r805313 r807770  
    44    Plugin URI: http://wordpress.org/extend/plugins/g-crossposting/
    55    Description: Imports your public Google+ activities in your Wordpress blog.
    6     Version: 1.1.4
     6    Version: 1.2.0
    77    Author: Sebastian Stein
    88    Author URI: http://sebstein.hpfsc.de/
    99    Text Domain: g-crossposting
    10     Domain Path: /lang/
     10    Domain Path: /lang
    1111    License: GPL2
    1212*/
     
    3636}
    3737
     38// load text domain for translations
     39load_plugin_textdomain('g-crossposting', false, basename(dirname(__FILE__)).'/lang');
     40
    3841// load admin UI only if current user is an admin
    3942if (is_admin()) {
    4043    require_once dirname(__FILE__).'/admin.php';
    4144}
    42 
    43 // load text domain for translations
    44 load_plugin_textdomain('g-crossposting', false, basename(dirname(__FILE__)).'/lang');
    4545
    4646// add our own 5 minute scheduler
     
    8787    $schedules['5minutes'] = array(
    8888            'interval' => 300,
    89             'display' => __('Once every 5 minutes'),
     89            'display' => __('Once every 5 minutes', 'g-crossposting'),
    9090        );
    9191
     
    292292        $att_article = null;
    293293        $att_url = null;
    294         if ($activity->object->attachments) {
     294        if (isset($activity->object->attachments)) {
    295295            foreach ($activity->object->attachments as $attachment) {
    296296                switch ($attachment->objectType) {
    297297                    case 'article':
    298298                        $att_title = $attachment->displayName;
    299                         $att_article = $attachment->content;
    300299                        $att_url = $attachment->url;
     300
     301                        $att_article = "";
     302                        if (isset($attachment->content)) {
     303                            $att_article = $attachment->content;
     304                        }
     305
    301306                        if (isset($attachment->image, $attachment->image->url)) {
    302307                            $att_photo = $attachment->image->url;
     
    325330            $post_content .= '</div>';
    326331        }
    327         $post_content .= '<div class="g-crossposting-backlink"><a href="'.$activity->url.'" target="_blank">This was posted on Google+&hellip;</a></div>';
     332        $post_content .= '<div class="g-crossposting-backlink"><a href="'.$activity->url.'" target="_blank">'.__('This was posted on Google+', 'g-crossposting').'</a></div>';
    328333
    329334
     
    334339            $post_title = $att_title;
    335340        } else {
    336             $post_title = 'Google+ post: No title available&hellip;';
     341            $post_title = __('Google+ post: No title available&hellip;', 'g-crossposting');
    337342        }
    338343        // shorten post title if required
     
    420425function g_crossposting_check_category($given_category) {
    421426    $cat_obj = get_category($given_category);
    422     if ($cat_obj && $given_category == $cat_obj->cat_ID) {
     427    if (isset($cat_obj) && isset($cat_obj->cat_ID) && $given_category == $cat_obj->cat_ID) {
    423428        return TRUE;
    424429    }
  • g-crossposting/trunk/lang/g-crossposting.pot

    r445012 r807770  
    1 # Copyright (C) 2010
    2 # This file is distributed under the same license as the package.
     1# Copyright (C) 2013 Google+ Crossposting
     2# This file is distributed under the same license as the Google+ Crossposting package.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version:  \n"
     5"Project-Id-Version: Google+ Crossposting 1.2.0\n"
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/g-crossposting\n"
    7 "POT-Creation-Date: 2011-09-28 21:59:12+00:00\n"
     7"POT-Creation-Date: 2013-11-20 16:47:09+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=UTF-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <[email protected]>\n"
    1414
    15 #: gplus-crosspost.php:71
     15#. #-#-#-#-#  g-crossposting.pot (Google+ Crossposting 1.2.0)  #-#-#-#-#
     16#. Plugin Name of the plugin/theme
     17#: admin.php:26
     18msgid "Manual import of Google+ activities done."
     19msgstr ""
     20
     21#: admin.php:54
     22msgid "Authentication Settings"
     23msgstr ""
     24
     25#: admin.php:55
     26msgid "Setup Options"
     27msgstr ""
     28
     29#: admin.php:44 admin.php:244
     30msgid "Google+ Crossposting Configuration"
     31msgstr ""
     32
     33#: admin.php:44
     34msgid "Google+ Crossposting"
     35msgstr ""
     36
     37#: admin.php:60
     38msgid "Your Google+ ID"
     39msgstr ""
     40
     41#: admin.php:61
     42msgid "Your Google API key"
     43msgstr ""
     44
     45#: admin.php:62
     46msgid "Wordpress user to set as author of imported Google+ activities"
     47msgstr ""
     48
     49#: admin.php:63
     50msgid "Category to use for imported Google+ activities"
     51msgstr ""
     52
     53#: admin.php:64
     54msgid "Enable comments on imported Google+ activities"
     55msgstr ""
     56
     57#: admin.php:65
     58msgid "Maximum number of new activities to import"
     59msgstr ""
     60
     61#: admin.php:66
     62msgid "Maximum length of imported title (set to 0 for full length)"
     63msgstr ""
     64
     65#: admin.php:67
     66msgid "Add canonical meta tag pointing to Google+"
     67msgstr ""
     68
     69#: admin.php:157
     70msgid "The following settings specify your Google+ ID and your Google API key. Without those settings, the plugin won't work."
     71msgstr ""
     72
     73#: admin.php:166
     74msgid "The following settings let you configure the behaviour of this plugin."
     75msgstr ""
     76
     77#: admin.php:193
     78msgid "The maximum number of activities to import must be a number between 1 and 100."
     79msgstr ""
     80
     81#: admin.php:200
     82msgid "The maximum length of post title should be a number between 0 and 100."
     83msgstr ""
     84
     85#: admin.php:249
     86msgid "Save Changes"
     87msgstr ""
     88
     89#: admin.php:257
     90msgid "Manual mass import:"
     91msgstr ""
     92
     93#: admin.php:259
     94msgid "manually check for new activities and import them"
     95msgstr ""
     96
     97#: g-crossposting.php:89
    1698msgid "Once every 5 minutes"
    1799msgstr ""
    18100
    19 #: admin.php:24
    20 msgid "Manual import of Google+ activities done."
     101#: g-crossposting.php:327
     102msgid "This was posted on Google+&hellip;"
    21103msgstr ""
    22104
    23 #: admin.php:42 admin.php:226
    24 msgid "Google+ Crossposting Configuration"
     105#: g-crossposting.php:336
     106msgid "Google+ post: No title available&hellip;"
    25107msgstr ""
    26108
    27 #: admin.php:42
    28 msgid "Google+ Crossposting"
     109#. Plugin URI of the plugin/theme
     110msgid "http://wordpress.org/extend/plugins/g-crossposting/"
    29111msgstr ""
    30112
    31 #: admin.php:58
    32 msgid "Your Google+ ID"
     113#. Description of the plugin/theme
     114msgid "Imports your public Google+ activities in your Wordpress blog."
    33115msgstr ""
    34116
    35 #: admin.php:60
    36 msgid "Your Google API key"
     117#. Author of the plugin/theme
     118msgid "Sebastian Stein"
    37119msgstr ""
    38120
    39 #: admin.php:61
    40 msgid "Wordpress user to set as author of imported Google+ activities"
     121#. Author URI of the plugin/theme
     122msgid "http://sebstein.hpfsc.de/"
    41123msgstr ""
    42 
    43 #: admin.php:62
    44 msgid "Category to use for imported Google+ activities"
    45 msgstr ""
    46 
    47 #: admin.php:63
    48 msgid "Enable comments on imported Google+ activities"
    49 msgstr ""
    50 
    51 #: admin.php:64
    52 msgid "Maximum number of new activities to import"
    53 msgstr ""
    54 
    55 #: admin.php:65
    56 msgid "Add canonical meta tag pointing to Google+"
    57 msgstr ""
    58 
    59 #: admin.php:147
    60 msgid ""
    61 "The following settings specify your Google+ ID and your Google API key. "
    62 "Without those settings, the plugin won't work."
    63 msgstr ""
    64 
    65 #: admin.php:156
    66 msgid "The following settings let you configure the behaviour of this plugin."
    67 msgstr ""
    68 
    69 #: admin.php:168
    70 msgid "You provided an invalid Google+ ID."
    71 msgstr ""
    72 
    73 #: admin.php:175
    74 msgid "You provided an invalid Google API key."
    75 msgstr ""
    76 
    77 #: admin.php:182
    78 msgid ""
    79 "The maximum number of activities to import must be a number between 1 and "
    80 "100."
    81 msgstr ""
    82 
    83 #: admin.php:233
    84 msgid "Save Changes"
    85 msgstr ""
    86 
    87 #: admin.php:239
    88 msgid "Manual mass import:"
    89 msgstr ""
    90 
    91 #: admin.php:241
    92 msgid "manually check for new activities and import them"
    93 msgstr ""
  • g-crossposting/trunk/readme.txt

    r805313 r807770  
    11=== Google+ Crossposting ===
    22Contributors: sebstein
    3 Donate link: http://www.icrc.org/eng/
    4 Tags: google, googleplus, posts
     3Donate link: bitcoin:18dNV4mZyQMDdgd1ebe2Gm4f9MNZMLuNNb
     4Tags: google, googleplus, posts, g+
    55Requires at least: 3.0.0
    66Tested up to: 3.7.1
    7 Stable tag: 1.1.4
     7Stable tag: 1.2.0
    88
    99Imports your public Google+ activities in your Wordpress blog.
     
    103103== Changelog ==
    104104
     105= 1.2.0 =
     106
     107* plugin can now be translated
     108* provide German translation
     109
    105110= 1.1.4 =
    106111
Note: See TracChangeset for help on using the changeset viewer.