64 mainMenu.addMenu(self.__initHumanizeMenu()) |
64 mainMenu.addMenu(self.__initHumanizeMenu()) |
65 mainMenu.addMenu(self.__initWebDesignMenu()) |
65 mainMenu.addMenu(self.__initWebDesignMenu()) |
66 mainMenu.addMenu(self.__initStaticMenu()) |
66 mainMenu.addMenu(self.__initStaticMenu()) |
67 mainMenu.addMenu(self.__initCommentsMenu()) |
67 mainMenu.addMenu(self.__initCommentsMenu()) |
68 mainMenu.addMenu(self.__initInternationalizationMenu()) |
68 mainMenu.addMenu(self.__initInternationalizationMenu()) |
69 mainMenu.addMenu(self.__initlocalizationMenu()) |
69 mainMenu.addMenu(self.__initLocalizationMenu()) |
70 mainMenu.addMenu(self.__initTimezoneMenu()) |
70 mainMenu.addMenu(self.__initTimezoneMenu()) |
71 |
71 |
72 def __initTagsMenu(self): |
72 def __initTagsMenu(self): |
73 """ |
73 """ |
74 Private method to initialize the tags menu. |
74 Private method to initialize the tags menu. |
586 mainMenu.addMenu(menu) |
586 mainMenu.addMenu(menu) |
587 |
587 |
588 self.__internationalizationMenu = mainMenu |
588 self.__internationalizationMenu = mainMenu |
589 return mainMenu |
589 return mainMenu |
590 |
590 |
591 def __initlocalizationMenu(self): |
591 def __initLocalizationMenu(self): |
592 """ |
592 """ |
593 Private method to initialize the static menu. |
593 Private method to initialize the static menu. |
594 |
594 |
595 @return generated menu (QMenu) |
595 @return generated menu (QMenu) |
596 """ |
596 """ |
1541 templateText = '{% load tz %}' |
1541 templateText = '{% load tz %}' |
1542 ## Tags ## |
1542 ## Tags ## |
1543 elif tag == "localtime_on": |
1543 elif tag == "localtime_on": |
1544 templateText = ( |
1544 templateText = ( |
1545 '{{% localtime on %}}{0}{{% endlocaltime %}}'.format( |
1545 '{{% localtime on %}}{0}{{% endlocaltime %}}'.format( |
1546 selectedText)) |
1546 selectedText)) |
1547 replace = True |
1547 replace = True |
1548 elif tag == "localtime_off": |
1548 elif tag == "localtime_off": |
1549 templateText = ( |
1549 templateText = ( |
1550 '{{% localtime off %}}{0}{{% endlocaltime %}}'.format( |
1550 '{{% localtime off %}}{0}{{% endlocaltime %}}'.format( |
1551 selectedText)) |
1551 selectedText)) |
1552 replace = True |
1552 replace = True |
1553 elif tag == "timezone_set": |
1553 elif tag == "timezone_set": |
1554 from .TimezoneSelectionDialog import TimezoneSelectionDialog |
1554 from .TimezoneSelectionDialog import TimezoneSelectionDialog |
1555 timezone, ok = TimezoneSelectionDialog.getTimezone() |
1555 timezone, ok = TimezoneSelectionDialog.getTimezone() |
1556 if ok: |
1556 if ok: |
1557 templateText = ( |
1557 templateText = ( |
1558 '{{% timezone "{0}" %}}{1}{{% endtimezone %}}'.format( |
1558 '{{% timezone "{0}" %}}{1}{{% endtimezone %}}'.format( |
1559 timezone, selectedText)) |
1559 timezone, selectedText)) |
1560 replace = True |
1560 replace = True |
1561 elif tag == "timezone_unset": |
1561 elif tag == "timezone_unset": |
1562 templateText = ( |
1562 templateText = ( |
1563 '{{% timezone None %}}{0}{{% endlocaltime %}}'.format( |
1563 '{{% timezone None %}}{0}{{% endlocaltime %}}'.format( |
1564 selectedText)) |
1564 selectedText)) |
1565 replace = True |
1565 replace = True |
1566 elif tag == "get_current_timezone": |
1566 elif tag == "get_current_timezone": |
1567 templateText = '{% get_current_timezone as TIME_ZONE %}' |
1567 templateText = '{% get_current_timezone as TIME_ZONE %}' |
1568 ## Filters ## |
1568 ## Filters ## |
1569 elif tag == "localtime": |
1569 elif tag == "localtime": |