Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2008-01-18 19:26:52 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2008-01-18 19:26:52 (GMT)
commitce6f25538b8f04a60aaf6e3e9f0b2fa37f4be925 (patch)
tree22be4f3c8cacb3c8e3a73a058efeb4ab0eb61114
parent703d7a577f37968812b4fac6d608010d9cd13446 (diff)
done for the day
git-svn-id: http://mediamods.com/public-svn/camera-activity/tags/51@1017 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
-rwxr-xr-x_camera.sobin31344 -> 31344 bytes
-rw-r--r--constants.py25
-rw-r--r--po/Record.pot149
-rw-r--r--utils.py13
4 files changed, 107 insertions, 80 deletions
diff --git a/_camera.so b/_camera.so
index 943156a..7c606b1 100755
--- a/_camera.so
+++ b/_camera.so
Binary files differ
diff --git a/constants.py b/constants.py
index e30c03f..1c797eb 100644
--- a/constants.py
+++ b/constants.py
@@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-
import os
import gtk
-from gettext import gettext as _
+from gettext import gettext as gt
import sugar.graphics.style
from sugar.activity import activity
@@ -17,7 +17,7 @@ import pangocairo
class Constants:
- VERSION = 50
+ VERSION = 51
SERVICE = "org.laptop.Record"
IFACE = SERVICE
@@ -88,6 +88,9 @@ class Constants:
gfxPath = os.path.join(activity.get_bundle_path(), "gfx")
soundClick = os.path.join(gfxPath, 'photoShutter.wav')
+ istrsTest = {}
+ for i in range (0,10):
+ istrsTest[str(i)] = str(i)
istrActivityName = _('Record')
istrPhoto = _('Photo')
istrVideo = _('Video')
@@ -275,8 +278,10 @@ class Constants:
for i in range (0, longestTime):
self.createCountdownPng( i )
+ checkInternationalStrings()
- def createCountdownPng( self, num ):
+
+ def createCountdownPng(self, num):
todisk = True
rendered = False
@@ -330,4 +335,16 @@ class Constants:
else:
img.set_from_pixmap(pixmap, None)
- self.__class__.countdownImgs[int(num)] = img \ No newline at end of file
+ self.__class__.countdownImgs[int(num)] = img
+
+
+ def _(self, s):
+ i = s
+ try:
+ #test translating the string with many replacements
+ i = gt(s) % self.__class__.istrTests
+ except:
+ #if it doesn't work, revert
+ i = s
+
+ return i
diff --git a/po/Record.pot b/po/Record.pot
index ec7721d..eb956fc 100644
--- a/po/Record.pot
+++ b/po/Record.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-12-20 09:20-0500\n"
+"POT-Creation-Date: 2008-01-18 13:01-0500\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"
@@ -16,313 +16,314 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: activity/activity.info:2 constants.py:90
+#: activity/activity.info:2 constants.py:91
msgid "Record"
msgstr ""
-#: constants.py:91
+#: constants.py:92
msgid "Photo"
msgstr ""
-#: constants.py:92
+#: constants.py:93
msgid "Video"
msgstr ""
-#: constants.py:93
+#: constants.py:94
msgid "Audio"
msgstr ""
-#: constants.py:94
+#: constants.py:95
msgid "Time Lapse"
msgstr ""
-#: constants.py:95
+#: constants.py:96
msgid "Animation"
msgstr ""
-#: constants.py:96
+#: constants.py:97
msgid "Panorama"
msgstr ""
-#: constants.py:97
+#: constants.py:98
msgid "Interview"
msgstr ""
#. TRANS: photo by photographer, e.g., "Photo by Mary"
-#: constants.py:99
+#: constants.py:100
#, python-format
msgid "%(1)s by %(2)s"
msgstr ""
-#: constants.py:100
+#: constants.py:101
msgid "Title:"
msgstr ""
-#: constants.py:101
+#: constants.py:102
msgid "Recorder:"
msgstr ""
-#: constants.py:102
+#: constants.py:103
msgid "Date:"
msgstr ""
-#: constants.py:103
+#: constants.py:104
msgid "Tags:"
msgstr ""
-#: constants.py:104
+#: constants.py:105
msgid "Saving"
msgstr ""
-#: constants.py:105
+#: constants.py:106
msgid "Finished recording"
msgstr ""
-#: constants.py:106
+#: constants.py:107
#, python-format
msgid "%(1)s hours, %(2)s minutes, %(3)s seconds remaining"
msgstr ""
-#: constants.py:107
+#: constants.py:108
#, python-format
msgid "%(1)s minutes, %(2)s seconds remaining"
msgstr ""
-#: constants.py:108
+#: constants.py:109
#, python-format
msgid "%(1)s hours remaining"
msgstr ""
-#: constants.py:109
+#: constants.py:110
#, python-format
msgid "%(1)s minutes remaining"
msgstr ""
-#: constants.py:110
+#: constants.py:111
#, python-format
msgid "%(1)s seconds remaining"
msgstr ""
-#: constants.py:111
+#: constants.py:112
#, python-format
msgid "%(1)s hours"
msgstr ""
-#: constants.py:112 constants.py:121
+#: constants.py:113
#, python-format
msgid "%(1)s minutes"
msgstr ""
-#: constants.py:113 constants.py:120
+#: constants.py:114
#, python-format
msgid "%(1)s seconds"
msgstr ""
-#: constants.py:114
+#: constants.py:115
msgid "Remove"
msgstr ""
-#: constants.py:115
+#: constants.py:116
msgid "Stopped recording"
msgstr ""
-#: constants.py:116
+#: constants.py:117
msgid "Copy to clipboard"
msgstr ""
-#: constants.py:117
+#: constants.py:118
msgid "Timer:"
msgstr ""
-#: constants.py:118
+#: constants.py:119
msgid "Duration:"
msgstr ""
-#: constants.py:119
+#: constants.py:120
msgid "Immediate"
msgstr ""
-#: constants.py:122
+#: constants.py:121
msgid "Play"
msgstr ""
-#: constants.py:123
+#: constants.py:122
msgid "Pause"
msgstr ""
-#: constants.py:124
+#: constants.py:123
msgid "Add frame"
msgstr ""
-#: constants.py:125
+#: constants.py:124
msgid "Remove frame"
msgstr ""
-#: constants.py:126
+#: constants.py:125
#, python-format
msgid "%(1)s frames per second"
msgstr ""
-#: constants.py:127
+#: constants.py:126
msgid "Quality"
msgstr ""
-#: constants.py:128
+#: constants.py:127
msgid "Default"
msgstr ""
-#: constants.py:129
+#: constants.py:128
msgid "Best"
msgstr ""
-#: constants.py:130
+#: constants.py:129
msgid "High"
msgstr ""
-#: constants.py:131
+#: constants.py:130
msgid "Low"
msgstr ""
-#: constants.py:132
+#: constants.py:131
msgid "Large file"
msgstr ""
-#: constants.py:133
+#: constants.py:132
msgid "Small file"
msgstr ""
-#: constants.py:134
+#: constants.py:133
msgid "Silent"
msgstr ""
-#: constants.py:135
+#: constants.py:134
msgid "Rotate"
msgstr ""
-#: constants.py:136
+#: constants.py:135
msgid "Width"
msgstr ""
-#: constants.py:137
+#: constants.py:136
msgid "Height"
msgstr ""
-#: constants.py:138
+#: constants.py:137
msgid "Click to take picture"
msgstr ""
-#: constants.py:139
+#: constants.py:138
msgid "Click to add picture"
msgstr ""
#. TRANS: Downloading Photo from Mary
-#: constants.py:141
+#: constants.py:140
#, python-format
msgid "Downloading %(1)s from %(2)s"
msgstr ""
#. TRANS: Cannot download this Photo
-#: constants.py:143
+#: constants.py:142
#, python-format
msgid "Cannot download this %(1)s"
msgstr ""
#. TRANS: Save Photo to:
-#: constants.py:145
+#: constants.py:144
+#, python-format
msgid "Save %(1)s to:"
msgstr ""
-#: constants.py:146
+#: constants.py:145
#, python-format
msgid "Your %(1)s is full"
msgstr ""
-#: constants.py:147
+#: constants.py:146
msgid "Journal"
msgstr ""
-#: constants.py:148
+#: constants.py:147
msgid "USB"
msgstr ""
-#: constants.py:149
+#: constants.py:148
msgid "SD Card"
msgstr ""
-#: constants.py:150
+#: constants.py:149
msgid "Preferences"
msgstr ""
-#: constants.py:151
+#: constants.py:150
msgid "Free space:"
msgstr ""
#. TRANS: 7 photos
-#: constants.py:153
+#: constants.py:152
#, python-format
msgid "%(1)s photos"
msgstr ""
-#: constants.py:154
+#: constants.py:153
msgid "Bitrate"
msgstr ""
-#: constants.py:155
+#: constants.py:154
msgid "Maximum Bitrate"
msgstr ""
-#: constants.py:156
+#: constants.py:155
msgid "Minumum Bitrate"
msgstr ""
-#: constants.py:157
+#: constants.py:156
msgid "Manage Bitrate"
msgstr ""
-#: constants.py:158
+#: constants.py:157
msgid "Border"
msgstr ""
-#: constants.py:159
+#: constants.py:158
msgid "Center"
msgstr ""
-#: constants.py:160
+#: constants.py:159
msgid "Frames"
msgstr ""
-#: constants.py:161
+#: constants.py:160
msgid "Automatic keyframe detection"
msgstr ""
-#: constants.py:162
+#: constants.py:161
msgid "Force keyframe"
msgstr ""
-#: constants.py:163
+#: constants.py:162
msgid "Keyframe frequency"
msgstr ""
-#: constants.py:164
+#: constants.py:163
msgid "Keyframe minimum distance"
msgstr ""
-#: constants.py:165
+#: constants.py:164
msgid "Keyframe threshold"
msgstr ""
-#: constants.py:166
+#: constants.py:165
msgid "Noise Sensitivity"
msgstr ""
-#: constants.py:167
+#: constants.py:166
msgid "Quick"
msgstr ""
-#: constants.py:168
+#: constants.py:167
msgid "Sharpness"
msgstr ""
-#: constants.py:169
+#: constants.py:168
msgid "Capacity"
msgstr ""
diff --git a/utils.py b/utils.py
index dfdeb25..63d2ac8 100644
--- a/utils.py
+++ b/utils.py
@@ -88,7 +88,6 @@ def scaleSvgToDim( handle, dim ):
def getDateString( when ):
- #todo: internationalize the date
return strftime( "%a, %b %d, %I:%M:%S %p", time.localtime(when) )
@@ -115,4 +114,14 @@ def getFreespaceKb( ):
stat = os.statvfs("/home")
freebytes = stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL]
freekb = freebytes / 1024
- return freekb \ No newline at end of file
+ return freekb
+
+
+def getIStr( s, args ):
+ try:
+ iStr = _(s) % args
+ except:
+ iStr = s % args
+
+ return iStr
+