// Fetch the translation memory
TransMemory stored = loadTM("new-trans-memory");
// For each trans unit, generate some variants
for (TransMemoryUnit tu : stored.getTranslationUnits()) {
TransMemoryUnitVariant tuvES =
new TransMemoryUnitVariant("es",
"<seg>Mensaje de Prueba</seg>");
TransMemoryUnitVariant tuvEN =
new TransMemoryUnitVariant("en-US",
"<seg>Test Message</seg>");
TransMemoryUnitVariant tuvFR =
new TransMemoryUnitVariant("fr",
"<seg>Message de test</seg>");
tu.getTransUnitVariants().put(tuvES.getLanguage(), tuvES);
tu.getTransUnitVariants().put(tuvEN.getLanguage(), tuvEN);
tu.getTransUnitVariants().put(tuvFR.getLanguage(), tuvFR);
super.getEm().merge(tu);
}
// Verify they were saved