From 5fe453692585081da27ac4b11b9ea4bea3f63bf4 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 15 Apr 2014 22:02:06 +0000 Subject: [PATCH] edits in App help ; name suggestion "Language Compiler" ; sepApo(), a quick fix to French and Italian elision in the App --- src/ui/android/assets/help_content.html | 27 +++++++++++-------- src/ui/android/res/values/strings.xml | 2 +- .../ui/android/Translator.java | 17 ++++++++++++ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/ui/android/assets/help_content.html b/src/ui/android/assets/help_content.html index 08dec6834..dce3b2d31 100644 --- a/src/ui/android/assets/help_content.html +++ b/src/ui/android/assets/help_content.html @@ -2,12 +2,13 @@

DG Translator is a compact and completely off-line translator. -We do not show adds and we do not require internet connection. -However, if you want to use speech translation, then it might -work better if you are on-line. We use existing -Android speech services which may not be fully functional off-line. -In all cases you can always use keyboard input. +We do not show ads and we do not require internet connection. +However, if you encounter problems with the speech translation input +or output, it may work better if you are on-line. +In all cases you can always use keyboard input, also for editing the +speech input.

+

We indicate the translation confidence with colours:

The translation works between any pair of the supported languages. However, it works best from English and also from Swedish. -From other languages it can be slow and give more red. +From other languages it can be slow and give more red results. But expect frequent updates and improvements!

-When you tab on a translation you get a screen with alternative translations. -If the input is only a single word, then taping on each of the alternatives -gives you grammatical and morphological information for the word. +When you tap on a translation you get a screen with alternative translations. +If the input is only a single word, then tapping on each of the alternatives +gives you grammatical information about the word.

The app also provides an input method which you can use as @@ -46,8 +47,12 @@ To activate it go to Settings > Language & input.

Powered by GF, -built by Digital Grammars +built by Digital Grammars. +

+

+Digital Grammars can tailor this app to you needs - tell us what you want to see + in the green area!

- + diff --git a/src/ui/android/res/values/strings.xml b/src/ui/android/res/values/strings.xml index 768ef60a4..f1a679244 100644 --- a/src/ui/android/res/values/strings.xml +++ b/src/ui/android/res/values/strings.xml @@ -1,6 +1,6 @@ - DG Translator + Language Compiler Microphone Switch languages diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/Translator.java b/src/ui/android/src/org/grammaticalframework/ui/android/Translator.java index e7c0a4966..c4135c41b 100644 --- a/src/ui/android/src/org/grammaticalframework/ui/android/Translator.java +++ b/src/ui/android/src/org/grammaticalframework/ui/android/Translator.java @@ -265,6 +265,16 @@ public class Translator { return out; } + private static String sepApo(String in) { + String out = ""; + for (int i = 0; i < in.length(); i++) { + out += in.charAt(i); + if (in.charAt(i) == '\'') + out += ' '; + } + return out; + } + private String translateWord(String input) { String output = "[" + input + "]" ; // if all else fails, return the word itself in brackets @@ -311,6 +321,13 @@ public class Translator { // for Chinese we need to put space after every character input = explode(input); } + if (getSourceLanguage().getLangCode().equals("fr-FR")) { + // for French and Italian we need to separate apostrophe by space... + input = sepApo(input); + } + if (getSourceLanguage().getLangCode().equals("it-IT")) { + input = sepApo(input); + } String output = null; List exprs = new ArrayList();