trace/traceviewer/com.nokia.traceviewer.ost/src/com/nokia/traceviewer/ost/Messages.java
equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * String localization for OST package. |
|
17 * |
|
18 */ |
|
19 package com.nokia.traceviewer.ost; |
|
20 |
|
21 import java.util.MissingResourceException; |
|
22 import java.util.ResourceBundle; |
|
23 |
|
24 /** |
|
25 * String localization for OST package. |
|
26 */ |
|
27 final class Messages { |
|
28 |
|
29 /** |
|
30 * Bundle name |
|
31 */ |
|
32 private static final String BUNDLE_NAME = "com.nokia.traceviewer.ost.messages"; //$NON-NLS-1$ |
|
33 |
|
34 /** |
|
35 * Resource bundle |
|
36 */ |
|
37 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle |
|
38 .getBundle(BUNDLE_NAME); |
|
39 |
|
40 /** |
|
41 * Prevents construction. |
|
42 */ |
|
43 private Messages() { |
|
44 } |
|
45 |
|
46 /** |
|
47 * Maps a key to localized string. |
|
48 * |
|
49 * @param key |
|
50 * the key for the string |
|
51 * @return the localized string |
|
52 */ |
|
53 public static String getString(String key) { |
|
54 String value; |
|
55 try { |
|
56 value = RESOURCE_BUNDLE.getString(key); |
|
57 } catch (MissingResourceException e) { |
|
58 value = '!' + key + '!'; |
|
59 } |
|
60 return value; |
|
61 } |
|
62 } |