diff options
author | emkael <emkael@tlen.pl> | 2016-06-07 15:06:56 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-06-10 11:46:37 +0200 |
commit | 5d0cd43954513295c813d3557e8cc6d83ba4a134 (patch) | |
tree | 36e11d67f6f0d2bf368b2997cb93f76d849a8071 /app/php/controls | |
parent | 83efd023c884adfa54a308825beaff264e67fac1 (diff) |
* i18nized texts
Diffstat (limited to 'app/php/controls')
-rw-r--r-- | app/php/controls/AddToFilter.tpl | 2 | ||||
-rw-r--r-- | app/php/controls/CalendarDetails.tpl | 5 | ||||
-rw-r--r-- | app/php/controls/CalendarGroupFilter.tpl | 2 | ||||
-rw-r--r-- | app/php/controls/CalendarScaffold.php | 12 | ||||
-rw-r--r-- | app/php/controls/CalendarScaffold.tpl | 51 | ||||
-rw-r--r-- | app/php/controls/EventList.php | 5 | ||||
-rw-r--r-- | app/php/controls/HeaderMenu.tpl | 20 | ||||
-rw-r--r-- | app/php/controls/LoginBox.tpl | 24 | ||||
-rw-r--r-- | app/php/controls/PasswordChange.php | 4 | ||||
-rw-r--r-- | app/php/controls/PasswordChange.tpl | 43 | ||||
-rw-r--r-- | app/php/controls/RegistrationForm.tpl | 43 | ||||
-rw-r--r-- | app/php/controls/TimezoneSelect.php | 4 | ||||
-rw-r--r-- | app/php/controls/TimezoneSelect.tpl | 5 | ||||
-rw-r--r-- | app/php/controls/UpcomingEvents.tpl | 2 | ||||
-rw-r--r-- | app/php/controls/UrlBasedCalendarControl.php | 5 | ||||
-rw-r--r-- | app/php/controls/UserSelection.tpl | 6 |
16 files changed, 142 insertions, 91 deletions
diff --git a/app/php/controls/AddToFilter.tpl b/app/php/controls/AddToFilter.tpl index 5b63be8..a202aa7 100644 --- a/app/php/controls/AddToFilter.tpl +++ b/app/php/controls/AddToFilter.tpl @@ -1,7 +1,7 @@ <com:TActiveCheckBox ID="Box" OnCheckedChanged="setUserPreference" CssClass="addToFilterBox"> <prop:Enabled><%= !$this->UserToManage->IsGuest %></prop:Enabled> <prop:Checked><%= $this->Facade->isCalendarPreferred($this->UserToManage, $this->getCalendar()->ID) %></prop:Checked> - <prop:ToolTip><%= $this->UserToManage->IsGuest ? 'log in to manage your selections' : '' %></prop:ToolTip> + <prop:ToolTip><%= $this->UserToManage->IsGuest ? Prado::localize('log in to manage your selections') : '' %></prop:ToolTip> </com:TActiveCheckBox> <com:TLabel ForControl="Box"> <prop:Text><%= $this->getDescription() %></prop:Text> diff --git a/app/php/controls/CalendarDetails.tpl b/app/php/controls/CalendarDetails.tpl index 058a00f..2fd755c 100644 --- a/app/php/controls/CalendarDetails.tpl +++ b/app/php/controls/CalendarDetails.tpl @@ -4,9 +4,10 @@ <com:TImage> <prop:ImageUrl><%= $this->getCalendar()->Image %></prop:ImageUrl> </com:TImage> -<com:THyperLink Text="Source website" Target="_blank"> +<com:THyperLink Target="_blank"> + <prop:Text><%[ Source website ]%></prop:Text> <prop:NavigateUrl><%= $this->getCalendar()->Website %></prop:NavigateUrl> </com:THyperLink> <p> - Last updated: <%= $this->getCalendar()->LastUpdated %> + <%[ Last updated: ]%> <%= $this->getCalendar()->LastUpdated %> </p> diff --git a/app/php/controls/CalendarGroupFilter.tpl b/app/php/controls/CalendarGroupFilter.tpl index e9ae79a..ac82465 100644 --- a/app/php/controls/CalendarGroupFilter.tpl +++ b/app/php/controls/CalendarGroupFilter.tpl @@ -1,7 +1,7 @@ <com:TRepeater ID="Categories"> <prop:HeaderTemplate> <div class="selectAllGroups"> - All + <%[ All ]%> <com:TCheckBox CssClass="box" Checked="True" /> </div> </prop:HeaderTemplate> diff --git a/app/php/controls/CalendarScaffold.php b/app/php/controls/CalendarScaffold.php index c95cce7..7f15a32 100644 --- a/app/php/controls/CalendarScaffold.php +++ b/app/php/controls/CalendarScaffold.php @@ -85,7 +85,9 @@ class CalendarScaffold extends FacadeTemplateControl { $c->saveData($this->_compileSaveData($param->Item)); } } else { - throw new TInvalidDataValueException('Calendar not found'); + throw new TInvalidDataValueException( + Prado::localize('Calendar not found') + ); } $this->Calendars->EditItemIndex = -1; $this->_rebindData(TRUE); @@ -120,10 +122,14 @@ class CalendarScaffold extends FacadeTemplateControl { ); } } else { - throw new TInvalidDataValueException('Calendar not found'); + throw new TInvalidDataValueException( + Prado::localize('Calendar not found') + ); } } else { - throw new TInvalidDataTypeException('Invalid file type'); + throw new TInvalidDataTypeException( + Prado::localize('Invalid file type') + ); } } diff --git a/app/php/controls/CalendarScaffold.tpl b/app/php/controls/CalendarScaffold.tpl index 5e15b92..6a22bc2 100644 --- a/app/php/controls/CalendarScaffold.tpl +++ b/app/php/controls/CalendarScaffold.tpl @@ -8,26 +8,30 @@ OnUpdateCommand="saveRow"> <com:TActiveBoundColumn ID="Name" ReadOnly="true" - HeaderText="Calendar" - DataField="Name" /> + DataField="Name"> + <prop:HeaderText><%[ Calendar ]%></prop:HeaderText> + </com:TActiveBoundColumn> <com:TActiveHyperLinkColumn ID="Website" - HeaderText="WWW" - Text="[www]" Target="_blank" - DataNavigateUrlField="Website" /> + DataNavigateUrlField="Website"> + <prop:HeaderText><%[ WWW ]%></prop:HeaderText> + <prop:Text><%[ [www] ]%></prop:Text> + </com:TActiveHyperLinkColumn> <com:TActiveHyperLinkColumn ID="Url" - HeaderText="ICS" - Text="[ics]" Target="_blank" - DataNavigateUrlField="Url" /> + DataNavigateUrlField="Url"> + <prop:HeaderText><%[ ICS ]%></prop:HeaderText> + <prop:Text><%[ [ics] ]%></prop:Text> + </com:TActiveHyperLinkColumn> <com:TActiveDropDownListColumn ID="Category" - HeaderText="Category" DataTextField="Category.Name" DataValueField="CategoryID" ListValueField="ID" - ListTextField="Name" /> - <com:TActiveTemplateColumn ID="Visible" - HeaderText="Default"> + ListTextField="Name"> + <prop:HeaderText><%[ Category ]%></prop:HeaderText> + </com:TActiveDropDownListColumn> + <com:TActiveTemplateColumn ID="Visible"> + <prop:HeaderText><%[ Default ]%></prop:HeaderText> <prop:ItemTemplate> <com:TActiveCheckBox OnCheckedChanged="SourceTemplateControl.toggleDefaultState" @@ -43,13 +47,15 @@ </prop:EditItemTemplate> </com:TActiveTemplateColumn> <com:TActiveBoundColumn ID="CustomName" - HeaderText="Custom name" - DataField="CustomName" /> + DataField="CustomName"> + <prop:HeaderText><%[ Custom name ]%></prop:HeaderText> + </com:TActiveBoundColumn> <com:TActiveBoundColumn ID="CustomUrl" - HeaderText="URL" - DataField="CustomUrl" /> - <com:TActiveTemplateColumn ID="CustomImage" - HeaderText="Image"> + DataField="CustomUrl"> + <prop:HeaderText><%[ URL ]%></prop:HeaderText> + </com:TActiveBoundColumn> + <com:TActiveTemplateColumn ID="CustomImage"> + <prop:HeaderText><%[ Image ]%></prop:HeaderText> <prop:ItemTemplate> <com:TImage> <prop:ImageUrl><%# $this->Parent->Data->CustomImageUrl %></prop:ImageUrl> @@ -66,9 +72,10 @@ </prop:EditItemTemplate> </com:TActiveTemplateColumn> <com:TActiveEditCommandColumn - HeaderText="" - EditText="Edit" - UpdateText="Save" - CancelText="Cancel" /> + HeaderText=""> + <prop:EditText><%[ Edit ]%></prop:EditText> + <prop:UpdateText><%[ Save ]%></prop:UpdateText> + <prop:CancelText><%[ Cancel ]%></prop:CancelText> + </com:TActiveEditCommandColumn> </com:TActiveDataGrid> </com:TPanel> diff --git a/app/php/controls/EventList.php b/app/php/controls/EventList.php index 325641b..d40e000 100644 --- a/app/php/controls/EventList.php +++ b/app/php/controls/EventList.php @@ -5,7 +5,10 @@ class EventList extends UrlBasedCalendarControl { private function _setDate($key, $date) { $datetime = new DateTime($date, new DateTimeZone('UTC')); if (!$datetime) { - throw new TInvalidDataValueException('Invalid date string: ' . $date); + throw new TInvalidDataValueException( + Prado::localize('Invalid date string: {date}', + ['date' => $date]) + ); } $this->setViewState($key, $datetime); } diff --git a/app/php/controls/HeaderMenu.tpl b/app/php/controls/HeaderMenu.tpl index a7e666d..a760588 100644 --- a/app/php/controls/HeaderMenu.tpl +++ b/app/php/controls/HeaderMenu.tpl @@ -1,27 +1,35 @@ <nav role="navigation"> - <com:TActiveLinkButton Text="Login" OnCommand="loginUser"> + <com:TActiveLinkButton OnCommand="loginUser"> + <prop:Text><%[ Login ]%></prop:Text> <prop:Visible><%= $this->User->IsGuest %></prop:Visible> <prop:ClientSide.OnFailure>window.location.replace('<%= $this->Service->constructUrl('Login') %>')</prop:ClientSide.OnFailure> <prop:ClientSide.OnException>window.location.replace('<%= $this->Service->constructUrl('Login') %>')</prop:ClientSide.OnException> </com:TActiveLinkButton> - <com:THyperLink Text="Profile"> + <com:THyperLink> + <prop:Text><%[ Profile ]%></prop:Text> <prop:NavigateUrl><%= $this->Service->constructUrl('Profile') %></prop:NavigateUrl> <prop:Visible><%= !$this->User->IsGuest %></prop:Visible> </com:THyperLink> - <com:THyperLink Text="Calendar list"> + <com:THyperLink> + <prop:Text><%[ Calendar list ]%></prop:Text> <prop:NavigateUrl><%= $this->Service->constructUrl('Select') %></prop:NavigateUrl> </com:THyperLink> <com:TActiveLinkButton OnCommand="logoutUser"> - <prop:Text>Logout (<%= $this->User->Name %>)</prop:Text> + <com:TTranslate> + Logout ({name}) + <com:TTranslateParameter Key="name"><%= $this->User->Name %></com:TTranslateParameter> + </com:TTranslate> <prop:Visible><%= !$this->User->IsGuest %></prop:Visible> <prop:ClientSide.OnFailure>window.location.reload()</prop:ClientSide.OnFailure> <prop:ClientSide.OnException>window.location.reload()</prop:ClientSide.OnException> </com:TActiveLinkButton> - <com:THyperLink Text="New user"> + <com:THyperLink> + <prop:Text><%[ New user ]%></prop:Text> <prop:NavigateUrl><%= $this->Service->constructUrl('Signup') %></prop:NavigateUrl> <prop:Visible><%= $this->User->getIsAdmin() %></prop:Visible> </com:THyperLink> - <com:THyperLink Text="Admin calendars"> + <com:THyperLink> + <prop:Text><%[ Admin calendars ]%></prop:Text> <prop:NavigateUrl><%= $this->Service->constructUrl('Admin') %></prop:NavigateUrl> <prop:Visible><%= $this->User->getIsAdmin() %></prop:Visible> </com:THyperLink> diff --git a/app/php/controls/LoginBox.tpl b/app/php/controls/LoginBox.tpl index d3e1a1e..070ab86 100644 --- a/app/php/controls/LoginBox.tpl +++ b/app/php/controls/LoginBox.tpl @@ -1,29 +1,33 @@ -Username: +<%[ Username: ]%> <com:TTextBox ID="Login" ValidationGroup="LoginGroup" /> <com:TRequiredFieldValidator ControlToValidate="Login" Display="Dynamic" - ErrorMessage="Username cannot be empty" - ValidationGroup="LoginGroup" /> + ValidationGroup="LoginGroup"> + <prop:ErrorMessage><%[ Username cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <br /> -Password: +<%[ Password: ]%> <com:TTextBox ID="Password" TextMode="Password" ValidationGroup="LoginGroup" /> <com:TRequiredFieldValidator ControlToValidate="Password" Display="Dynamic" - ErrorMessage="Password cannot be empty" - ValidationGroup="LoginGroup" /> + ValidationGroup="LoginGroup"> + <prop:ErrorMessage><%[ Password cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <com:TCustomValidator ControlToValidate="Password" OnServerValidate="validatePassword" Display="Dynamic" - ErrorMessage="Username and password don't match" - ValidationGroup="LoginGroup" /> + ValidationGroup="LoginGroup"> + <prop:ErrorMessage><%[ Username and password don't match ]%></prop:ErrorMessage> +</com:TCustomValidator> <br /> <com:TButton - Text="Login" OnCommand="loginUser" - ValidationGroup="LoginGroup" /> + ValidationGroup="LoginGroup"> + <prop:Text><%[ Login ]%></prop:Text> +</com:TButton> diff --git a/app/php/controls/PasswordChange.php b/app/php/controls/PasswordChange.php index 0f0300c..45ce656 100644 --- a/app/php/controls/PasswordChange.php +++ b/app/php/controls/PasswordChange.php @@ -14,7 +14,9 @@ class PasswordChange extends FacadeTemplateControl { public function setUserToChange(DbUser $user) { if ($user->IsGuest && !$this->Page->IsCallBack) { throw new TInvalidDataValueException( - 'Password change impossible for guest user' + Prado::localize( + 'Password change impossible for guest user' + ) ); } $this->setControlState('user', $user); diff --git a/app/php/controls/PasswordChange.tpl b/app/php/controls/PasswordChange.tpl index 915e8b3..4eb9a8e 100644 --- a/app/php/controls/PasswordChange.tpl +++ b/app/php/controls/PasswordChange.tpl @@ -1,52 +1,59 @@ -Change password<br /> -Current password: +<%[ Change password ]%><br /> +<%[ Current password: ]%> <com:TTextBox ID="Password" TextMode="Password" ValidationGroup="ChangePasswordGroup" /> <com:TRequiredFieldValidator ControlToValidate="Password" Display="Dynamic" - ErrorMessage="Current password cannot be empty" - ValidationGroup="ChangePasswordGroup" /> + ValidationGroup="ChangePasswordGroup"> + <prop:ErrorMessage><%[ Current password cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <com:TCustomValidator ControlToValidate="Password" OnServerValidate="checkPassword" Display="Dynamic" - ErrorMessage="Password is incorrect" - ValidationGroup="ChangePasswordGroup" /> + ValidationGroup="ChangePasswordGroup"> + <prop:ErrorMessage><%[ Password is incorrect ]%></prop:ErrorMessage> +</com:TCustomValidator> <br /> -New password: +<%[ New password: ]%> <com:TTextBox ID="NewPassword" TextMode="Password" ValidationGroup="ChangePasswordGroup" /> <com:TRequiredFieldValidator ControlToValidate="NewPassword" Display="Dynamic" - ErrorMessage="New password cannot be empty" - ValidationGroup="ChangePasswordGroup" /> + ValidationGroup="ChangePasswordGroup"> + <prop:ErrorMessage><%[ New password cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <br /> -Repeat password: +<%[ Repeat password: ]%> <com:TTextBox ID="ReNewPassword" TextMode="Password" ValidationGroup="ChangePasswordGroup" /> <com:TRequiredFieldValidator ControlToValidate="ReNewPassword" Display="Dynamic" - ErrorMessage="New password cannot be empty" - ValidationGroup="ChangePasswordGroup" /> + ValidationGroup="ChangePasswordGroup"> + <prop:ErrorMessage><%[ New password cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <com:TCompareValidator ControlToValidate="ReNewPassword" ControlToCompare="NewPassword" DataType="String" Operator="Equal" Display="Dynamic" - ErrorMessage="Passwords don't match" - ValidationGroup="ChangePasswordGroup" /> + ValidationGroup="ChangePasswordGroup"> + <prop:ErrorMessage><%[ Passwords don't match ]%></prop:ErrorMessage> +</com:TCompareValidator> <br /> <com:TButton - Text="Change password" OnCommand="changePassword" - ValidationGroup="ChangePasswordGroup" /> + ValidationGroup="ChangePasswordGroup"> + <prop:Text><%[ Change password ]%></prop:Text> +</com:TButton> <com:TLabel ID="SuccessMessage" - Text="Your password has been changed" - Visible="false" /> + Visible="false"> + <prop:Text><%[ Your password has been changed ]%></prop:Text> +</com:TLabel> diff --git a/app/php/controls/RegistrationForm.tpl b/app/php/controls/RegistrationForm.tpl index ffa4778..9defe54 100644 --- a/app/php/controls/RegistrationForm.tpl +++ b/app/php/controls/RegistrationForm.tpl @@ -1,59 +1,66 @@ -Username: +<%[ Username: ]%> <com:TTextBox ID="Login" ValidationGroup="SignupGroup" /> <com:TRequiredFieldValidator ControlToValidate="Login" Display="Dynamic" - ErrorMessage="Username cannot be empty" - ValidationGroup="SignupGroup" /> + ValidationGroup="SignupGroup"> + <prop:ErrorMessage><%[ Username cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <com:TRegularExpressionValidator ControlToValidate="Login" RegularExpression="[a-zA-Z0-9_]{6,255}" Display="Dynamic" - ErrorMessage="Username must contain 6-255 characters, all Latin alphanumeric or underscore" - ValidationGroup="SignupGroup" /> + ValidationGroup="SignupGroup"> + <prop:ErrorMessage><%[ Username must contain 6-255 characters, all Latin alphanumeric or underscore ]%></prop:ErrorMessage> +</com:TRegularExpressionValidator> <com:TCustomValidator ControlToValidate="Login" OnServerValidate="checkUsername" Display="Dynamic" - ErrorMessage="Username already exists" - ValidationGroup="SignupGroup" /> + ValidationGroup="SignupGroup"> + <prop:ErrorMessage><%[ Username already exists ]%></prop:ErrorMessage> +</com:TCustomValidator> <br /> -Password: +<%[ Password: ]%> <com:TTextBox ID="Password" TextMode="Password" ValidationGroup="SignupGroup" /> <com:TRequiredFieldValidator ControlToValidate="Password" Display="Dynamic" - ErrorMessage="Password cannot be empty" - ValidationGroup="SignupGroup" /> + ValidationGroup="SignupGroup"> + <prop:ErrorMessage><%[ Password cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <br /> -Repeat password: +<%[ Repeat password: ]%> <com:TTextBox ID="RePassword" TextMode="Password" ValidationGroup="SignupGroup" /> <com:TRequiredFieldValidator ControlToValidate="RePassword" Display="Dynamic" - ErrorMessage="Password cannot be empty" - ValidationGroup="SignupGroup" /> + ValidationGroup="SignupGroup"> + <prop:ErrorMessage><%[ Password cannot be empty ]%></prop:ErrorMessage> +</com:TRequiredFieldValidator> <com:TCompareValidator ControlToValidate="RePassword" ControlToCompare="Password" DataType="String" Operator="Equal" Display="Dynamic" - ErrorMessage="Passwords don't match" - ValidationGroup="SignupGroup" /> + ValidationGroup="SignupGroup"> + <prop:ErrorMessage><%[ Passwords don't match ]%></prop:ErrorMessage> +</com:TCompareValidator> <br /> -Admin: +<%[ Admin: ]%> <com:TCheckBox ID="Admin" ValidationGroup="SignupGroup" /> <br /> <com:TButton - Text="Create" OnCommand="registerUser" - ValidationGroup="SignupGroup" /> + ValidationGroup="SignupGroup"> + <prop:Text><%[ Create ]%></prop:Text> +</com:TButton> <com:TValidationSummary ValidationGroup="SignupGroup" /> diff --git a/app/php/controls/TimezoneSelect.php b/app/php/controls/TimezoneSelect.php index 7ef30cb..25af453 100644 --- a/app/php/controls/TimezoneSelect.php +++ b/app/php/controls/TimezoneSelect.php @@ -16,7 +16,9 @@ class TimezoneSelect extends FacadeTemplateControl { public function setUserToChange(DbUser $user) { if ($user->IsGuest && !$this->Page->IsCallBack) { throw new TInvalidDataValueException( - 'Timezone preference change impossible for guest user' + Prado::localize( + 'Timezone preference change impossible for guest user' + ) ); } $this->setControlState('user', $user); diff --git a/app/php/controls/TimezoneSelect.tpl b/app/php/controls/TimezoneSelect.tpl index 2d40014..ee703d6 100644 --- a/app/php/controls/TimezoneSelect.tpl +++ b/app/php/controls/TimezoneSelect.tpl @@ -1,4 +1,5 @@ <com:TDropDownList ID="Timezones" /> <com:TButton - Text="Save timezone" - OnCommand="saveTimezone" /> + OnCommand="saveTimezone"> + <prop:Text><%[ Save timezone ]%></prop:Text> +</com:TButton> diff --git a/app/php/controls/UpcomingEvents.tpl b/app/php/controls/UpcomingEvents.tpl index 1788c7e..ac5f60c 100644 --- a/app/php/controls/UpcomingEvents.tpl +++ b/app/php/controls/UpcomingEvents.tpl @@ -1,4 +1,4 @@ -Upcoming events: +<%[ Upcoming events: ]%> <br /> <com:EventRepeater ID="Events"> <prop:Events><%= $this->getEvents() %></prop:Events> diff --git a/app/php/controls/UrlBasedCalendarControl.php b/app/php/controls/UrlBasedCalendarControl.php index c61bc37..a5be82e 100644 --- a/app/php/controls/UrlBasedCalendarControl.php +++ b/app/php/controls/UrlBasedCalendarControl.php @@ -14,7 +14,10 @@ class UrlBasedCalendarControl extends FacadeTemplateControl { } } if ($this->getRaiseException()) { - throw new THttpException(404, 'Page not found'); + throw new THttpException( + 404, + Prado::localize('Page not found') + ); } else { $this->Visible = FALSE; } diff --git a/app/php/controls/UserSelection.tpl b/app/php/controls/UserSelection.tpl index 1777dca..c0d472c 100644 --- a/app/php/controls/UserSelection.tpl +++ b/app/php/controls/UserSelection.tpl @@ -1,4 +1,4 @@ -Selected calendars: +<%[ Selected calendars: ]%> <br /> <com:TRepeater ID="Categories" OnItemDataBound="categoryDataBind"> <prop:ItemTemplate> @@ -12,8 +12,8 @@ Selected calendars: <prop:Visible><%# !$this->SourceTemplateControl->UserToDisplay->IsGuest %></prop:Visible> </com:TLinkButton> <%# $this->Data->Name %> - <com:THyperLink - Text="(details)"> + <com:THyperLink> + <prop:Text>(<%= Prado::localize('details') %>)</prop:Text> <prop:NavigateUrl><%# $this->Service->constructUrl('Calendar', ['calendar' => $this->Data->Url]) %></prop:NavigateUrl> </com:THyperLink> <com:THyperLink |