All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lyncode.xliff.XLIFF Maven / Gradle / Ivy

The newest version!
package com.lyncode.xliff;

import java.util.Collection;
import java.util.Map;
import java.util.TreeMap;

import com.lyncode.xliff.xml.TransUnit;
import com.lyncode.xliff.xml.Xliff;

public class XLIFF {
	private Map translations;
	
	XLIFF (Xliff x) {
		translations = new TreeMap();
		for (Xliff.File f : x.getFile())
			for (TransUnit u : f.getBody().getTransUnit())
				translations.put(u.getSource(), u.getTarget());
	}
	
	public String getTarget (String source) {
		return translations.get(source);
	}
	
	public Collection getSources () {
		return translations.keySet();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy