diff --git a/java/src/com/android/inputmethod/latin/Constants.java b/java/src/com/android/inputmethod/latin/Constants.java
index 00b54f5933c8ee8bfcfbd1c6cbf2d8357eeac00a..77e99bfba985d5d4f1596e4a107b097cc47fb812 100644
--- a/java/src/com/android/inputmethod/latin/Constants.java
+++ b/java/src/com/android/inputmethod/latin/Constants.java
@@ -183,6 +183,7 @@ public final class Constants {
     public static final int CODE_TAB = '\t';
     public static final int CODE_SPACE = ' ';
     public static final int CODE_PERIOD = '.';
+    public static final int CODE_COMMA = ',';
     public static final int CODE_ARMENIAN_PERIOD = 0x0589;
     public static final int CODE_DASH = '-';
     public static final int CODE_SINGLE_QUOTE = '\'';
diff --git a/java/src/com/android/inputmethod/latin/settings/SpacingAndPunctuations.java b/java/src/com/android/inputmethod/latin/settings/SpacingAndPunctuations.java
index dbe30e2606844c646a40d8f6197961a9153c0da9..29bd3e7b320f69f84b7656e54ec4c3f5f9d8d736 100644
--- a/java/src/com/android/inputmethod/latin/settings/SpacingAndPunctuations.java
+++ b/java/src/com/android/inputmethod/latin/settings/SpacingAndPunctuations.java
@@ -41,6 +41,7 @@ public final class SpacingAndPunctuations {
     public final String mSentenceSeparatorAndSpace;
     public final boolean mCurrentLanguageHasSpaces;
     public final boolean mUsesAmericanTypography;
+    public final boolean mUsesGermanRules;
 
     public SpacingAndPunctuations(final Resources res) {
         mSymbolsPrecededBySpace =
@@ -62,8 +63,9 @@ public final class SpacingAndPunctuations {
         mCurrentLanguageHasSpaces = res.getBoolean(R.bool.current_language_has_spaces);
         final Locale locale = res.getConfiguration().locale;
         // Heuristic: we use American Typography rules because it's the most common rules for all
-        // English variants.
+        // English variants. German rules (not "German typography") also have small gotchas.
         mUsesAmericanTypography = Locale.ENGLISH.getLanguage().equals(locale.getLanguage());
+        mUsesGermanRules = Locale.GERMAN.getLanguage().equals(locale.getLanguage());
     }
 
     // Helper functions to create member values.
diff --git a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java
index 057e332e972e91f1ff484c29dc547b4601adf059..702688f93950685f707a0e3d7f667e2164644ca2 100644
--- a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java
@@ -139,6 +139,20 @@ public final class CapsModeUtils {
             j--;
         }
         if (j <= 0 || Character.isWhitespace(prevChar)) {
+            if (spacingAndPunctuations.mUsesGermanRules) {
+                // In German typography rules, there is a specific case that the first character
+                // of a new line should not be capitalized if the previous line ends in a comma.
+                boolean hasNewLine = false;
+                while (--j >= 0 && Character.isWhitespace(prevChar)) {
+                    if (Constants.CODE_ENTER == prevChar) {
+                        hasNewLine = true;
+                    }
+                    prevChar = cs.charAt(j);
+                }
+                if (Constants.CODE_COMMA == prevChar && hasNewLine) {
+                    return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS) & reqModes;
+                }
+            }
             // There are only spacing chars between the start of the paragraph and the cursor,
             // defined as a isWhitespace() char that is neither a isSpaceChar() nor a tab. Both
             // MODE_WORDS and MODE_SENTENCES should be active.
diff --git a/tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java
index 40a103b84eba40221c10c8c2cbeb8b24341a5b55..020d6329919e95f0c47986d6312bdd720efc81ce 100644
--- a/tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java
+++ b/tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java
@@ -94,5 +94,20 @@ public class CapsModeUtilsTests extends AndroidTestCase {
         allPathsForCaps("\"Word.\" ", c | w, sp, false);
         allPathsForCaps("\"Word\". ", c | w | s, sp, false);
         allPathsForCaps("\"Word\" ", c | w, sp, false);
+
+        // Test special case for German. German does not capitalize at the start of a
+        // line when the previous line starts with a comma. It does in other cases.
+        sp = job.runInLocale(res, Locale.GERMAN);
+        allPathsForCaps("Liebe Sara,\n", c | w, sp, false);
+        allPathsForCaps("Liebe Sara,\n", c | w, sp, true);
+        allPathsForCaps("Liebe Sara,  \n  ", c | w, sp, false);
+        allPathsForCaps("Liebe Sara  \n  ", c | w | s, sp, false);
+        allPathsForCaps("Liebe Sara.\n  ", c | w | s, sp, false);
+        sp = job.runInLocale(res, Locale.ENGLISH);
+        allPathsForCaps("Liebe Sara,\n", c | w | s, sp, false);
+        allPathsForCaps("Liebe Sara,\n", c | w | s, sp, true);
+        allPathsForCaps("Liebe Sara,  \n  ", c | w | s, sp, false);
+        allPathsForCaps("Liebe Sara  \n  ", c | w | s, sp, false);
+        allPathsForCaps("Liebe Sara.\n  ", c | w | s, sp, false);
     }
 }