diff --git a/spellchecker/src/com/intellij/spellchecker/engine/Transformation.java b/spellchecker/src/com/intellij/spellchecker/engine/Transformation.java index 79a5fb88fde1..1d8bf1d96c1a 100644 --- a/spellchecker/src/com/intellij/spellchecker/engine/Transformation.java +++ b/spellchecker/src/com/intellij/spellchecker/engine/Transformation.java @@ -19,6 +19,7 @@ import com.intellij.util.containers.hash.HashSet; import org.jetbrains.annotations.Nullable; import java.util.Collection; +import java.util.Locale; import java.util.Set; @SuppressWarnings({"ALL"}) @@ -26,10 +27,13 @@ public class Transformation { @Nullable public String transform(@Nullable String word) { - if (word == null || word.trim().length() < 3) { + if (word == null) return null; + word = word.trim(); + if (word.length() < 3) { return null; } - return word.trim().toLowerCase(); + + return word.toLowerCase(Locale.ENGLISH); } @Nullable diff --git a/spellchecker/testData/inspection/commentsWithMistakes/SPITest2.java b/spellchecker/testData/inspection/commentsWithMistakes/SPITest2.java new file mode 100644 index 000000000000..8043f3d11352 --- /dev/null +++ b/spellchecker/testData/inspection/commentsWithMistakes/SPITest2.java @@ -0,0 +1,3 @@ +class Foo { + int myInventory; +} \ No newline at end of file diff --git a/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java b/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java index e91ccf7f4778..e55efc411f14 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java +++ b/spellchecker/testSrc/com/intellij/spellchecker/inspection/CommentsWithMistakesInspectionTest.java @@ -15,6 +15,8 @@ */ package com.intellij.spellchecker.inspection; +import java.util.Locale; + /** * @author Ekaterina Shliakhovetskaja */ @@ -28,6 +30,16 @@ public class CommentsWithMistakesInspectionTest extends SpellcheckerInspectionTe doTest("SPITest1.java"); } + public void testJavaWithTurkishLocale() { + Locale locale = Locale.getDefault(); + try { + Locale.setDefault(new Locale("tr", "TR")); + doTest("SPITest2.java"); + } finally { + Locale.setDefault(locale); + } + } + public void testXml() { doTest("A.xml"); }