Skip to content

Commit

Permalink
fixed deprecated functions; added full gettext support, added German …
Browse files Browse the repository at this point in the history
…translation; minor readme additions; added temporary banner for wordpress.org
  • Loading branch information
cfoellmann committed Dec 12, 2012
1 parent d1acb6c commit a92f9ee
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/nbproject/private/
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -2,7 +2,9 @@ Better GitHub Widget
====================

A Wordpress widget to display your GitHub projects, it asks only for your
username.
username. [Better GitHub Widget@WordPress.org](https://wordpress.org/extend/plugins/better-github-widget/)

Translate at [https://translate.foe-services.de/projects/better-github-widget](https://translate.foe-services.de/projects/better-github-widget)

INSTALL
-------
Expand Down
Binary file added banner-772x250.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 14 additions & 11 deletions better-github-widget.php
@@ -1,13 +1,16 @@
<?php
/*
Plugin Name: Better GitHub Widget
Plugin URI: http://github.com/fracek/better-github-widget
Plugin URI: https://wordpress.org/extend/plugins/better-github-widget/
Description: Display your GitHub projects
Author: Francesco Ceccon
Version: 0.5.2
Author URI: http://francesco-cek.com
*/

$plugin_dir = basename(dirname(__FILE__));
load_plugin_textdomain( 'bg-wgt', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

/**
* A better Github widget that displays a list of your most recent
* active Github projects
Expand All @@ -25,7 +28,7 @@ function Better_GitHub_Widget() {
* PHP 5 constructor
*/
function __construct() {
$widget_ops = array('classname' => 'better-gh-widget', 'description' => __('Display your GitHub projects'));
$widget_ops = array('classname' => 'better-gh-widget', 'description' => __('Display your GitHub projects','bg-wgt'));
parent::__construct(
'better-gh-widget', // Base ID
'Better GitHub Widget', // Name
Expand Down Expand Up @@ -62,7 +65,7 @@ public function widget( $args, $instance ) {

// the list of repos
echo '<ul id="gh-repos">';
echo '<li id="gh-loading">Status updating...</li>';
echo '<li id="gh-loading">' . __('Status updating...','bg-wgt') . '</li>';
echo '</ul>';
echo '<script src="' . plugins_url('github.js', __FILE__) . '" type="text/javascript"> </script>';
?>
Expand Down Expand Up @@ -113,26 +116,26 @@ public function form( $instance ) {
$skip_forks = strip_tags($instance['skip_forks']);
$checked = ( $skip_forks ) ? 'checked="checked"' : '';

echo '<p><label for="'. $this->get_field_id('title') . '">' . __('title') . ':';
echo '<p><label for="'. $this->get_field_id('title') . '">' . __('Title','bg-wgt') . ':';
echo '<input class="widefat" id="' . $this->get_field_id('title') . '" ';
echo 'name="' . $this->get_field_name('title') . '" type="text" ';
echo 'value="' . attribute_escape($title) . '" title="Title of the widget as it appears on the page" />';
echo 'value="' . esc_attr($title) . '" title="' . __('Title of the widget as it appears on the page','bg-wgt') . '" />';
echo '</label></p>';

echo '<p><label for="'. $this->get_field_id('username') . '">' . __('Username') . ':';
echo '<p><label for="'. $this->get_field_id('username') . '">' . __('Username','bg-wgt') . ':';
echo '<input class="widefat" id="' . $this->get_field_id('username') . '" ';
echo 'name="' . $this->get_field_name('username') . '" type="text" ';
echo 'value="' . attribute_escape($username) . '" title="Your Github username"/>';
echo 'value="' . esc_attr($username) . '" title="' . __('Your Github username','bg-wgt') . '"/>';
echo '</label></p>';

echo '<p><label for="' . $this->get_field_id('count') . '">' . __('Number of projects to show') . ':';
echo '<p><label for="' . $this->get_field_id('count') . '">' . __('Number of projects to show','bg-wgt') . ':';
echo '<input class="widefat" id="' . $this->get_field_id('count') . '" ';
echo 'name="' . $this->get_field_name('count') . '" type="number" ';
echo 'value="' . attribute_escape($count) . '" title="0 for all." />';
echo '<br><small>' . __('Set to 0 to display all your projects</small>');
echo 'value="' . esc_attr($count) . '" title="0 for all." />';
echo '<br><small>' . __('Set to 0 to display all your projects','bg-wgt') . '</small>';
echo '</label></p>';

echo '<p><label for="' . $this->get_field_id('skip_forks') . '">' . __('Show Forked Repositories: ') . '</label>';
echo '<p><label for="' . $this->get_field_id('skip_forks') . '">' . __('Show Forked Repositories:','bg-wgt') . ' </label>';
echo '<input type="checkbox" name="' . $this->get_field_name('skip_forks') . '" value="1" ' . $checked . '/>';
echo '</p>';
}
Expand Down
Binary file added languages/bg-wgt-de_DE.mo
Binary file not shown.
47 changes: 47 additions & 0 deletions languages/bg-wgt-de_DE.po
@@ -0,0 +1,47 @@
# Translation of Better GitHub Widget in German
# This file is distributed under the same license as the Better GitHub Widget package.
msgid ""
msgstr ""
"PO-Revision-Date: 2012-12-12 12:49:28+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: GlotPress/0.1\n"
"Project-Id-Version: Better GitHub Widget\n"

#: better-github-widget.php:65
msgid "Status updating..."
msgstr "Status wird geupdatet..."

#: better-github-widget.php:116
msgid "Title"
msgstr "Titel"

#: better-github-widget.php:119
msgid "Title of the widget as it appears on the page"
msgstr "Titel des Widgets wie er auf der Seite dargestellt wird"

#: better-github-widget.php:122
msgid "Username"
msgstr "Benutzername"

#: better-github-widget.php:125
msgid "Your Github username"
msgstr "Dein GitHub Benutzername"

#: better-github-widget.php:128
msgid "Number of projects to show"
msgstr "Anzahl der anzuzeigenden Projekte"

#: better-github-widget.php:132
msgid "Set to 0 to display all your projects"
msgstr "Setze 0 ein um alle Projekte anzuzeigen"

#: better-github-widget.php:135
msgid "Show Forked Repositories:"
msgstr "Forked Repositories anzeigen:"

#: better-github-widget.php:28
msgid "Display your GitHub projects"
msgstr "Zeige deine GitHub Projekte an"
53 changes: 53 additions & 0 deletions languages/bg-wgt.pot
@@ -0,0 +1,53 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-12-12 13:31+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: better-github-widget.php:28
msgid "Display your GitHub projects"
msgstr ""

#: better-github-widget.php:65
msgid "Status updating..."
msgstr ""

#: better-github-widget.php:116
msgid "Title"
msgstr ""

#: better-github-widget.php:119
msgid "Title of the widget as it appears on the page"
msgstr ""

#: better-github-widget.php:122
msgid "Username"
msgstr ""

#: better-github-widget.php:125
msgid "Your Github username"
msgstr ""

#: better-github-widget.php:128
msgid "Number of projects to show"
msgstr ""

#: better-github-widget.php:132
msgid "Set to 0 to display all your projects"
msgstr ""

#: better-github-widget.php:135
msgid "Show Forked Repositories:"
msgstr ""
7 changes: 7 additions & 0 deletions nbproject/project.properties
@@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_54
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=true
web.root=.
9 changes: 9 additions & 0 deletions nbproject/project.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>better-github-widget</name>
</data>
</configuration>
</project>

0 comments on commit a92f9ee

Please sign in to comment.