Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Commit

Permalink
Version 2.2: Added localization support
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsabbagh committed Jun 5, 2017
1 parent 6e005d1 commit db6c057
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 30 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ This is a recording sample for DOTA 2 running on Wayland: [https://www.youtube.c

Please, consider supporting us on Patreon if you like the software. More features and new versions would be released with each goal we achieve there: https://www.patreon.com/greenproject

### Localization

Green Recorder supports localization. If you want to translate the program into your language, fork the repository on GitHub and create a new file under "po" folder with your language ISO code (like fr.po, de.po, cs.po..). And translate the strings from there.

Alternatively, you can open the green-recorder.pot file using programs like PoEdit and start translating.

## Download

### Ubuntu 16.04/16.10/17.04/17.10 or Linux Mint 18/18.1
Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
green-recorder (2.2) zesty; urgency=low

* Added localization support.
* Added Arabic language.
* Changed window opacity to 1.00

-- M.Hanny Sabbagh <[email protected]> Tue, 6 Jun 2017 00:33:33 +0200

green-recorder (2.1.5) zesty; urgency=low

* Another try to fix #25.
Expand Down
58 changes: 32 additions & 26 deletions green-recorder
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ gi.require_version('AppIndicator3', '0.1')

from gi.repository import Gtk, Gdk, GLib, AppIndicator3 as appindicator
from pydbus import SessionBus
import subprocess, signal, threading, datetime, urllib
import subprocess, signal, threading, datetime, urllib, gettext, locale

# Localization.
locale.setlocale(locale.LC_ALL, '')
gettext.bindtextdomain('green-recorder', '/usr/share/locale')
gettext.textdomain('green-recorder')
_ = gettext.gettext
gettext.install("green-recorder", "/usr/share/locale")

# Define a loop and connect to the session bus. This is for Wayland recording under GNOME Shell.
loop = GLib.MainLoop()
Expand Down Expand Up @@ -169,7 +176,7 @@ def stoprecording(self):

# Import the glade file and its widgets.
builder = Gtk.Builder()
builder.add_from_file("ui/ui.glade")
builder.add_from_file("/usr/share/green-recorder/ui.glade")

# Create pointers.
window = builder.get_object("window1")
Expand All @@ -196,41 +203,40 @@ delayvalue = builder.get_object("spinbutton2")
expander = builder.get_object("expandertext")

# Assign the texts to the interface
# TODO: support internationalization using gettext.
window.set_title("Green Recorder")
areachooser.set_name('AreaChooser')
window.set_title(_("Green Recorder"))
areachooser.set_name(_('AreaChooser'))
window.connect("delete-event", Gtk.main_quit,)
folderchooser.set_uri("file://" + VideosFolder)
filenameentry.set_placeholder_text("File Name (Will be overwritten)..")
commandentry.set_placeholder_text("Enter your command here..")
formatchooser.append("mkv", "MKV (Matroska multimedia container format)")
formatchooser.append("avi", "AVI (Audio Video Interleaved)")
formatchooser.append("mp4", "MP4 (MPEG-4 Part 14)")
formatchooser.append("wmv", "WMV (Windows Media Video)")
formatchooser.append("nut", "NUT (NUT Recording Format)")
filenameentry.set_placeholder_text(_("File Name (Will be overwritten).."))
commandentry.set_placeholder_text(_("Enter your command here.."))
formatchooser.append("mkv", _("MKV (Matroska multimedia container format)"))
formatchooser.append("avi", _("AVI (Audio Video Interleaved)"))
formatchooser.append("mp4", _("MP4 (MPEG-4 Part 14)"))
formatchooser.append("wmv", _("WMV (Windows Media Video)"))
formatchooser.append("nut", _("NUT (NUT Recording Format)"))
formatchooser.set_active(0)
videocheck.set_label("Record Video")
microphonecheck.set_label("Record Microphone")
mousecheck.set_label("Show Mouse")
followmousecheck.set_label("Follow Mouse")
videocheck.set_label(_("Record Video"))
microphonecheck.set_label(_("Record Microphone"))
mousecheck.set_label(_("Show Mouse"))
followmousecheck.set_label(_("Follow Mouse"))
aboutdialog.set_transient_for(window)
aboutdialog.set_program_name("Green Recorder")
aboutdialog.set_version("2.1")
aboutdialog.set_program_name(_("Green Recorder"))
aboutdialog.set_version("2.2")
aboutdialog.set_copyright("© 2017 Green Project")
aboutdialog.set_wrap_license(True)
aboutdialog.set_license("Green Recorder is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nGreen Recorder is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\nSee the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Green Recorder. If not, see <http://www.gnu.org/licenses/>.")
aboutdialog.set_comments("An easy to use yet strong desktop recorder.")
aboutdialog.set_comments(_("An easy to use desktop recorder for Xorg and Wayland."))
aboutdialog.set_authors(['M.Hanny Sabbagh <[email protected]>'])
aboutdialog.set_artists(['Mustapha Assabar'])
aboutdialog.set_website("https://github.com/green-project/green-recorder")
aboutdialog.set_logo_icon_name("green-recorder")
windowgrabbutton.set_label("Select a Window")
areagrabbutton.set_label("Select an Area")
expander.set_label("Advanced:")
frametext.set_label("Frames:")
delaytext.set_label("Delay:")
audioservertext.set_label("Audio Input:")
commandtext.set_label("Run Command After Recording:")
windowgrabbutton.set_label(_("Select a Window"))
areagrabbutton.set_label(_("Select an Area"))
expander.set_label(_("Advanced:"))
frametext.set_label(_("Frames:"))
delaytext.set_label(_("Delay:"))
audioservertext.set_label(_("Audio Input:"))
commandtext.set_label(_("Run Command After Recording:"))
# Make default checkboxes True.
videocheck.set_active(True)
microphonecheck.set_active(True)
Expand Down
10 changes: 7 additions & 3 deletions green-recorder.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Name: green-recorder
Summary: A simple yet functional desktop recorder for Linux systems. Supports both Xorg server and Wayland (GNOME).
URL: https://green-project.github.io
Version: 2.1.5
Version: 2.2
Release: 1%{?dist}
Source: https://github.com/%{owner}/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
License: GPLv3
Expand All @@ -15,10 +15,9 @@ Requires: ffmpeg
Requires: gawk
Requires: libappindicator-gtk3
Requires: python2-urllib3
Requires: rpmfusion-free-release

%description
A simple yet functional desktop recorder for Linux systems. Supports both Xorg server and Wayland (GNOME).
A simple desktop recorder for Linux systems. Supports both Xorg server and Wayland (GNOME).

%prep
%autosetup -n %{name}-%{version}
Expand All @@ -37,6 +36,11 @@ python setup.py install -O1 --root=$RPM_BUILD_ROOT
%{_datadir}/pixmaps/%{name}.png

%changelog
* Tue Jun 6 2017 M.Hanny Sabbagh <[email protected]> 2.2
- Added localization support.
- Added Arabic language.
- Changed window opacity to 1.00

* Thu Apr 27 2017 M.Hanny Sabbagh <[email protected]> 2.1.5
- Fix bug #25.

Expand Down
103 changes: 103 additions & 0 deletions po/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Green Recorder
# Copyright (C) 2017, Green Project
# This file is distributed under the same license as the green-recorder package.
# M.Hanny Sabbagh <[email protected]>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-06 00:29+0300\n"
"PO-Revision-Date: 2017-06-06 00:31+0300\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.1\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n"
"Language: ar\n"

#: green-recorder:206 green-recorder:223
msgid "Green Recorder"
msgstr "المسجّل الأخضر"

#: green-recorder:207
msgid "AreaChooser"
msgstr "محدد المنطقة"

#: green-recorder:210
msgid "File Name (Will be overwritten).."
msgstr "اسم الملف (سيتم الكتابة فوقه)"

#: green-recorder:211
msgid "Enter your command here.."
msgstr "قم بإدخال الأمر هنا"

#: green-recorder:212
msgid "MKV (Matroska multimedia container format)"
msgstr "MKV (Matroska multimedia container format)"

#: green-recorder:213
msgid "AVI (Audio Video Interleaved)"
msgstr "AVI (Audio Video Interleaved)"

#: green-recorder:214
msgid "MP4 (MPEG-4 Part 14)"
msgstr "MP4 (MPEG-4 Part 14)"

#: green-recorder:215
msgid "WMV (Windows Media Video)"
msgstr "WMV (Windows Media Video)"

#: green-recorder:216
msgid "NUT (NUT Recording Format)"
msgstr "NUT (NUT Recording Format)"

#: green-recorder:218
msgid "Record Video"
msgstr "تسجيل الفيديو"

#: green-recorder:219
msgid "Record Microphone"
msgstr "تسجيل الميكروفون"

#: green-recorder:220
msgid "Show Mouse"
msgstr "إظهار الفأرة"

#: green-recorder:221
msgid "Follow Mouse"
msgstr "اتّباع الفأرة"

#: green-recorder:228
msgid "An easy to use desktop recorder for Xorg and Wayland."
msgstr "مسجل سطح مكتب سهل لـXorg وWayland."

#: green-recorder:233
msgid "Select a Window"
msgstr "اختيار نافذة"

#: green-recorder:234
msgid "Select an Area"
msgstr "تحديد منطقة"

#: green-recorder:235
msgid "Advanced:"
msgstr "متقدّم:"

#: green-recorder:236
msgid "Frames:"
msgstr "الإطارات"

#: green-recorder:237
msgid "Delay:"
msgstr "التأخير:"

#: green-recorder:238
msgid "Audio Input:"
msgstr "مدخل الصوت:"

#: green-recorder:239
msgid "Run Command After Recording:"
msgstr "تشغيل أمر عند الانتهاء:"
103 changes: 103 additions & 0 deletions po/green-recorder.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Green Recorder
# Copyright (C) 2017, Green Project
# This file is distributed under the same license as the green-recorder package.

# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-06 00:23+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: green-recorder:206 green-recorder:223
msgid "Green Recorder"
msgstr ""

#: green-recorder:207
msgid "AreaChooser"
msgstr ""

#: green-recorder:210
msgid "File Name (Will be overwritten).."
msgstr ""

#: green-recorder:211
msgid "Enter your command here.."
msgstr ""

#: green-recorder:212
msgid "MKV (Matroska multimedia container format)"
msgstr ""

#: green-recorder:213
msgid "AVI (Audio Video Interleaved)"
msgstr ""

#: green-recorder:214
msgid "MP4 (MPEG-4 Part 14)"
msgstr ""

#: green-recorder:215
msgid "WMV (Windows Media Video)"
msgstr ""

#: green-recorder:216
msgid "NUT (NUT Recording Format)"
msgstr ""

#: green-recorder:218
msgid "Record Video"
msgstr ""

#: green-recorder:219
msgid "Record Microphone"
msgstr ""

#: green-recorder:220
msgid "Show Mouse"
msgstr ""

#: green-recorder:221
msgid "Follow Mouse"
msgstr ""

#: green-recorder:228
msgid "An easy to use desktop recorder for Xorg and Wayland."
msgstr ""

#: green-recorder:233
msgid "Select a Window"
msgstr ""

#: green-recorder:234
msgid "Select an Area"
msgstr ""

#: green-recorder:235
msgid "Advanced:"
msgstr ""

#: green-recorder:236
msgid "Frames:"
msgstr ""

#: green-recorder:237
msgid "Delay:"
msgstr ""

#: green-recorder:238
msgid "Audio Input:"
msgstr ""

#: green-recorder:239
msgid "Run Command After Recording:"
msgstr ""
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
#!/usr/bin/python
from distutils.core import setup
from subprocess import call
from glob import glob
from os.path import splitext, split

data_files = [ ("share/green-recorder", ["ui/ui.glade"]),
("share/pixmaps", ["data/green-recorder.png"]),
("share/applications", ["data/green-recorder.desktop"]) ]

po_files = glob("po/*.po")
for po_file in po_files:
lang = splitext(split(po_file)[1])[0]
mo_path = "locale/{}/LC_MESSAGES/green-recorder.mo".format(lang)
call("mkdir -p locale/{}/LC_MESSAGES/".format(lang), shell=True)
call("msgfmt {} -o {}".format(po_file, mo_path), shell=True)
locales = map(lambda i: ('share/'+i, [i+'/green-recorder.mo', ]), glob('locale/*/LC_MESSAGES'))

data_files.extend(locales)

setup(name = "green-recorder",
version = "2.1.5",
version = "2.2",
description = "Record your desktop easily using a simple GUI",
author = "Green Project",
author_email = "[email protected]",
Expand Down

0 comments on commit db6c057

Please sign in to comment.