1 package cz
.cvut
.promod
.resources
;
3 import org
.apache
.log4j
.Logger
;
4 import cz
.cvut
.promod
.services
.ModelerSession
;
6 import java
.util
.MissingResourceException
;
9 * ProMod, master thesis project
10 * User: Petr Zverina, petr.zverina@gmail.com
11 * Date: 16:38:10, 26.4.2010
15 * Checks whether there is no missing translation.
17 public class TranslationCheck
{
19 private static Logger LOG
= Logger
.getLogger(TranslationCheck
.class);
21 public static final String
[] translation_keys
= {
27 "modeler.plugin.notation",
28 "modeler.plugin.module",
29 "modeler.plugin.extension",
30 "modeler.exit.save.all",
31 "modeler.exit.skip.all",
33 "modeler.exit.diagram.unsaved.change",
35 "modeler.plugins.overview",
36 "modeler.plugins.overview.notations.title",
37 "modeler.plugins.overview.extension.title",
38 "modeler.plugins.overview.identifier",
39 "modeler.plugins.overview.name",
40 "modeler.plugins.overview.description",
41 "modeler.plugins.overview.abbreviation",
42 "modeler.plugins.overview.full.name",
43 "modeler.plugins.overview.tool.tip",
44 "modeler.plugins.overview.file.ext",
45 "modeler.dockable.frame.move",
46 "modeler.dockable.frame.move.left",
47 "modeler.dockable.frame.move.right",
48 "modeler.dockable.frame.move.top",
49 "modeler.dockable.frame.move.bottom",
50 "modeler.configuration.title",
51 "modeler.configuration.message",
52 "modeler.configuration.message.detail",
53 "modeler.configuration.hideButton",
54 "modeler.configuration.missing.notation",
55 "modeler.configuration.loaded.value",
56 "modeler.configuration.actual.value",
57 "modeler.configuration.missing.module",
58 "modeler.configuration.missing.extension",
59 "modeler.configuration.related.notation",
60 "modeler.configuration.different.extension",
61 "modeler.configuration.different.abbreviation",
62 "modeler.configuration.different.name",
63 "modeler.loadErrorsDialog.message",
64 "modeler.loadErrorsDialog.log",
65 "modeler.loadErrorsDialog.title",
66 "modeler.loadErrorsDialog.hideButton",
67 "modeler.loadErrorsDialog.propertyName",
68 "modeler.loadErrorsDialog.fullClassName",
69 "modeler.loadErrorsDialog.error",
70 "modeler.loadErrorsDialog.error.message",
73 "modeler.action.exit",
74 "modeler.action.new.project",
75 "modeler.action.navigation",
76 "modeler.action.project.load",
77 "modeler.action.project.load.description",
78 "modeler.action.project.load.error.loadfile.title",
79 "modeler.action.project.load.error.loadfile",
80 "modeler.action.project.load.error.sync.title",
81 "modeler.action.project.load.error.sync.message",
82 "modeler.action.project.save",
83 "modeler.menu.project",
84 "modeler.menu.window",
85 "modeler.project.navigation.expand.all",
86 "modeler.project.navigation.rename",
87 "modeler.project.rename.description",
88 "modeler.project.rename.duplicity",
89 "modeler.project.rename.error",
90 "modeler.project.rename.error.title",
91 "modeler.project.navigation.collapse.all",
92 "modeler.project.navigation.new.diagram",
93 "modeler.project.navigation.new.subfolder",
94 "modeler.project.navigation.add",
95 "modeler.project.navigation.close.project",
96 "modeler.project.navigation.refresh",
97 "modeler.project.navigation.delete",
98 "modeler.project.navigation.delete.diagram.title",
99 "modeler.project.navigation.delete.diagram.message",
100 "modeler.project.navigation.delete.diagram.error.message",
101 "modeler.project.navigation.delete.subfolder.title",
102 "modeler.project.navigation.delete.subfolder.message",
103 "modeler.project.navigation.delete.subfolder.error.message",
104 "modeler.project.navigation.delete.project.title",
105 "modeler.project.navigation.delete.project.message",
106 "modeler.project.navigation.add.subfolder",
107 "modeler.project.navigation.add.diagram",
108 "modeler.project.navigation.expand",
109 "modeler.add.new.subfolder.dialog.title",
110 "modeler.add.new.subfolder.dialog.label",
111 "modeler.add.new.subfolder.dialog.confirm",
112 "modeler.add.new.subfolder.dialog.error.disallowed",
113 "modeler.add.new.subfolder.dialog.error.nameduplicity",
114 "modeler.add.new.subfolder.dialog.error",
115 "modeler.add.new.project.dialog.error.general",
116 "modeler.add.new.project.dialog.error.relative",
117 "modeler.add.new.project.dialog.error.existing.file",
118 "modeler.add.new.project.dialog.error.duplicity",
119 "modeler.add.new.project.dialog.error.shortName",
120 "modeler.add.new.project.dialog.error.io",
121 "modeler.add.new.project.dialog.error.disallowed",
122 "modeler.add.new.diagram.dialog.title",
123 "modeler.add.new.diagram.dialog.confirm",
124 "modeler.add.new.diagram.dialog.tableTitle",
125 "modeler.add.new.diagram.dialog.nameTitle",
126 "modeler.add.new.diagram.dialog.noImage",
127 "modeler.add.new.diagram.dialog.error.duplicity",
128 "modeler.add.new.diagram.dialog.error.illegalParent",
129 "modeler.add.new.diagram.dialog.error.illegalNotation",
130 "modeler.add.new.diagram.dialog.error.disallowed",
131 "modeler.add.new.diagram.dialog.error",
132 "modeler.add.dialog.error.noSelectedProject",
133 "modeler.add.dialog.error.noSelProjectTitle",
134 "modeler.default.workspace.title",
135 "modeler.default.workspace.notation.identifier",
136 "modeler.default.workspace.diagram.name",
137 "modeler.default.workspace.diagram.identifier",
138 "project.service.sync.dialog.fromFS.title",
139 "project.service.sync.dialog.fromPN.title",
140 "project.service.sync.dialog.errorlist",
141 "project.service.sync.dialog.searching",
142 "project.service.sync.dialog.cancel",
143 "project.service.sync.dialog.canceled",
144 "project.service.sync.dialog.searching.done",
145 "project.service.sync.dialog.treepatherror",
146 "project.service.sync.dialog.default.error.message",
147 "project.service.sync.dialog.invalidname.error.message",
148 "project.service.sync.dialog.default.error.from",
149 "project.service.sync.dialog.default.error.to",
150 "project.service.sync.dialog.exception",
151 "project.service.sync.dialog.directory.error",
152 "project.service.sync.dialog.offset.error",
153 "project.service.sync.dialog.invalid.treepath",
154 "project.service.sync.dialog.invalid.parent",
155 "project.service.sync.dialog.missing.project.file",
156 "project.service.sync.dialog.diagram.overwritten",
157 "project.service.sync.dialog.diagram.write",
158 "project.service.sync.dialog.mkdir.error",
159 "project.service.sync.dialog.delete.error",
160 "project.service.sync.dialog.project.file.error",
161 "project.service.sync.dialog.error.load.project.file",
162 "project.service.sync.dialog.error.invalid.project.root",
163 "project.service.sync.dialog.error.subtree",
164 "project.service.sync.dialog.error.subtree.not.exist",
165 "project.service.sync.dialog.project.root.error",
166 "project.service.sync.dialog.subtree.build.error",
167 "project.service.sync.dialog.diagram.load.error",
168 "project.service.sync.dialog.diagram.error.identifier",
169 "project.service.sync.dialog.diagram.error.extension",
170 "project.service.sync.dialog.diagram.error.diagram",
171 "modeler.user.service",
173 "modeler.user.title",
174 "modeler.user.switch",
175 "modeler.user.invalid.name",
176 "pluginLoaderService.error.missing.xsd",
177 "pluginLoaderService.error.noError",
178 "pluginLoaderService.error.xmlParsing",
179 "pluginLoaderService.error.className",
180 "pluginLoaderService.error.findClass",
181 "pluginLoaderService.error.classHierarchy",
182 "pluginLoaderService.error.instantiation",
183 "pluginLoaderService.error.nullaryNotationName",
184 "pluginLoaderService.error.emptyNotationName",
185 "pluginLoaderService.error.noModelFactory",
186 "pluginLoaderService.error.invalidModelFactory",
187 "pluginLoaderService.error.nullaryAbbreviation",
188 "pluginLoaderService.error.emptyAbbreviation",
189 "pluginLoaderService.error.ioController",
190 "pluginLoaderService.error.nullaryFileExtension",
191 "pluginLoaderService.error.emptyFileExtension",
192 "pluginLoaderService.error.notationIdentifierDuplicity",
193 "pluginLoaderService.error.nullaryPluginIdentifier",
194 "pluginLoaderService.error.likeModelerpluginIdentifier",
195 "pluginLoaderService.error.emptyPluginIdentifier",
196 "pluginLoaderService.error.noRelatedNotationIdentifier",
197 "pluginLoaderService.error.nullaryRelatedNotationIdentifier",
198 "pluginLoaderService.error.emptyRelatedNotationIdentifier",
199 "pluginLoaderService.error.moduleIdentifierDuplicity",
200 "pluginLoaderService.error.extensionIdentifierDuplicity",
201 "pluginLoaderService.error.nullaryExtensionDescription",
202 "pluginLoaderService.error.nullaryPluginName",
203 "pluginLoaderService.error.emptyPluginName",
204 "pluginLoaderService.error.projectFileLikeNotation",
205 "pluginLoaderService.error.notationExtensionDuplicity",
206 "pluginLoaderService.error.too.long.identifier",
207 "modeler.action.new.project.dialog",
211 * Checks whether no translation is missing.
213 * @return true if no translation is missing, false otherwise
215 public static boolean validateTranslations(){
216 for(final String key
: translation_keys
){
218 ModelerSession
.getCommonResourceBundle().getString(key
);
219 } catch (MissingResourceException exception
){
220 LOG
.error("Missing translation for key: " + key
+ ".");