Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c05d724 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix pseudolocalizer at end of string"

parents 4822a4e4 b2106687
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -280,13 +280,13 @@ std::u16string PseudoMethodAccent::text(const StringPiece16& source)
            std::u16string chunk;
            bool end = false;
            chunk.append(&c, 1);
            while (!end && i < I) {
            while (!end && i + 1 < I) {
                ++i;
                c = s[i];
                chunk.append(&c, 1);
                if (isPossibleNormalPlaceholderEnd(c)) {
                    end = true;
                } else if (c == 't') {
                } else if (i + 1 < I && c == 't') {
                    ++i;
                    c = s[i];
                    chunk.append(&c, 1);
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ TEST(PseudolocalizerTest, PlaintextAccent) {

    EXPECT_TRUE(simpleHelper("Battery %1d%%",
                             "[βåţţéŕý »%1d«%% one two]", Pseudolocalizer::Method::kAccent));

    EXPECT_TRUE(simpleHelper("^1 %", "[^1 % one]", Pseudolocalizer::Method::kAccent));
    EXPECT_TRUE(compoundHelper("", "", "", "[]", Pseudolocalizer::Method::kAccent));
    EXPECT_TRUE(compoundHelper("Hello,", " world", "",
                               "[Ĥéļļö, ŵöŕļð one two]", Pseudolocalizer::Method::kAccent));