diff options
author | Alan Aguiar <alanjas@hotmail.com> | 2012-03-26 17:50:15 (GMT) |
---|---|---|
committer | Alan Aguiar <alanjas@hotmail.com> | 2012-03-26 17:50:15 (GMT) |
commit | 603cc0e0ac4e6fac332abb269cf426460c8c158f (patch) | |
tree | f295317ecc121ea2105598e7d7501ed951bab140 /timelinelib | |
parent | 1385309cbe5527d021c43258d193629d10f2e2a6 (diff) |
add gettext to some files
Diffstat (limited to 'timelinelib')
34 files changed, 38 insertions, 2 deletions
diff --git a/timelinelib/calendar/monthnames.py b/timelinelib/calendar/monthnames.py index 27b3a47..6302174 100644 --- a/timelinelib/calendar/monthnames.py +++ b/timelinelib/calendar/monthnames.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Timeline. If not, see <http://www.gnu.org/licenses/>. +from gettext import gettext as _ ENGLISH_MONTH_NAMES = [ "January", @@ -47,7 +48,8 @@ ABBREVIATED_ENGLISH_MONTH_NAMES = [ _("Nov"), _("Dec"), ] -del _ + +#del _ def month_from_english_name(month_name): diff --git a/timelinelib/calendar/weekdaynames.py b/timelinelib/calendar/weekdaynames.py index cc1f182..240779c 100644 --- a/timelinelib/calendar/weekdaynames.py +++ b/timelinelib/calendar/weekdaynames.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Timeline. If not, see <http://www.gnu.org/licenses/>. +from gettext import gettext as _ def _(message): return message # deferred translation ABBREVIATED_WEEKDAY_NAMES = [ @@ -26,8 +27,8 @@ ABBREVIATED_WEEKDAY_NAMES = [ _("Sat"), _("Sun"), ] -del _ +#del _ def abbreviated_name_of_weekday(weekday): return _(ABBREVIATED_WEEKDAY_NAMES[weekday]) diff --git a/timelinelib/db/__init__.py b/timelinelib/db/__init__.py index 79b8abe..c36eae4 100644 --- a/timelinelib/db/__init__.py +++ b/timelinelib/db/__init__.py @@ -32,6 +32,7 @@ from timelinelib.db.backends.memory import MemoryDB from timelinelib.db.interface import TimelineIOError from timelinelib.drawing.viewproperties import ViewProperties +from gettext import gettext as _ def db_open(path, use_wide_date_range=False): """ diff --git a/timelinelib/db/backends/dir.py b/timelinelib/db/backends/dir.py index ec679a6..d0e9ef2 100644 --- a/timelinelib/db/backends/dir.py +++ b/timelinelib/db/backends/dir.py @@ -36,6 +36,7 @@ from timelinelib.db.backends.memory import MemoryDB from timelinelib.db.objects import Event from timelinelib.db.objects import Category +from gettext import gettext as _ class DirTimeline(MemoryDB): diff --git a/timelinelib/db/backends/file.py b/timelinelib/db/backends/file.py index e59eb35..6c14f06 100644 --- a/timelinelib/db/backends/file.py +++ b/timelinelib/db/backends/file.py @@ -46,6 +46,7 @@ from timelinelib.utils import ex_msg ENCODING = "utf-8" +from gettext import gettext as _ class ParseException(Exception): """Thrown if parsing of data read from file fails.""" diff --git a/timelinelib/db/backends/ics.py b/timelinelib/db/backends/ics.py index e10c77f..26e699f 100644 --- a/timelinelib/db/backends/ics.py +++ b/timelinelib/db/backends/ics.py @@ -47,6 +47,7 @@ from timelinelib.meta.version import get_version from timelinelib.time import PyTimeType from timelinelib.utils import ex_msg +from gettext import gettext as _ class IcsTimeline(TimelineDB): diff --git a/timelinelib/db/backends/memory.py b/timelinelib/db/backends/memory.py index cf1dec0..19f56bb 100644 --- a/timelinelib/db/backends/memory.py +++ b/timelinelib/db/backends/memory.py @@ -39,6 +39,7 @@ from timelinelib.db.objects import Category from timelinelib.db.utils import IdCounter from timelinelib.db.utils import generic_event_search +from gettext import gettext as _ class MemoryDB(TimelineDB): diff --git a/timelinelib/db/backends/xmlfile.py b/timelinelib/db/backends/xmlfile.py index 4988b06..0721fd5 100644 --- a/timelinelib/db/backends/xmlfile.py +++ b/timelinelib/db/backends/xmlfile.py @@ -54,6 +54,7 @@ INDENT1 = " " INDENT2 = " " INDENT3 = " " +from gettext import gettext as _ # Must be defined before the XmlTimeline class since it is used as a decorator def wrap_in_tag(func, name, indent=""): diff --git a/timelinelib/db/objects.py b/timelinelib/db/objects.py index 77a8d5f..374720e 100644 --- a/timelinelib/db/objects.py +++ b/timelinelib/db/objects.py @@ -20,6 +20,7 @@ Objects that can be read from and written to a timeline database. """ +from gettext import gettext as _ class Event(object): """ diff --git a/timelinelib/db/tutorial.py b/timelinelib/db/tutorial.py index bbc06fc..3b3a307 100644 --- a/timelinelib/db/tutorial.py +++ b/timelinelib/db/tutorial.py @@ -24,6 +24,7 @@ from timelinelib.db.objects import Event from timelinelib.db.objects import TimePeriod from timelinelib.db.backends.memory import MemoryDB +from gettext import gettext as _ def create_in_memory_tutorial_db(): tutcreator = TutorialTimelineCreator() diff --git a/timelinelib/db/utils.py b/timelinelib/db/utils.py index 4163e31..37fe11f 100644 --- a/timelinelib/db/utils.py +++ b/timelinelib/db/utils.py @@ -22,6 +22,7 @@ import os.path from timelinelib.db.interface import TimelineIOError +from gettext import gettext as _ class IdCounter(object): diff --git a/timelinelib/editors/event.py b/timelinelib/editors/event.py index 7506bae..5140442 100644 --- a/timelinelib/editors/event.py +++ b/timelinelib/editors/event.py @@ -23,6 +23,7 @@ from timelinelib.db.objects import TimePeriod from timelinelib.utils import ex_msg from timelinelib.repositories.dbwrapper import DbWrapperEventRepository +from gettext import gettext as _ class EventEditor(object): diff --git a/timelinelib/help/pages.py b/timelinelib/help/pages.py index b327729..485197f 100644 --- a/timelinelib/help/pages.py +++ b/timelinelib/help/pages.py @@ -28,6 +28,7 @@ Template for translator comments (should be before all body parts): # Dashes produce bullet lists. DON'T remove them. """ +from gettext import gettext as _ def install(help_system): diff --git a/timelinelib/help/system.py b/timelinelib/help/system.py index fc86d12..d7f340a 100644 --- a/timelinelib/help/system.py +++ b/timelinelib/help/system.py @@ -35,6 +35,7 @@ Usage: import re from markdown import markdown +from gettext import gettext as _ class HelpSystem(object): diff --git a/timelinelib/printing.py b/timelinelib/printing.py index 2dff446..ef3d402 100644 --- a/timelinelib/printing.py +++ b/timelinelib/printing.py @@ -18,6 +18,7 @@ import wx +from gettext import gettext as _ class TimelinePrintout(wx.Printout): """ diff --git a/timelinelib/time/numtime.py b/timelinelib/time/numtime.py index ab898cc..0824de9 100644 --- a/timelinelib/time/numtime.py +++ b/timelinelib/time/numtime.py @@ -27,6 +27,7 @@ from timelinelib.drawing.interface import Strip from timelinelib.drawing.utils import get_default_font from timelinelib.db.objects import TimePeriod +from gettext import gettext as _ class NumTimeType(TimeType): diff --git a/timelinelib/time/pytime.py b/timelinelib/time/pytime.py index f767ebe..ff17c86 100644 --- a/timelinelib/time/pytime.py +++ b/timelinelib/time/pytime.py @@ -37,6 +37,7 @@ from timelinelib.time.typeinterface import TimeType US_PER_SEC = 1000000 US_PER_DAY = 24 * 60 * 60 * US_PER_SEC +from gettext import gettext as _ class PyTimeType(TimeType): diff --git a/timelinelib/time/wxtime.py b/timelinelib/time/wxtime.py index 952eb0c..6710c9c 100644 --- a/timelinelib/time/wxtime.py +++ b/timelinelib/time/wxtime.py @@ -41,6 +41,8 @@ US_PER_DAY = 24 * 60 * 60 * US_PER_SEC MIN_YEAR = -4700 MAX_YEAR = 120000 +from gettext import gettext as _ + class WxTimeType(TimeType): def __eq__(self, other): diff --git a/timelinelib/view/drawingarea.py b/timelinelib/view/drawingarea.py index 78e473e..8533d06 100644 --- a/timelinelib/view/drawingarea.py +++ b/timelinelib/view/drawingarea.py @@ -43,6 +43,7 @@ SCROLL_ZONE_WIDTH = 20 LEFT_RIGHT_SCROLL_FACTOR = 1 / 200.0 MOUSE_SCROLL_FACTOR = 1 / 10.0 +from gettext import gettext as _ class DrawingArea(object): diff --git a/timelinelib/view/move.py b/timelinelib/view/move.py index 09eb67d..be7824f 100644 --- a/timelinelib/view/move.py +++ b/timelinelib/view/move.py @@ -18,6 +18,7 @@ from timelinelib.view.scrollbase import ScrollViewInputHandler +from gettext import gettext as _ class MoveByDragInputHandler(ScrollViewInputHandler): diff --git a/timelinelib/view/resize.py b/timelinelib/view/resize.py index 730b2a2..336a1c3 100644 --- a/timelinelib/view/resize.py +++ b/timelinelib/view/resize.py @@ -21,6 +21,7 @@ import wx from timelinelib.db.objects import PeriodTooLongError from timelinelib.view.scrollbase import ScrollViewInputHandler +from gettext import gettext as _ class ResizeByDragInputHandler(ScrollViewInputHandler): diff --git a/timelinelib/view/zoom.py b/timelinelib/view/zoom.py index 6671780..8950dde 100644 --- a/timelinelib/view/zoom.py +++ b/timelinelib/view/zoom.py @@ -18,6 +18,7 @@ from timelinelib.view.periodbase import SelectPeriodByDragInputHandler +from gettext import gettext as _ class ZoomByDragInputHandler(SelectPeriodByDragInputHandler): diff --git a/timelinelib/wxgui/components/cattree.py b/timelinelib/wxgui/components/cattree.py index 35b53d0..27982f4 100644 --- a/timelinelib/wxgui/components/cattree.py +++ b/timelinelib/wxgui/components/cattree.py @@ -30,6 +30,7 @@ import timelinelib.wxgui.utils as gui_utils NO_CHECKBOX_TYPE = 0 CHECKBOX_TYPE = 1 +from gettext import gettext as _ class CategoriesTree(customtreectrl.CustomTreeCtrl): diff --git a/timelinelib/wxgui/components/search.py b/timelinelib/wxgui/components/search.py index e436d79..9d8a6fa 100644 --- a/timelinelib/wxgui/components/search.py +++ b/timelinelib/wxgui/components/search.py @@ -22,6 +22,7 @@ import wx from timelinelib.config.paths import ICONS_DIR +from gettext import gettext as _ class SearchBar(wx.ToolBar): diff --git a/timelinelib/wxgui/components/wxdatetimepicker.py b/timelinelib/wxgui/components/wxdatetimepicker.py index 1d3e541..55432da 100644 --- a/timelinelib/wxgui/components/wxdatetimepicker.py +++ b/timelinelib/wxgui/components/wxdatetimepicker.py @@ -25,6 +25,7 @@ from timelinelib.time import try_to_create_wx_date_time_from_dmy from timelinelib.time import WxTimeType from timelinelib.wxgui.utils import _display_error_message +from gettext import gettext as _ class WxDateTimePicker(wx.Panel): diff --git a/timelinelib/wxgui/dialogs/categorieseditor.py b/timelinelib/wxgui/dialogs/categorieseditor.py index af8980a..9038554 100644 --- a/timelinelib/wxgui/dialogs/categorieseditor.py +++ b/timelinelib/wxgui/dialogs/categorieseditor.py @@ -25,6 +25,7 @@ from timelinelib.wxgui.components.cattree import add_category from timelinelib.wxgui.components.cattree import edit_category from timelinelib.wxgui.components.cattree import delete_category +from gettext import gettext as _ class CategoriesEditor(wx.Dialog): """ diff --git a/timelinelib/wxgui/dialogs/duplicateevent.py b/timelinelib/wxgui/dialogs/duplicateevent.py index fd5d11d..2bc44fc 100644 --- a/timelinelib/wxgui/dialogs/duplicateevent.py +++ b/timelinelib/wxgui/dialogs/duplicateevent.py @@ -24,6 +24,7 @@ from timelinelib.wxgui.utils import _display_error_message from timelinelib.editors.duplicateevent import DuplicateEventEditor import timelinelib.wxgui.utils as gui_utils +from gettext import gettext as _ class DuplicateEventDialog(wx.Dialog): diff --git a/timelinelib/wxgui/dialogs/eventeditor.py b/timelinelib/wxgui/dialogs/eventeditor.py index 1c8d5de..e589748 100644 --- a/timelinelib/wxgui/dialogs/eventeditor.py +++ b/timelinelib/wxgui/dialogs/eventeditor.py @@ -31,6 +31,7 @@ from timelinelib.wxgui.utils import time_picker_for import timelinelib.wxgui.utils as gui_utils from timelinelib.repositories.dbwrapper import DbWrapperEventRepository +from gettext import gettext as _ class EventEditorDialog(wx.Dialog): diff --git a/timelinelib/wxgui/dialogs/helpbrowser.py b/timelinelib/wxgui/dialogs/helpbrowser.py index de9f171..4836dcb 100644 --- a/timelinelib/wxgui/dialogs/helpbrowser.py +++ b/timelinelib/wxgui/dialogs/helpbrowser.py @@ -25,6 +25,7 @@ from timelinelib.config.paths import HELP_RESOURCES_DIR from timelinelib.config.paths import ICONS_DIR from timelinelib.wxgui.utils import _display_error_message +from gettext import gettext as _ class HelpBrowser(wx.Frame): diff --git a/timelinelib/wxgui/dialogs/mainframe.py b/timelinelib/wxgui/dialogs/mainframe.py index 4cf7018..63a08f7 100644 --- a/timelinelib/wxgui/dialogs/mainframe.py +++ b/timelinelib/wxgui/dialogs/mainframe.py @@ -50,6 +50,7 @@ from timelinelib.wxgui.utils import WildcardHelper import timelinelib.printing as printing import timelinelib.wxgui.utils as gui_utils +from gettext import gettext as _ class MainFrame(wx.Frame): diff --git a/timelinelib/wxgui/dialogs/preferences.py b/timelinelib/wxgui/dialogs/preferences.py index cb2d280..f94d7c1 100644 --- a/timelinelib/wxgui/dialogs/preferences.py +++ b/timelinelib/wxgui/dialogs/preferences.py @@ -21,6 +21,7 @@ import wx from timelinelib.config.preferences import PreferencesEditor from timelinelib.wxgui.utils import BORDER +from gettext import gettext as _ class PreferencesDialog(wx.Dialog): diff --git a/timelinelib/wxgui/dialogs/textdisplay.py b/timelinelib/wxgui/dialogs/textdisplay.py index cbc0713..96f08ec 100644 --- a/timelinelib/wxgui/dialogs/textdisplay.py +++ b/timelinelib/wxgui/dialogs/textdisplay.py @@ -20,6 +20,7 @@ from timelinelib.wxgui.utils import BORDER import wx +from gettext import gettext as _ class TextDisplayDialog(wx.Dialog): diff --git a/timelinelib/wxgui/dialogs/timeeditor.py b/timelinelib/wxgui/dialogs/timeeditor.py index f3493cc..b7d0e37 100644 --- a/timelinelib/wxgui/dialogs/timeeditor.py +++ b/timelinelib/wxgui/dialogs/timeeditor.py @@ -23,6 +23,7 @@ from timelinelib.wxgui.utils import _display_error_message from timelinelib.wxgui.utils import time_picker_for from timelinelib.utils import ex_msg +from gettext import gettext as _ class TimeEditorDialog(wx.Dialog): diff --git a/timelinelib/wxgui/utils.py b/timelinelib/wxgui/utils.py index 0038e02..b14a0f3 100644 --- a/timelinelib/wxgui/utils.py +++ b/timelinelib/wxgui/utils.py @@ -28,6 +28,7 @@ BORDER = 5 # Used by dialogs as a return code when a TimelineIOError has been raised ID_ERROR = wx.NewId() +from gettext import gettext as _ class WildcardHelper(object): |