1 /**
2 * Copyright 2011-2013 The Kuali Foundation Licensed under the Educational
3 * Community License, Version 2.0 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of the License
5 * at
6 *
7 * http://www.osedu.org/licenses/ECL-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 * License for the specific language governing permissions and limitations under
13 * the License.
14 */
15 package org.kuali.mobility.l10n.service;
16
17 import java.util.Map;
18
19 import org.kuali.mobility.l10n.entity.LocalisedString;
20
21 /**
22 * A service used to retrieve and persist localised strings.
23 * This service must NOT be used instead of a <code>MessageSource</code> to get localised messages.
24 * This service should only be used to save new values for localised strings.
25 *
26 * @author Kuali Mobility Team (mobility.collab@kuali.org)
27 * @since
28 */
29 public interface LocalisationService {
30
31 /**
32 * Gets a localised String.
33 * @param code Code of the string to get
34 * @param locale The locale to get the String for.
35 * @return
36 */
37 public LocalisedString getLocalisedString(String code, String locale);
38
39 /**
40 * Saves a localised String.
41 * Usefull when saving a string for multiple languages.
42 * @param code Code as which to save the String.
43 * @param stringLanguage Map of language code to the actual string.
44 */
45 public void saveLocalisedString(String code, Map<String, String> stringLanguage);
46 }