Skip to content

Commit

Permalink
Don't translate unnecessary stuff on About screen
Browse files Browse the repository at this point in the history
  • Loading branch information
equeim committed Jan 9, 2024
1 parent def6f2e commit e8bf69a
Show file tree
Hide file tree
Showing 43 changed files with 51 additions and 285 deletions.
13 changes: 0 additions & 13 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
host = https://www.transifex.com
lang_map = gu_IN: gu-rIN, mr_IN: mr-rIN, prs_AF: prs-rAF, smj_SE: smj-rSE, bo_CN: bo-rCN, en_GB: en-rGB, en_ZW: en-rZW, es_US: es-rUS, th_TH: th-rTH, ps_AF: ps-rAF, sah_RU: sah-rRU, te_IN: te-rIN, af_ZA: af-rZA, en_MY: en-rMY, ms_MY: ms-rMY, nb_NO: nb-rNO, ro_RO: ro-rRO, se_FI: se-rFI, smn_FI: smn-rFI, en_TT: en-rTT, fr_LU: fr-rLU, he_IL: iw-rIL, ig_NG: ig-rNG, gl_ES: gl-rES, rw_RW: rw-rRW, zh_SG: zh-rSG, ar_YE: ar-rYE, ca_ES: ca-rES, en_NZ: en-rNZ, fr_BE: fr-rBE, de_DE: de-rDE, ml_IN: ml-rIN, ug_CN: ug-rCN, ar_TN: ar-rTN, en_ZA: en-rZA, gd_GB: gd-rGB, ja_JP: ja-rJP, ky_KG: ky-rKG, ar_KW: ar-rKW, en_US: en-rUS, es_DO: es-rDO, eu_ES: eu-rES, ar_AE: ar-rAE, ar_QA: ar-rQA, sr: sr, tr_TR: tr-rTR, hy_AM: hy-rAM, nso_ZA: nso-rZA, pa_IN: pa-rIN, uz_UZ: uz-rUZ, de_LU: de-rLU, en_CA: en-rCA, en_JM: en-rJM, fil_PH: fil-rPH, zh_MO: zh-rMO, de_AT: de-rAT, es_PE: es-rPE, rm_CH: rm-rCH, smj_NO: smj-rNO, es_CL: es-rCL, es_ES: es-rES, mk_MK: mk-rMK, ta_IN: ta-rIN, ar_LB: ar-rLB, cy_GB: cy-rGB, ka_GE: ka-rGE, quz_BO: quz-rBO, ha_NG: ha-rNG, id_ID: in-rID, qut_GT: qut-rGT, quz_EC: quz-rEC, bg_BG: bg-rBG, bn_IN: bn-rIN, en_BZ: en-rBZ, gsw_FR: gsw-rFR, sma_NO: sma-rNO, sv_FI: sv-rFI, uk_UA: uk-rUA, yo_NG: yo-rNG, da_DK: da-rDK, en_IE: en-rIE, kk_KZ: kk-rKZ, ur_PK: ur-rPK, tk_TM: tk-rTM, tzm_DZ: tzm-rDZ, zh_CN: zh-rCN, ar_EG: ar-rEG, ne_NP: ne-rNP, se_SE: se-rSE, sms_FI: sms-rFI, kl_GL: kl-rGL, mi_NZ: mi-rNZ, ms_BN: ms-rBN, tn_ZA: tn-rZA, ar_OM: ar-rOM, de_CH: de-rCH, en_PH: en-rPH, hr_HR: hr-rHR, et_EE: et-rEE, fr_CH: fr-rCH, id: in, lv_LV: lv-rLV, ar_IQ: ar-rIQ, de_LI: de-rLI, es_NI: es-rNI, es_SV: es-rSV, vi_VN: vi-rVN, hsb_DE: hsb-rDE, xh_ZA: xh-rZA, es_PA: es-rPA, km_KH: km-rKH, lb_LU: lb-rLU, lo_LA: lo-rLA, ar_DZ: ar-rDZ, ar_SY: ar-rSY, el_GR: el-rGR, es_MX: es-rMX, sa_IN: sa-rIN, am_ET: am-rET, en_IN: en-rIN, ko_KR: ko-rKR, mt_MT: mt-rMT, ar_SA: ar-rSA, it_CH: it-rCH, pl_PL: pl-rPL, pt_PT: pt-rPT, ii_CN: ii-rCN, pt_BR: pt-rBR, sl_SI: sl-rSI, ba_RU: ba-rRU, es_EC: es-rEC, fi_FI: fi-rFI, fo_FO: fo-rFO, sw_KE: sw-rKE, tt_RU: tt-rRU, es_BO: es-rBO, quz_PE: quz-rPE, sk_SK: sk-rSK, sv_SE: sv-rSE, es_VE: es-rVE, nl_NL: nl-rNL, oc_FR: oc-rFR, az_AZ: az-rAZ, bn_BD: bn-rBD, co_FR: co-rFR, es_UY: es-rUY, sma_SE: sma-rSE, wo_SN: wo-rSN, ar_JO: ar-rJO, es_PY: es-rPY, fy_NL: fy-rNL, moh_CA: moh-rCA, es_AR: es-rAR, fr_MC: fr-rMC, he: iw, hr_BA: hr-rBA, ar_BH: ar-rBH, ar_MA: ar-rMA, dsb_DE: dsb-rDE, en_SG: en-rSG, zu_ZA: zu-rZA, mn_CN: mn-rCN, si_LK: si-rLK, sq_AL: sq-rAL, zh_HK: zh-rHK, syr_SY: syr-rSY, arn_CL: arn-rCL, be_BY: be-rBY, es_CO: es-rCO, ru_RU: ru-rRU, lt_LT: lt-rLT, mn_MN: mn-rMN, tg_TJ: tg-rTJ, as_IN: as-rIN, br_FR: br-rFR, es_HN: es-rHN, ga_IE: ga-rIE, ar_LY: ar-rLY, es_CR: es-rCR, is_IS: is-rIS, it_IT: it-rIT, zh_TW: zh-rTW, cs_CZ: cs-rCZ, fr_CA: fr-rCA, kn_IN: kn-rIN, kok_IN: kok-rIN, es_GT: es-rGT, nn_NO: nn-rNO, or_IN: or-rIN, se_NO: se-rNO, fa_IR: fa-rIR, fr_FR: fr-rFR, hi_IN: hi-rIN, hu_HU: hu-rHU, bs_BA: bs-rBA, dv_MV: dv-rMV, en_AU: en-rAU, es_PR: es-rPR, iu_CA: iu-rCA, nl_BE: nl-rBE

