Revision 1229 tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessages.groovy

PluginMessages.groovy (revision 1229)
11 11
 */
12 12
class PluginMessages {
13 13
	
14
	File projectDirectory;
14 15
	File messageFile;
15 16
	String encoding = "UTF-8"
16 17
	
......
18 19
	HashMap<File, BiHashMap<String, String>> langs = new HashMap<File, BiHashMap<String, String>>();
19 20
	BiHashMap<File, String> file2lang = new BiHashMap<File, String>()
20 21
		
21
	public PluginMessages(File messageFile) {
22
	public PluginMessages(File projectDirectory, File messageFile) {
22 23
		this.messageFile = messageFile
23
		
24
		this.projectDirectory = projectDirectory;
24 25
		def propFiles = messageFile.getParentFile().listFiles()
25 26
		for (File propFile : propFiles) {
26 27
			String name = propFile.getName();
......
62 63
		return messageFile;
63 64
	}
64 65
	
65
	public String getMessageFileName() {
66
	public String getMessageClassName() {
66 67
		return messageFile.getName().substring(0, messageFile.getName().length()-5);
67 68
	}
68 69
	
70
	public String getMessageFullClassName() {
71
		return messageFile.getAbsolutePath().substring(messageFile.getAbsolutePath().lastIndexOf("org/txm/"), messageFile.getAbsolutePath().length()-5).replace("/", ".");
72
	}
73
	
74
	public String getMessageName() {
75
		return messageFile.getName().substring(0, messageFile.getName().length()-5-8);
76
	}
77
	
78
	public String getMessageFullName() {
79
		return messageFile.getAbsolutePath().substring(messageFile.getAbsolutePath().lastIndexOf("org/txm/")+8, messageFile.getAbsolutePath().length()-5-8).replace("/", ".");
80
	}
81
	
69 82
//	public def getMissingsMessageKeys(String lang) {
70 83
//		def missing = []
71 84
//		for (String pKey : this.getKeys())

Also available in: Unified diff