Localizing the filter

Next we will add localizable text to our filter labels. The Pod filter is tied to the Pod so it inherits the same resource file that we have given the Pod. In the same way that we did for the Pod title, we use a property key for the labels and add the property value to the properties file.

Figure 1. MyFavouriteMovies.properties
pod.title=My Top Movies
  pod.filter.title.label=Movie Title:
  pod.filter.genre.label=Select Genre:
Figure 2. MyFavouriteMovies.java, using the properties file for labels
...        
017      titleFilter.addFilterLabel("pod.filter.title.label");
  ...
078      genreFilter.addFilterLabel("pod.filter.genre.label");
  ...

When we load our Pod we will see that the label on the filter has changed to the value specified in the properties file.