[o:equeim:p:tremotesf-android:r:about]
file_filter = app/src/main/res/raw-<lang>/about.html
source_file = app/src/main/res/raw/about.html
source_lang = en
type = HTML

[o:equeim:p:tremotesf-android:r:authors]
file_filter = app/src/main/res/raw-<lang>/authors.html
source_file = app/src/main/res/raw/authors.html
source_lang = en
type = HTML

[o:equeim:p:tremotesf-android:r:full_description]
file_filter = fastlane/metadata/android/<lang>/full_description.txt
source_file = fastlane/metadata/android/en-US/full_description.txt
Expand All @@ -37,4 +25,3 @@ file_filter = app/src/main/res/values-<lang>/strings.xml
source_file = app/src/main/res/values/strings.xml
source_lang = en
type = ANDROID

53 changes: 46 additions & 7 deletions app/src/main/kotlin/org/equeim/tremotesf/ui/AboutFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.equeim.tremotesf.R
import org.equeim.tremotesf.databinding.AboutFragmentBaseTabFragmentBinding
import org.equeim.tremotesf.databinding.AboutFragmentBinding
import org.equeim.tremotesf.databinding.AboutFragmentLicenseTabFragmentBinding
import timber.log.Timber


class AboutFragment : NavigationFragment(R.layout.about_fragment) {
Expand Down Expand Up @@ -77,21 +78,59 @@ class AboutFragment : NavigationFragment(R.layout.about_fragment) {
class MainTabFragment : PagerFragment(R.layout.about_fragment_base_tab_fragment) {
override fun onViewStateRestored(savedInstanceState: Bundle?) {
super.onViewStateRestored(savedInstanceState)
resources.openRawResource(R.raw.about).use { inputStream ->
with(AboutFragmentBaseTabFragmentBinding.bind(requireView())) {
textView.text = HtmlCompat.fromHtml(inputStream.reader().readText(), 0)
val html = buildString {
appendLine("""
<!DOCTYPE html>
<p>&#169; 2017-2024 Alexey Rochev &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</p>
""".trimIndent())
append("<p>")
append(getString(R.string.source_code_url, makeUrlTag(SOURCE_CODE_URL)))
appendLine("</p>")
append("<p>")
append(getString(R.string.translations_url, makeUrlTag(TRANSLATIONS_URL)))
appendLine("</p>")
}
with(AboutFragmentBaseTabFragmentBinding.bind(requireView())) {
textView.text = try {
HtmlCompat.fromHtml(html, 0)
} catch (e: Exception) {
Timber.e(e, "Failed to parse html")
null
}
}
}

private companion object {
const val SOURCE_CODE_URL = "https://github.com/equeim/tremotesf-android"
const val TRANSLATIONS_URL = "https://www.transifex.com/equeim/tremotesf-android"
fun makeUrlTag(url: String): String = """<a href="$url">$url</a>"""
}
}

class AuthorsTabFragment : PagerFragment(R.layout.about_fragment_base_tab_fragment) {
override fun onViewStateRestored(savedInstanceState: Bundle?) {
super.onViewStateRestored(savedInstanceState)

resources.openRawResource(R.raw.authors).use { inputStream ->
with(AboutFragmentBaseTabFragmentBinding.bind(requireView())) {
textView.text = HtmlCompat.fromHtml(inputStream.reader().readText(), 0)
val maintainer = getString(R.string.maintainer)
val contributor = getString(R.string.contributor)
val html = """
<!DOCTYPE html>
<p>
Alexey Rochev &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;
<br/>
<i>$maintainer</i>
</p>
<p>
Kevin Richter &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;
<br/>
<i>$contributor</i>
</p>
""".trimIndent()
with(AboutFragmentBaseTabFragmentBinding.bind(requireView())) {
textView.text = try {
HtmlCompat.fromHtml(html, 0)
} catch (e: Exception) {
Timber.e(e, "Failed to parse html")
null
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/raw-de-rDE/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-de-rDE/authors.html

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/raw-en/about.html

This file was deleted.

11 changes: 0 additions & 11 deletions app/src/main/res/raw-en/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-et/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-et/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-fr/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-fr/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-hr/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-hr/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-it/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-it/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-iw/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-iw/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-nl-rBE/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-nl-rBE/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-nl/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-nl/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-pl/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-pl/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-pt-rBR/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-pt-rBR/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-pt-rPT/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-pt-rPT/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-pt/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-pt/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-ru/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-ru/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-sk/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-sk/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-tr/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-tr/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-vi-rVN/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-vi-rVN/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-vi/about.html

This file was deleted.

7 changes: 0 additions & 7 deletions app/src/main/res/raw-vi/authors.html

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/raw-zh-rCN/about.html

This file was deleted.

Loading

0 comments on commit e8bf69a

Please sign in to comment.