-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
20 changed files
with
198 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...c/test/kotlin/dev/icerock/gradle/generator/pluralsGenerator/XmlPluralsToPlatformRuTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.gradle.generator.pluralsGenerator | ||
|
||
import dev.icerock.gradle.utils.convertXmlStringToAndroidLocalization | ||
import dev.icerock.gradle.utils.convertXmlStringToApplePluralLocalization | ||
import dev.icerock.gradle.utils.convertXmlStringToLocalization | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class XmlPluralsToPlatformRuTest { | ||
@Test | ||
fun simplePluralsAppleTest(){ | ||
assertEquals( | ||
expected = """%d число "%s"""", | ||
actual ="%d число \"%s\"".convertXmlStringToApplePluralLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun simplePluralsAndroidTest(){ | ||
assertEquals( | ||
expected = """%d число \"%s\"""", | ||
actual ="%d число \"%s\"".convertXmlStringToAndroidLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun simplePluralsOtherPlatformsTest() { | ||
assertEquals( | ||
expected = """%d число \"%s\"""", | ||
actual ="%d число \"%s\"".convertXmlStringToLocalization(), | ||
) | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
...src/test/kotlin/dev/icerock/gradle/generator/pluralsGenerator/XmlPluralsToPlatformTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.gradle.generator.pluralsGenerator | ||
|
||
import dev.icerock.gradle.utils.convertXmlStringToAndroidLocalization | ||
import dev.icerock.gradle.utils.convertXmlStringToApplePluralLocalization | ||
import dev.icerock.gradle.utils.convertXmlStringToLocalization | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class XmlPluralsToPlatformTest { | ||
@Test | ||
fun simplePluralsAppleTest(){ | ||
assertEquals( | ||
expected = """%d count of "%s"""", | ||
actual ="%d count of \"%s\"".convertXmlStringToApplePluralLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun simplePluralsAndroidTest(){ | ||
assertEquals( | ||
expected = """%d count of \"%s\"""", | ||
actual ="%d count of \"%s\"".convertXmlStringToAndroidLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun simplePluralsOtherPlatformsTest() { | ||
assertEquals( | ||
expected = """%d count of \"%s\"""", | ||
actual ="%d count of \"%s\"".convertXmlStringToLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun pluralWithNewLineAppleTest() { | ||
assertEquals( | ||
expected = """%d count | ||
|of tests""".trimMargin(), | ||
actual ="%d count\nof tests".convertXmlStringToApplePluralLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun pluralWithNewLineAndroidTest() { | ||
assertEquals( | ||
expected = """%d count\nof tests""", | ||
actual ="%d count\nof tests".convertXmlStringToAndroidLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun pluralWithNewLineOtherPlatformTest() { | ||
assertEquals( | ||
expected = """%d count\nof tests""", | ||
actual ="%d count\nof tests".convertXmlStringToLocalization(), | ||
) | ||
} | ||
|
||
@Test | ||
fun separateSymbolsApplePluralsTest() { | ||
assertEquals( | ||
expected = """" ' % @ * & {}""", | ||
actual = "\" ' % @ * & {}".convertXmlStringToApplePluralLocalization() | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/compose-resources-gallery/shared/src/commonMain/moko-resources/ru/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<resources> | ||
<string name="hello_world">Привет Мир moko-resources</string> | ||
<string name="symbols_text">Текст \n с " ' % @ * & {} сколько-то дюйм'ов</string> | ||
<string name="symbols_text">Текст \n с " ' % @ * & {} "сколько-то" дюйм'ов</string> | ||
<string name="font_style_text">Текст с <b>жирный</b>, <i>курсив</i>, <u>подчеркивание</u></string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters