From dd9a78d24e3cc0a34cfcea01ea2486c960837093 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 17 Sep 2009 15:55:42 -0700 Subject: [PATCH] Fix Subscribable aspect i18n. Fixes bug #11003. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/AssetAspect/Subscribable.pm | 26 +++++-------------- .../i18n/English/AssetAspect_Subscribable.pm | 22 +++++++++++++--- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 7954508bb..bd3011e71 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -50,6 +50,7 @@ - fixed #10976: Form::Date not internationalized /DateTime::setToEpoch - fixed #11005: calendar feed workflow - fixed #11008: Test::Class + - fixed #11003: Subscribable AssetAspect: no i18n 7.7.19 - fixed #10838: Forwarded forum post email to new CS adds reply to original thread diff --git a/lib/WebGUI/AssetAspect/Subscribable.pm b/lib/WebGUI/AssetAspect/Subscribable.pm index 6e2026762..3c0b6f0e9 100644 --- a/lib/WebGUI/AssetAspect/Subscribable.pm +++ b/lib/WebGUI/AssetAspect/Subscribable.pm @@ -2,6 +2,7 @@ package WebGUI::AssetAspect::Subscribable; use strict; use Class::C3; +use WebGUI::International; =head1 NAME @@ -25,14 +26,14 @@ sub definition { my $class = shift; my $session = shift; my $definition = shift; - my $i18n = __PACKAGE__->i18n($session); + my $i18n = WebGUI::International->new($session, 'AssetAspect_Subscribable'); tie my %properties, 'Tie::IxHash', ( subscriptionGroupId => { tab => "security", fieldType => "subscriptionGroup", - label => $i18n->echo("Subscription Group"), - hoverHelp => $i18n->echo("The users who are subscribed to recieve e-mail alerts for this asset"), + label => $i18n->get("Subscription Group"), + hoverHelp => $i18n->get("Subscription Group help"), defaultValue => undef, noFormPost => 1, }, @@ -40,8 +41,8 @@ sub definition { tab => "display", fieldType => "template", namespace => $class->getSubscriptionTemplateNamespace, - label => $i18n->echo("Subscription Template"), - hoverHelp => $i18n->echo("The template to use to send out e-mail notifications"), + label => $i18n->get("Email Template"), + hoverHelp => $i18n->get("Email Template help"), }, skipNotification => { autoGenerate => 0, @@ -260,21 +261,6 @@ sub getUnsubscribeUrl { #---------------------------------------------------------------------------- -=head2 i18n ( ) - -Get the i18n for RSSCapable - -=cut - -sub i18n { - my $class = shift; - my $session = shift; - - return WebGUI::International->new( $session ); -} - -#---------------------------------------------------------------------------- - =head2 isSubscribed ( [userId] ) Returns true if the user is subscribed to the asset. C is a userId to diff --git a/lib/WebGUI/i18n/English/AssetAspect_Subscribable.pm b/lib/WebGUI/i18n/English/AssetAspect_Subscribable.pm index 41ba60bfc..6172da866 100644 --- a/lib/WebGUI/i18n/English/AssetAspect_Subscribable.pm +++ b/lib/WebGUI/i18n/English/AssetAspect_Subscribable.pm @@ -3,11 +3,27 @@ package WebGUI::i18n::English::AssetAspect_Subscribable; use strict; our $I18N = { - "new post" => { - message => 'has posted to one of your subscriptions', + + "Subscription Group" => { + message => 'Subscription Group', lastUpdated => 0, - context => 'Title of the e-mail that is sent for subscriptions', }, + + "Subscription Group help" => { + message => 'The users who are subscribed to recieve e-mail alerts for this asset', + lastUpdated => 0, + }, + + "Email Template" => { + message => 'Email Template', + lastUpdated => 0, + }, + + "Email Template help" => { + message => 'The template to use to send out e-mail notifications', + lastUpdated => 0, + }, + }; 1;