private void compare(Translate trans1, Translate trans2) { System.out.println( "The phrase " + trans1.getOriginalPhrase() + " and " + trans2.getOriginalPhrase() + " appear to be " + trans1.equals(trans2) + ".\n"); }
/** Display a dialog which allows the user to export a scene to an OBJ file. */ public static void exportFile(BFrame parent, Scene theScene) { // Display a dialog box with options on how to export the scene. // ValueField errorField = new ValueField(0.05, ValueField.POSITIVE); // final ValueField widthField = new ValueField(200.0, ValueField.INTEGER+ValueField.POSITIVE); // final ValueField heightField = new ValueField(200.0, ValueField.INTEGER+ValueField.POSITIVE); // final ValueSlider qualitySlider = new ValueSlider(0.0, 1.0, 100, 0.5); // final BCheckBox smoothBox = new BCheckBox(Translate.text("subdivideSmoothMeshes"), true); final BCheckBox injectChoice = new BCheckBox(Translate.text("Inject"), true); // final BCheckBox UVChoice = new BCheckBox(Translate.text("Export UV"), true); /*BComboBox exportChoice = new BComboBox(new String [] { Translate.text("exportWholeScene"), Translate.text("selectedObjectsOnly") });*/ ComponentsDialog dlg; if (theScene.getSelection().length > 0) dlg = new ComponentsDialog( parent, Translate.text("InjectToM2"), new Widget[] {injectChoice}, new String[] {null, null, null, null, null}); else dlg = new ComponentsDialog( parent, Translate.text("exportToM2"), new Widget[] {injectChoice}, new String[] {null, null, null, null}); if (!dlg.clickedOk()) return; // Ask the user to select the output file. BFileChooser fc = new BFileChooser(BFileChooser.SAVE_FILE, Translate.text("exportToWMO")); fc.setSelectedFile(new File("Untitled.m2")); if (ArtOfIllusion.getCurrentDirectory() != null) fc.setDirectory(new File(ArtOfIllusion.getCurrentDirectory())); if (!fc.showDialog(parent)) return; File dir = fc.getDirectory(); f = fc.getSelectedFile(); String name = f.getName(); String baseName = (name.endsWith(".m2") ? name.substring(0, name.length() - 3) : name); ArtOfIllusion.setCurrentDirectory(dir.getAbsolutePath()); m2 obj = null; try { obj = new m2(fileLoader.openBuffer(f.getAbsolutePath())); } catch (InvalidClassException e) { // TODO Auto-generated catch block e.printStackTrace(); } writeScene(theScene, obj, false, 0.05, false, injectChoice.getState()); }
@Test public void valueWithParams() { // given // when String result = i18NValue.from(MessageKey.Invalid_URI, "public/wiggly/id=3"); // then assertThat(result).isEqualTo("public/wiggly/id=3 is not a valid page"); }
@Test public void value() { // given // current locale is UK // when String result = i18NValue.from(LabelKey.First_Name); // then assertThat(result).isEqualTo("First Name"); }
@Test public void valueFromName() { // given // current locale is UK // when String result = i18NValue.from(TestLabelKey.Login); // then assertThat(result).isEqualTo("Login"); }
public Line render(String text, Color c) { text = Translate.get(text); Coord sz = strsize(text); if (sz.x < 1) sz = sz.add(1, 0); BufferedImage img = TexI.mkbuf(sz); Graphics g = img.createGraphics(); if (aa) Utils.AA(g); g.setFont(font); g.setColor(c); FontMetrics m = g.getFontMetrics(); g.drawString(text, 0, m.getAscent()); g.dispose(); return (new Line(text, img, m)); }
public static String _(final Translate t, final Object... parameter) { return t.s(parameter); }
public static String _(final Translate t) { return t.s(); }
private void testItToP(String str) { Translate s1 = new Translate(str, false); System.out.println("The tester typed (english):\n" + s1.getOriginalPhrase()); System.out.println("And translated it to (pirate):\n" + s1.getTranslatedPhrase() + "\n"); }