Frequency Pattern Selector Localization

The Frequency Pattern Selector infrastructure widget is used to construct frequency patterns such as:

the first day of every 1 month(s)

This sentence is made up of fixed text from its associated FrequencyPatternSelector.properties file as well as values selected by a user from an input field and two drop-downs in the widget, refer to this example frequency pattern in Frequency Pattern Selector.

Because of the grammar differences between different languages, the construction of this example frequency pattern sentence can be dramatically changed in other languages, like the values selected by a user can be re-ordered in it. Therefore, the placeholders are introduced to represent these user selected values so that we can localize every frequency pattern as "whole" into every single property in the properties file.

Here is the property entry from the FrequencyPatternSelector.properties for this example frequency pattern:

Text.monthly.freq.type.two= The %ordinal% %dayOfWeekExtended% 
        of every %monthInterval% month(s)

The strings %ordinal%, %dayOfWeekExtended% and %monthInterval% in this property entry are the placeholders that map to the values that will be selected from two drop-downs and one input field in the widget. The detailed explanation of these three placeholders will be covered later in a table.

In order to use these placeholders properly, you need to stick to the following two rules:

A description of all these placeholders used in the properties file of this widget is listed as follows:

Table 1. Placeholders used in Frequency Pattern Selector

Placeholder Name

Description

%dayInterval%

A day interval. It maps to an input field where you can enter a number for a day interval for a frequency pattern.

%weekInterval%

A week interval. It maps to an input field where you can enter a number for a week interval for a frequency pattern.

%dayOfWeek%

A set of days in a week. It maps to a collection of check boxes where you can multi select the days in a week for a frequency pattern.

%dayOfWeekExtended%

It is an extension of the values represented by %dayOfWeek%, which also includes the weekday, weekend day and day value. It maps to a drop-down where you can select one of those day values for a frequency pattern.

%monthInterval%

A month interval. It maps to an input field where you can enter a number for a month interval for a frequency pattern.

%ordinal%

an ordinal, e.g. first, second. It maps to a drop-down where you can select an ordinal for a frequency pattern.

%dayIntervalOne%, %dayIntervalTwo%

Two day intervals in a frequency pattern. They should be used together and map to two input field where you can enter a number for a day interval respectively for a frequency pattern.

%ordinalOne%, %ordinalTwo%

Two ordinals in a frequency pattern. They should be used together and map to two drop-downs where you can select an ordinal respectively for a frequency pattern.

%monthOfYear%

A month in a calendar year. It maps to a drop-down where you can select a month for a frequency pattern.

As stated in the second rule above, the placeholders used for every frequency pattern are fixed. So you need to take care that you have used them properly when localizing the properties in this widget properties file. As long as you keep this in mind, the customization of this widget properties file is also no difference from other infrastructure widgets. The following table lists all the properties and the placeholders they contain for every frequency pattern sentence displayed on the Frequency Pattern Selector.

Table 2. Properties used for the Frequency Pattern Selector

Property Name

Placeholders it contains

Text.daily.freq.type.one

%dayInterval%

Text.daily.freq.type.two

None.

Text.weekly.freq.type

%weekInterval%, %dayOfWeek%

Text.monthly.freq.type.one

%dayInterval%, %monthInterval%

Text.monthly.freq.type.two

%ordinal%, %dayOfWeekExtended%, %monthInterval%

Text.bimonthly.freq.type.one

%dayIntervalOne%, %dayIntervalTwo%

Text.bimonthly.freq.type.two

%ordinalOne%, %ordinalTwo%, %dayOfWeek%

Text.yearly.freq.type.one

%monthOfYear%, %dayInterval%

Text.yearly.freq.type.two

%ordinal%, %dayOfWeekExtended%, %monthOfYear%