aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/speech/TextFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/speech/TextFactory.java')
-rw-r--r--main/src/cgeo/geocaching/speech/TextFactory.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/speech/TextFactory.java b/main/src/cgeo/geocaching/speech/TextFactory.java
index 81a74fb..2a3b6d7 100644
--- a/main/src/cgeo/geocaching/speech/TextFactory.java
+++ b/main/src/cgeo/geocaching/speech/TextFactory.java
@@ -1,8 +1,8 @@
package cgeo.geocaching.speech;
+import cgeo.geocaching.CgeoApplication;
import cgeo.geocaching.R;
import cgeo.geocaching.settings.Settings;
-import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.geopoint.IConversion;
import cgeo.geocaching.utils.AngleUtils;
@@ -12,6 +12,13 @@ import java.util.Locale;
/**
* Creates the output to be read by TTS.
*
+ * Note: some languages need to read "one hour" as "a hour" (indefinite article). Also, other languages
+ * use the <tt>quantity="1"</tt> plurals rule for other values than 1, such as Slovenian, so it is not
+ * possible to store the literal value to use for 1 in this rule. For this reason, we need to have one
+ * string for the unit quantity ("one meter") and a plurals rule for everything else.
+ *
+ * See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html for rules
+ * on unit expressions.
*/
public class TextFactory {
public static String getText(Geopoint position, Geopoint target, float direction) {
@@ -78,11 +85,11 @@ public class TextFactory {
}
private static String getString(int resourceId, Object... formatArgs) {
- return cgeoapplication.getInstance().getString(resourceId, formatArgs);
+ return CgeoApplication.getInstance().getString(resourceId, formatArgs);
}
private static String getQuantityString(int resourceId, int quantity, Object... formatArgs) {
- return cgeoapplication.getInstance().getResources().getQuantityString(resourceId, quantity, formatArgs);
+ return CgeoApplication.getInstance().getResources().getQuantityString(resourceId, quantity, formatArgs);
}
private static String getDirection(Geopoint position, Geopoint target, float direction) {