Skip to content

Commit

Permalink
Update strings
Browse files Browse the repository at this point in the history
- Add strings for chws and halt separately
- Add frac in description of frac
  • Loading branch information
WordlessEcho committed Sep 21, 2024
1 parent 2ce1706 commit 28381ab
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
10 changes: 0 additions & 10 deletions app/src/main/java/moe/echo/variablefonttest/OptionsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,6 @@ class OptionsFragment : PreferenceFragmentCompat() {
isChecked = false
}

summary = String.format(
getString(R.string.mojikumi_description),
Constants.FEATURE_CHWS
)

setOnPreferenceChangeListener { _, _ ->
fontFeatureSettings[Constants.FEATURE_CHWS] = if (!isChecked) "1" else "0"
previewContent?.fontFeatureSettings = fontFeatureSettings.toFeatures()
Expand All @@ -489,11 +484,6 @@ class OptionsFragment : PreferenceFragmentCompat() {
}

halt?.apply {
summary = String.format(
getString(R.string.mojikumi_description),
Constants.FEATURE_HALT
)

setOnPreferenceChangeListener { _, _ ->
fontFeatureSettings[Constants.FEATURE_HALT] = if (!isChecked) "1" else "0"
previewContent?.fontFeatureSettings = fontFeatureSettings.toFeatures()
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="app_name">可变字体测试器</string>
<string name="project_translators" translatable="false">
https://github.com/WordlessEcho/Variable-Font-Test/blob/main/TRANSLATORS.md#zh-rCN
Expand Down Expand Up @@ -28,8 +28,9 @@
<string name="feature_chws">连续标点挤压</string>
<string name="feature_halt">全部标点挤压</string>
<string name="feature_frac">分数</string>
<string name="mojikumi_description">%s,标点挤压中的一种规则。</string>
<string name="frac_description">将“3/4”显示为“¾”。</string>
<string name="chws_description">chws,标点挤压中的一种规则。</string>
<string name="halt_description">halt,标点挤压中的一种规则。</string>
<string name="frac_description" tools:ignore="TypographyFractions">frac,将“3/4”显示为“¾”。</string>
<string name="feature_editor">编辑字体特性设置</string>
<string name="add_font_feature">添加字体特性</string>
<string name="edit_feature_text">文本模式</string>
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/values-zh-rTW/values.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="app_name">可變字型測試器</string>
<string name="project_translators" translatable="false">
https://github.com/WordlessEcho/Variable-Font-Test/blob/main/TRANSLATORS.md#zh-rTW
Expand Down Expand Up @@ -32,8 +32,9 @@
<string name="feature_chws">調整連續標點的排字間距</string>
<string name="feature_halt">調整全部標點的排字間距</string>
<string name="feature_frac">分數</string>
<string name="mojikumi_description">%s,排字間距調整中的一種規則。</string>
<string name="frac_description">將「3/4」顯示為「¾」。</string>
<string name="chws_description">chws,排字間距調整中的一種規則。</string>
<string name="halt_description">halt,排字間距調整中的一種規則。</string>
<string name="frac_description" tools:ignore="TypographyFractions">frac,將「3/4」顯示為「¾」。</string>
<string name="feature_editor">編輯特性</string>
<string name="add_font_feature">新增字型特性</string>
<string name="edit_feature_text">文字模式</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
<string name="feature_chws">Contextual Half-width Spacing</string>
<string name="feature_halt">Alternate Half Widths</string>
<string name="feature_frac">Fractions</string>
<!-- %s will be the name of font feature tag. -->
<string name="mojikumi_description">%s. A rule of Mojikumi.</string>
<string name="chws_description">chws. A rule of Mojikumi.</string>
<string name="halt_description">halt. A rule of Mojikumi.</string>
<!-- The `\` in `\"` is a escape character. It will be displayed as `"` to user. -->
<string name="frac_description" tools:ignore="TypographyFractions">Make \"3/4\" display like \"¾\".</string>
<string name="frac_description" tools:ignore="TypographyFractions">frac. Make \"3/4\" display like \"¾\".</string>
<string name="feature_editor">Edit features</string>
<string name="add_font_feature">Add font feature</string>
<string name="edit_feature_text">Text mode</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/xml/options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,14 @@
<SwitchPreferenceCompat
android:key="chwsFeature"
android:title="@string/feature_chws"
android:summary="@string/chws_description"
android:defaultValue="true"
android:persistent="false" />

<SwitchPreferenceCompat
android:key="haltFeature"
android:title="@string/feature_halt"
android:summary="@string/halt_description"
android:defaultValue="false"
android:persistent="false" />

Expand Down

0 comments on commit 28381ab

Please sign in to comment.