Skip to content

Commit

Permalink
Updated for release 3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rmraya committed Jun 6, 2023
1 parent 44b05f8 commit 91131f9
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 31 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Fluenta is an open source tool designed to simplify the translation and localization of DITA projects combining two open standards from OASIS: *DITA* and *XLIFF*.

Fluenta implements the workflow described in the article [Use XLIFF to Translate DITA Projects](https://www.maxprograms.com/articles/ditaxliff.html), making it easy to manage the translation side of your DITA projects following the procedure recommended by the *OASIS DITA Adoption Technical Committee* (see the official publication from the TC available in PDF format from [OASIS](https://www.oasis-open.org/committees/download.php/48340/DITA12XLIFFArticle.pdf) and in HTML format at [ditatranslation.com](https://www.ditatranslation.com/articles/ditaxliff.html)).
Fluenta implements the workflow described in the article [Use XLIFF to Translate DITA Projects](https://www.maxprograms.com/articles/ditaxliff.html), making it easy to manage the translation side of your DITA projects according to the procedure recommended by the *OASIS DITA Adoption Technical Committee* (see the official TC publication, available in PDF at [OASIS](https://www.oasis-open.org/committees/download.php/48340/DITA12XLIFFArticle.pdf) and in HTML format at [ditatranslation.com](https://www.ditatranslation.com/articles/ditaxliff.html)).

## Licenses

Expand All @@ -25,21 +25,21 @@ Ready to use installers and technical support for Fluenta are available as yearl

The version of Fluenta included in the official installers from [Fluenta's Home Page](https://www.maxprograms.com/products/fluenta.html) can be used at no cost for 30 days requesting a free Evaluation Key.

Subscription version includes unlimited email support at [email protected]
Subscription version includes unlimited email support at [[email protected]](mailto:[email protected]).

### Differences sumary

Differences | Source Code | Subscription Based
Differences | From Source Code | Subscription Based
-|:----------:|:-------------:
Ready To Use Installers| No | Yes
Notarized macOS launcher| No | Yes
Signed launcher and installer for Windows | No | Yes
Restricted Features | None | None
Technical Support | Peer support at [Groups.io](https://groups.io/g/maxprograms/)| - Direct email at [email protected] <br> - Peer support at [Groups.io](https://groups.io/g/maxprograms/)
Technical Support | Peer support at [Groups.io](https://groups.io/g/maxprograms/)| - Direct email at [[email protected]](mailto:[email protected]) <br> - Peer support at [Groups.io](https://groups.io/g/maxprograms/)

## Installers

Ready to use installers are available at <https://www.maxprograms.com/products/fluenta.html>
Ready to use installers are available at [https://www.maxprograms.com/products/fluenta.html](https://www.maxprograms.com/products/fluenta.html).

## Building Yourself

Expand Down
Binary file modified jars/openxliff.jar
Binary file not shown.
Binary file modified jars/xmljava.jar
Binary file not shown.
8 changes: 8 additions & 0 deletions src/com/maxprograms/fluenta/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import javax.xml.parsers.ParserConfigurationException;

import org.json.JSONException;
import org.json.JSONObject;
import org.xml.sax.SAXException;

import com.maxprograms.utils.Preferences;
Expand Down Expand Up @@ -76,6 +77,13 @@ public static void main(String[] args) {
}

for (int i = 0; i < args.length; i++) {
if (args[i].equals("-version")) {
JSONObject json = new JSONObject();
json.put("version", Constants.VERSION);
json.put("build", Constants.BUILD);
System.out.println(json.toString(2));
System.exit(0);
}
if (args[i].equals("-add") && (i + 1) < args.length) {
addProject = true;
addFile = args[i + 1];
Expand Down
4 changes: 2 additions & 2 deletions src/com/maxprograms/fluenta/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ private Constants() {
}

public static final String NAME = "Fluenta";
public static final String VERSION = "3.7.0";
public static final String BUILD = "20230503_0805";
public static final String VERSION = "3.8.0";
public static final String BUILD = "20230606_1006";
}
11 changes: 3 additions & 8 deletions src/com/maxprograms/fluenta/controllers/LocalController.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ public void generateXliff(Project project, String xliffFolder, List<Language> tg
params.put("srcLang", project.getSrcLanguage());
params.put("tgtLang", project.getSrcLanguage()); // use src language in master
params.put("srcEncoding", EncodingResolver.getEncoding(project.getMap(), FileFormats.DITA).name());
params.put("paragraph", "no");
params.put("format", FileFormats.DITA);
params.put("srxFile", preferences.getDefaultSRX());
params.put("translateComments", translateComments ? "yes" : "no");
params.put("xmlfilter", preferences.getFiltersFolder());
Expand Down Expand Up @@ -1030,7 +1028,6 @@ private List<Element> searchTranslations(InternalDatabase database, Element seg,
Iterator<Match> r = res.iterator();
while (r.hasNext()) {
Match match = r.next();
int quality = match.getSimilarity();

Element alttrans = new Element("alt-trans");

Expand All @@ -1047,7 +1044,7 @@ private List<Element> searchTranslations(InternalDatabase database, Element seg,
alttrans.addContent(tgt);
alttrans.addContent("\n ");
alttrans = fixTags(seg.getChild("source"), alttrans);
quality = MatchQuality.similarity(TMUtils.pureText(seg.getChild("source")),
int quality = MatchQuality.similarity(TMUtils.pureText(seg.getChild("source")),
TMUtils.pureText(alttrans.getChild("source")));
double discount = wrongTags(alttrans.getChild("source"), seg.getChild("source"), penalty);
quality = (int) Math.floor(quality - discount);
Expand Down Expand Up @@ -1118,10 +1115,8 @@ private void cleanCtype(Element e) {
if (e.getName().equals("ph")
|| e.getName().equals("x")) {
String value = e.getAttributeValue("ctype");
if (!value.isEmpty()) {
if (!phCtypes.containsKey(value) && !value.startsWith("x-")) {
e.setAttribute("ctype", "x-" + value);
}
if (!value.isEmpty() && !phCtypes.containsKey(value) && !value.startsWith("x-")) {
e.setAttribute("ctype", "x-" + value);
}
}
if (e.getName().equals("bpt")
Expand Down
10 changes: 5 additions & 5 deletions src/com/maxprograms/fluenta/controllers/ProjectsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public ProjectsManager(File home) throws IOException, JSONException, ParseExcept
}

private JSONObject upgradeProjects(JSONObject json) throws JSONException, ParseException {
JSONArray projects = json.getJSONArray("projects");
JSONArray projectsArray = json.getJSONArray("projects");
DateFormat df = DateFormat.getDateTimeInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
DateFormat ldf = DateFormat.getDateInstance(DateFormat.LONG);
for (int i = 0; i < projects.length(); i++) {
JSONObject project = projects.getJSONObject(i);
for (int i = 0; i < projectsArray.length(); i++) {
JSONObject project = projectsArray.getJSONObject(i);
Date creationDate = df.parse(project.getString("creationDate"));
project.put("creationDate", sdf.format(creationDate));
Date lastUpdate = df.parse(project.getString("lastUpdate"));
Expand Down Expand Up @@ -96,11 +96,11 @@ private synchronized void saveProjects() throws IOException {
}
}

List<Project> getProjects() throws JSONException, ParseException, IOException {
List<Project> getProjects() throws JSONException {
return projects;
}

public Project getProject(long id) throws JSONException, ParseException, IOException {
public Project getProject(long id) throws JSONException, IOException {
for (int i = 0; i < projects.size(); i++) {
Project project = projects.get(i);
if (id == project.getId()) {
Expand Down
14 changes: 3 additions & 11 deletions src/com/maxprograms/fluenta/views/GenerateXliffDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@
import java.io.IOException;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.net.URISyntaxException;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;

import javax.xml.parsers.ParserConfigurationException;

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.SelectionAdapter;
Expand All @@ -45,8 +40,6 @@
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.json.JSONException;
import org.xml.sax.SAXException;

import com.maxprograms.converters.ILogger;
import com.maxprograms.fluenta.Fluenta;
Expand Down Expand Up @@ -343,10 +336,9 @@ public void handleEvent(Event ev) {
public void run() {
try {
mainView.getController().generateXliff(project, xliffFolder, tgtLangs, useice, usetm, count,
ditaval, useXliff20, embedSkeleton, modifiedFilesOnly, ignoreTrackedChanges, paragraphSegmentation, aLogger);
} catch (IOException | ClassNotFoundException | JSONException | SAXException
| NullPointerException | ParserConfigurationException | URISyntaxException
| SQLException | ParseException e) {
ditaval, useXliff20, embedSkeleton, modifiedFilesOnly, ignoreTrackedChanges,
paragraphSegmentation, aLogger);
} catch (Exception e) {
aLogger.displayError(e.getMessage());
logger.log(Level.ERROR, e);
}
Expand Down

0 comments on commit 91131f9

Please sign in to comment.