Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

[WIP] Moved over to use NSLocale#5

Open
mRs- wants to merge 1 commit intofrankrausch:mainfrom
mRs-:master
Open

[WIP] Moved over to use NSLocale#5
mRs- wants to merge 1 commit intofrankrausch:mainfrom
mRs-:master

Conversation

@mRs-
Copy link
Copy Markdown

@mRs- mRs- commented May 20, 2017

I studied a little bit in the newest NSLocale features from iOS 10 and found that there are four new properties on NSLocale.

quotationBeginDelimiter
quotationEndDelimiter
alternateQuotationBeginDelimiter
alternateQuotationEndDelimiter

My first approach was to eliminate the string best guessing stuff in the API Design to move over to a struct. Then I found out that we can do better and maybe use Apples API to get the locales.

But the Unit-Tests are not on my side. I don't know anything about quotation marks so I created a list of all possibilities that you can check if it's really the right ones that we are getting back from Apple. When we find out, that's not the right one maybe we should file some bug reports to support this in the future of NSLocale :)

[af] “, ”, ‘, ’
[af_NA] “, ”, ‘, ’
[af_ZA] “, ”, ‘, ’
[agq] „, ”, ‚, ’
[agq_CM] „, ”, ‚, ’
[ak] “, ”, ‘, ’
[ak_GH] “, ”, ‘, ’
[am] «, », ‹, ›
[am_ET] «, », ‹, ›
[ar] ", ", ', '
[ar_001] ", ", ', '
[ar_AE] ", ", ', '
[ar_BH] ", ", ', '
[ar_DJ] ", ", ', '
[ar_DZ] ", ", ', '
[ar_EG] ", ", ', '
[ar_EH] ", ", ', '
[ar_ER] ", ", ', '
[ar_IL] ", ", ', '
[ar_IQ] ", ", ', '
[ar_JO] ", ", ', '
[ar_KM] ", ", ', '
[ar_KW] ", ", ', '
[ar_LB] ", ", ', '
[ar_LY] ", ", ', '
[ar_MA] ", ", ', '
[ar_MR] ", ", ', '
[ar_OM] ", ", ', '
[ar_PS] ", ", ', '
[ar_QA] ", ", ', '
[ar_SA] ", ", ', '
[ar_SD] ", ", ', '
[ar_SO] ", ", ', '
[ar_SS] ", ", ', '
[ar_SY] ", ", ', '
[ar_TD] ", ", ', '
[ar_TN] ", ", ', '
[ar_YE] ", ", ', '
[ars] ", ", ', '
[as] “, ”, ‘, ’
[as_IN] “, ”, ‘, ’
[asa] “, ”, ‘, ’
[asa_TZ] “, ”, ‘, ’
[ast] «, », “, ”
[ast_ES] «, », “, ”
[az] “, ”, ‘, ’
[az-Cyrl] «, », ‹, ›
[az-Cyrl_AZ] «, », ‹, ›
[az] “, ”, ‘, ’
[az_AZ] “, ”, ‘, ’
[bas] «, », „, “
[bas_CM] «, », „, “
[be] «, », «, »
[be_BY] «, », «, »
[bem] “, ”, ‘, ’
[bem_ZM] “, ”, ‘, ’
[bez] “, ”, ‘, ’
[bez_TZ] “, ”, ‘, ’
[bg] „, “, „, “
[bg_BG] „, “, „, “
[bm] «, », “, ”
[bm_ML] «, », “, ”
[bn] “, ”, ‘, ’
[bn_BD] “, ”, ‘, ’
[bn_IN] “, ”, ‘, ’
[bo] “, ”, ‘, ’
[bo_CN] “, ”, ‘, ’
[bo_IN] “, ”, ‘, ’
[br] «, », “, ”
[br_FR] «, », “, ”
[brx] “, ”, ‘, ’
[brx_IN] “, ”, ‘, ’
[bs] „, “, ‘, ’
[bs-Cyrl] „, “, ‚, ‘
[bs-Cyrl_BA] „, “, ‚, ‘
[bs] „, “, ‘, ’
[bs_BA] „, “, ‘, ’
[ca] «, », “, ”
[ca_AD] «, », “, ”
[ca_ES] «, », “, ”
[ca_FR] «, », “, ”
[ca_IT] «, », “, ”
[ce] “, ”, ‘, ’
[ce_RU] “, ”, ‘, ’
[cgg] “, ”, ‘, ’
[cgg_UG] “, ”, ‘, ’
[chr] “, ”, ‘, ’
[chr_US] “, ”, ‘, ’
[ckb] “, ”, ‘, ’
[ckb_IQ] “, ”, ‘, ’
[ckb_IR] “, ”, ‘, ’
[cs] „, “, ‚, ‘
[cs_CZ] „, “, ‚, ‘
[cy] ‘, ’, “, ”
[cy_GB] ‘, ’, “, ”
[da] “, ”, ‘, ’
[da_DK] “, ”, ‘, ’
[da_GL] “, ”, ‘, ’
[dav] “, ”, ‘, ’
[dav_KE] “, ”, ‘, ’
[de] „, “, ‚, ‘
[de_AT] „, “, ‚, ‘
[de_BE] „, “, ‚, ‘
[de_CH] „, “, ‚, ‘
[de_DE] „, “, ‚, ‘
[de_LI] „, “, ‚, ‘
[de_LU] „, “, ‚, ‘
[dje] “, ”, ‘, ’
[dje_NE] “, ”, ‘, ’
[dsb] „, “, ‚, ‘
[dsb_DE] „, “, ‚, ‘
[dua] «, », ‘, ’
[dua_CM] «, », ‘, ’
[dyo] «, », “, ”
[dyo_SN] «, », “, ”
[dz] “, ”, ‘, ’
[dz_BT] “, ”, ‘, ’
[ebu] “, ”, ‘, ’
[ebu_KE] “, ”, ‘, ’
[ee] “, ”, ‘, ’
[ee_GH] “, ”, ‘, ’
[ee_TG] “, ”, ‘, ’
[el] «, », “, ”
[el_CY] «, », “, ”
[el_GR] «, », “, ”
[en] “, ”, ‘, ’
[en_001] “, ”, ‘, ’
[en_150] “, ”, ‘, ’
[en_AD] “, ”, ‘, ’
[en_AG] “, ”, ‘, ’
[en_AI] “, ”, ‘, ’
[en_AL] “, ”, ‘, ’
[en_AS] “, ”, ‘, ’
[en_AT] “, ”, ‘, ’
[en_AU] “, ”, ‘, ’
[en_BA] “, ”, ‘, ’
[en_BB] “, ”, ‘, ’
[en_BE] “, ”, ‘, ’
[en_BI] “, ”, ‘, ’
[en_BM] “, ”, ‘, ’
[en_BR] “, ”, ‘, ’
[en_BS] “, ”, ‘, ’
[en_BW] “, ”, ‘, ’
[en_BZ] “, ”, ‘, ’
[en_CA] “, ”, ‘, ’
[en_CC] “, ”, ‘, ’
[en_CH] “, ”, ‘, ’
[en_CK] “, ”, ‘, ’
[en_CM] “, ”, ‘, ’
[en_CN] “, ”, ‘, ’
[en_CX] “, ”, ‘, ’
[en_CY] “, ”, ‘, ’
[en_CZ] “, ”, ‘, ’
[en_DE] “, ”, ‘, ’
[en_DG] “, ”, ‘, ’
[en_DK] “, ”, ‘, ’
[en_DM] “, ”, ‘, ’
[en_EE] “, ”, ‘, ’
[en_ER] “, ”, ‘, ’
[en_ES] “, ”, ‘, ’
[en_FI] “, ”, ‘, ’
[en_FJ] “, ”, ‘, ’
[en_FK] “, ”, ‘, ’
[en_FM] “, ”, ‘, ’
[en_FR] “, ”, ‘, ’
[en_GB] “, ”, ‘, ’
[en_GD] “, ”, ‘, ’
[en_GG] “, ”, ‘, ’
[en_GH] “, ”, ‘, ’
[en_GI] “, ”, ‘, ’
[en_GM] “, ”, ‘, ’
[en_GR] “, ”, ‘, ’
[en_GU] “, ”, ‘, ’
[en_GY] “, ”, ‘, ’
[en_HK] “, ”, ‘, ’
[en_HR] “, ”, ‘, ’
[en_HU] “, ”, ‘, ’
[en_IE] “, ”, ‘, ’
[en_IL] “, ”, ‘, ’
[en_IM] “, ”, ‘, ’
[en_IN] “, ”, ‘, ’
[en_IO] “, ”, ‘, ’
[en_IS] “, ”, ‘, ’
[en_IT] “, ”, ‘, ’
[en_JE] “, ”, ‘, ’
[en_JM] “, ”, ‘, ’
[en_JP] “, ”, ‘, ’
[en_KE] “, ”, ‘, ’
[en_KI] “, ”, ‘, ’
[en_KN] “, ”, ‘, ’
[en_KR] “, ”, ‘, ’
[en_KY] “, ”, ‘, ’
[en_LC] “, ”, ‘, ’
[en_LR] “, ”, ‘, ’
[en_LS] “, ”, ‘, ’
[en_LT] “, ”, ‘, ’
[en_LU] “, ”, ‘, ’
[en_LV] “, ”, ‘, ’
[en_ME] “, ”, ‘, ’
[en_MG] “, ”, ‘, ’
[en_MH] “, ”, ‘, ’
[en_MO] “, ”, ‘, ’
[en_MP] “, ”, ‘, ’
[en_MS] “, ”, ‘, ’
[en_MT] “, ”, ‘, ’
[en_MU] “, ”, ‘, ’
[en_MV] “, ”, ‘, ’
[en_MW] “, ”, ‘, ’
[en_MY] “, ”, ‘, ’
[en_NA] “, ”, ‘, ’
[en_NF] “, ”, ‘, ’
[en_NG] “, ”, ‘, ’
[en_NL] “, ”, ‘, ’
[en_NO] “, ”, ‘, ’
[en_NR] “, ”, ‘, ’
[en_NU] “, ”, ‘, ’
[en_NZ] “, ”, ‘, ’
[en_PG] “, ”, ‘, ’
[en_PH] “, ”, ‘, ’
[en_PK] “, ”, ‘, ’
[en_PL] “, ”, ‘, ’
[en_PN] “, ”, ‘, ’
[en_PR] “, ”, ‘, ’
[en_PT] “, ”, ‘, ’
[en_PW] “, ”, ‘, ’
[en_RO] “, ”, ‘, ’
[en_RU] “, ”, ‘, ’
[en_RW] “, ”, ‘, ’
[en_SB] “, ”, ‘, ’
[en_SC] “, ”, ‘, ’
[en_SD] “, ”, ‘, ’
[en_SE] “, ”, ‘, ’
[en_SG] “, ”, ‘, ’
[en_SH] “, ”, ‘, ’
[en_SI] “, ”, ‘, ’
[en_SK] “, ”, ‘, ’
[en_SL] “, ”, ‘, ’
[en_SS] “, ”, ‘, ’
[en_SX] “, ”, ‘, ’
[en_SZ] “, ”, ‘, ’
[en_TC] “, ”, ‘, ’
[en_TK] “, ”, ‘, ’
[en_TO] “, ”, ‘, ’
[en_TR] “, ”, ‘, ’
[en_TT] “, ”, ‘, ’
[en_TV] “, ”, ‘, ’
[en_TW] “, ”, ‘, ’
[en_TZ] “, ”, ‘, ’
[en_UG] “, ”, ‘, ’
[en_UM] “, ”, ‘, ’
[en_US] “, ”, ‘, ’
[en_US_POSIX] “, ”, ‘, ’
[en_VC] “, ”, ‘, ’
[en_VG] “, ”, ‘, ’
[en_VI] “, ”, ‘, ’
[en_VU] “, ”, ‘, ’
[en_WS] “, ”, ‘, ’
[en_ZA] “, ”, ‘, ’
[en_ZM] “, ”, ‘, ’
[en_ZW] “, ”, ‘, ’
[eo] “, ”, ‘, ’
[es] «, », “, ”
[es_419] “, ”, ‘, ’
[es_AR] “, ”, ‘, ’
[es_BO] “, ”, ‘, ’
[es_BZ] “, ”, ‘, ’
[es_CL] “, ”, ‘, ’
[es_CO] “, ”, ‘, ’
[es_CR] “, ”, ‘, ’
[es_CU] “, ”, ‘, ’
[es_DO] “, ”, ‘, ’
[es_EA] «, », “, ”
[es_EC] “, ”, ‘, ’
[es_ES] «, », “, ”
[es_GQ] «, », “, ”
[es_GT] “, ”, ‘, ’
[es_HN] “, ”, ‘, ’
[es_IC] «, », “, ”
[es_MX] “, ”, ‘, ’
[es_NI] “, ”, ‘, ’
[es_PA] “, ”, ‘, ’
[es_PE] “, ”, ‘, ’
[es_PH] «, », “, ”
[es_PR] “, ”, ‘, ’
[es_PY] “, ”, ‘, ’
[es_SV] “, ”, ‘, ’
[es_US] “, ”, ‘, ’
[es_UY] “, ”, ‘, ’
[es_VE] “, ”, ‘, ’
[et] „, “, ‚, ‘
[et_EE] „, “, ‚, ‘
[eu] “, ”, “, ”
[eu_ES] “, ”, “, ”
[ewo] «, », “, ”
[ewo_CM] «, », “, ”
[fa] «, », ‹, ›
[fa_AF] «, », ‹, ›
[fa_IR] «, », ‹, ›
[ff] „, ”, ‚, ’
[ff_CM] „, ”, ‚, ’
[ff_GN] „, ”, ‚, ’
[ff_MR] „, ”, ‚, ’
[ff_SN] „, ”, ‚, ’
[fi] ”, ”, ’, ’
[fi_FI] ”, ”, ’, ’
[fil] “, ”, ‘, ’
[fil_PH] “, ”, ‘, ’
[fo] “, ”, ‘, ’
[fo_DK] “, ”, ‘, ’
[fo_FO] “, ”, ‘, ’
[fr] «, », «, »
[fr_BE] «, », «, »
[fr_BF] «, », «, »
[fr_BI] «, », «, »
[fr_BJ] «, », «, »
[fr_BL] «, », «, »
[fr_CA] «, », «, »
[fr_CD] «, », «, »
[fr_CF] «, », «, »
[fr_CG] «, », «, »
[fr_CH] «, », ‹, ›
[fr_CI] «, », «, »
[fr_CM] «, », «, »
[fr_DJ] «, », «, »
[fr_DZ] «, », «, »
[fr_FR] «, », «, »
[fr_GA] «, », «, »
[fr_GF] «, », «, »
[fr_GN] «, », «, »
[fr_GP] «, », «, »
[fr_GQ] «, », «, »
[fr_HT] «, », «, »
[fr_KM] «, », «, »
[fr_LU] «, », «, »
[fr_MA] «, », «, »
[fr_MC] «, », «, »
[fr_MF] «, », «, »
[fr_MG] «, », «, »
[fr_ML] «, », «, »
[fr_MQ] «, », «, »
[fr_MR] «, », «, »
[fr_MU] «, », «, »
[fr_NC] «, », «, »
[fr_NE] «, », «, »
[fr_PF] «, », «, »
[fr_PM] «, », «, »
[fr_RE] «, », «, »
[fr_RW] «, », «, »
[fr_SC] «, », «, »
[fr_SN] «, », «, »
[fr_SY] «, », «, »
[fr_TD] «, », «, »
[fr_TG] «, », «, »
[fr_TN] «, », «, »
[fr_VU] «, », «, »
[fr_WF] «, », «, »
[fr_YT] «, », «, »
[fur] ‘, ’, “, ”
[fur_IT] ‘, ’, “, ”
[fy] “, ”, ‘, ’
[fy_NL] “, ”, ‘, ’
[ga] “, ”, ‘, ’
[ga_IE] “, ”, ‘, ’
[gd] “, ”, ‘, ’
[gd_GB] “, ”, ‘, ’
[gl] “, ”, ‘, ’
[gl_ES] “, ”, ‘, ’
[gsw] «, », ‹, ›
[gsw_CH] «, », ‹, ›
[gsw_FR] «, », ‹, ›
[gsw_LI] «, », ‹, ›
[gu] “, ”, ‘, ’
[gu_IN] “, ”, ‘, ’
[guz] “, ”, ‘, ’
[guz_KE] “, ”, ‘, ’
[gv] “, ”, ‘, ’
[gv_IM] “, ”, ‘, ’
[ha] “, ”, ‘, ’
[ha_GH] “, ”, ‘, ’
[ha_NE] “, ”, ‘, ’
[ha_NG] “, ”, ‘, ’
[haw] “, ”, ‘, ’
[haw_US] “, ”, ‘, ’
[he] ", ", ', '
[he_IL] ", ", ', '
[hi] “, ”, ‘, ’
[hi_IN] “, ”, ‘, ’
[hr] „, “, ‚, ‘
[hr_BA] „, “, ‚, ‘
[hr_HR] „, “, ‚, ‘
[hsb] „, “, ‚, ‘
[hsb_DE] „, “, ‚, ‘
[hu] „, ”, », «
[hu_HU] „, ”, », «
[hy] «, », «, »
[hy_AM] «, », «, »
[id] “, ”, ‘, ’
[id_ID] “, ”, ‘, ’
[ig] “, ”, ‘, ’
[ig_NG] “, ”, ‘, ’
[ii] “, ”, ‘, ’
[ii_CN] “, ”, ‘, ’
[is] „, “, ‚, ‘
[is_IS] „, “, ‚, ‘
[it] «, », “, ”
[it_CH] «, », “, ”
[it_IT] «, », “, ”
[it_SM] «, », “, ”
[iu] “, ”, ‘, ’
[iu_CA] “, ”, ‘, ’
[ja] 「, 」, 『, 』
[ja_JP] 「, 」, 『, 』
[jgo] «, », ‹, ›
[jgo_CM] «, », ‹, ›
[jmc] “, ”, ‘, ’
[jmc_TZ] “, ”, ‘, ’
[ka] „, “, «, »
[ka_GE] „, “, «, »
[kab] «, », “, ”
[kab_DZ] «, », “, ”
[kam] “, ”, ‘, ’
[kam_KE] “, ”, ‘, ’
[kde] “, ”, ‘, ’
[kde_TZ] “, ”, ‘, ’
[kea] “, ”, ‘, ’
[kea_CV] “, ”, ‘, ’
[khq] “, ”, ‘, ’
[khq_ML] “, ”, ‘, ’
[ki] “, ”, ‘, ’
[ki_KE] “, ”, ‘, ’
[kk] «, », “, ”
[kk_KZ] «, », “, ”
[kkj] «, », ‹, ›
[kkj_CM] «, », ‹, ›
[kl] “, ”, ‘, ’
[kl_GL] “, ”, ‘, ’
[kln] “, ”, ‘, ’
[kln_KE] “, ”, ‘, ’
[km] “, ”, ‘, ’
[km_KH] “, ”, ‘, ’
[kn] “, ”, ‘, ’
[kn_IN] “, ”, ‘, ’
[ko] “, ”, ‘, ’
[ko_KP] “, ”, ‘, ’
[ko_KR] “, ”, ‘, ’
[kok] “, ”, ‘, ’
[kok_IN] “, ”, ‘, ’
[ks] “, ”, ‘, ’
[ks_IN] “, ”, ‘, ’
[ksb] “, ”, ‘, ’
[ksb_TZ] “, ”, ‘, ’
[ksf] «, », ‘, ’
[ksf_CM] «, », ‘, ’
[ksh] „, “, ‚, ‘
[ksh_DE] „, “, ‚, ‘
[kw] “, ”, ‘, ’
[kw_GB] “, ”, ‘, ’
[ky] «, », „, “
[ky_KG] «, », „, “
[lag] ”, ”, ’, ’
[lag_TZ] ”, ”, ’, ’
[lb] „, “, ‚, ‘
[lb_LU] „, “, ‚, ‘
[lg] “, ”, ‘, ’
[lg_UG] “, ”, ‘, ’
[lkt] “, ”, ‘, ’
[lkt_US] “, ”, ‘, ’
[ln] “, ”, ‘, ’
[ln_AO] “, ”, ‘, ’
[ln_CD] “, ”, ‘, ’
[ln_CF] “, ”, ‘, ’
[ln_CG] “, ”, ‘, ’
[lo] “, ”, ‘, ’
[lo_LA] “, ”, ‘, ’
[lrc] “, ”, ‘, ’
[lrc_IQ] “, ”, ‘, ’
[lrc_IR] “, ”, ‘, ’
[lt] „, “, „, “
[lt_LT] „, “, „, “
[lu] “, ”, ‘, ’
[lu_CD] “, ”, ‘, ’
[luo] “, ”, ‘, ’
[luo_KE] “, ”, ‘, ’
[luy] „, “, ‚, ‘
[luy_KE] „, “, ‚, ‘
[lv] “, ”, ‘, ’
[lv_LV] “, ”, ‘, ’
[mas] “, ”, ‘, ’
[mas_KE] “, ”, ‘, ’
[mas_TZ] “, ”, ‘, ’
[mer] “, ”, ‘, ’
[mer_KE] “, ”, ‘, ’
[mfe] “, ”, ‘, ’
[mfe_MU] “, ”, ‘, ’
[mg] «, », “, ”
[mg_MG] «, », “, ”
[mgh] “, ”, ‘, ’
[mgh_MZ] “, ”, ‘, ’
[mgo] “, ”, ‘, ’
[mgo_CM] “, ”, ‘, ’
[mk] „, “, ‚, ‘
[mk_MK] „, “, ‚, ‘
[ml] “, ”, ‘, ’
[ml_IN] “, ”, ‘, ’
[mn] “, ”, ‘, ’
[mn_MN] “, ”, ‘, ’
[mr] “, ”, ‘, ’
[mr_IN] “, ”, ‘, ’
[ms] “, ”, ‘, ’
[ms-Arab] ”, “, ’, ‘
[ms-Arab_BN] ”, “, ’, ‘
[ms-Arab_MY] ”, “, ’, ‘
[ms_BN] “, ”, ‘, ’
[ms_MY] “, ”, ‘, ’
[ms_SG] “, ”, ‘, ’
[mt] “, ”, ‘, ’
[mt_MT] “, ”, ‘, ’
[mua] «, », “, ”
[mua_CM] «, », “, ”
[my] “, ”, ‘, ’
[my_MM] “, ”, ‘, ’
[mzn] «, », ‹, ›
[mzn_IR] «, », ‹, ›
[naq] “, ”, ‘, ’
[naq_NA] “, ”, ‘, ’
[nb] «, », ‘, ’
[nb_NO] «, », ‘, ’
[nb_SJ] «, », ‘, ’
[nd] “, ”, ‘, ’
[nd_ZW] “, ”, ‘, ’
[ne] “, ”, ‘, ’
[ne_IN] “, ”, ‘, ’
[ne_NP] “, ”, ‘, ’
[nl] ‘, ’, “, ”
[nl_AW] ‘, ’, “, ”
[nl_BE] ‘, ’, “, ”
[nl_BQ] ‘, ’, “, ”
[nl_CW] ‘, ’, “, ”
[nl_NL] ‘, ’, “, ”
[nl_SR] ‘, ’, “, ”
[nl_SX] ‘, ’, “, ”
[nmg] „, ”, «, »
[nmg_CM] „, ”, «, »
[nn] «, », ‘, ’
[nn_NO] «, », ‘, ’
[nnh] «, », “, ”
[nnh_CM] «, », “, ”
[nus] “, ”, ‘, ’
[nus_SS] “, ”, ‘, ’
[nyn] “, ”, ‘, ’
[nyn_UG] “, ”, ‘, ’
[om] “, ”, ‘, ’
[om_ET] “, ”, ‘, ’
[om_KE] “, ”, ‘, ’
[or] “, ”, ‘, ’
[or_IN] “, ”, ‘, ’
[os] «, », „, “
[os_GE] «, », „, “
[os_RU] «, », „, “
[pa] “, ”, ‘, ’
[pa-Arab] “, ”, ‘, ’
[pa-Arab_PK] “, ”, ‘, ’
[pa] “, ”, ‘, ’
[pa_IN] “, ”, ‘, ’
[pl] „, ”, «, »
[pl_PL] „, ”, «, »
[ps] “, ”, ‘, ’
[ps_AF] “, ”, ‘, ’
[pt] “, ”, ‘, ’
[pt_AO] «, », “, ”
[pt_BR] “, ”, ‘, ’
[pt_CV] «, », “, ”
[pt_GW] «, », “, ”
[pt_MO] «, », “, ”
[pt_MZ] «, », “, ”
[pt_PT] «, », “, ”
[pt_ST] «, », “, ”
[pt_TL] «, », “, ”
[qu] “, ”, ‘, ’
[qu_BO] “, ”, ‘, ’
[qu_EC] “, ”, ‘, ’
[qu_PE] “, ”, ‘, ’
[rm] «, », ‹, ›
[rm_CH] «, », ‹, ›
[rn] ”, ”, ’, ’
[rn_BI] ”, ”, ’, ’
[ro] „, ”, «, »
[ro_MD] „, ”, «, »
[ro_RO] „, ”, «, »
[rof] “, ”, ‘, ’
[rof_TZ] “, ”, ‘, ’
[ru] «, », „, “
[ru_BY] «, », „, “
[ru_KG] «, », „, “
[ru_KZ] «, », „, “
[ru_MD] «, », „, “
[ru_RU] «, », „, “
[ru_UA] «, », „, “
[rw] «, », ‘, ’
[rw_RW] «, », ‘, ’
[rwk] “, ”, ‘, ’
[rwk_TZ] “, ”, ‘, ’
[sah] “, ”, ‘, ’
[sah_RU] “, ”, ‘, ’
[saq] “, ”, ‘, ’
[saq_KE] “, ”, ‘, ’
[sbp] “, ”, ‘, ’
[sbp_TZ] “, ”, ‘, ’
[se] ”, ”, ’, ’
[se_FI] ”, ”, ’, ’
[se_NO] ”, ”, ’, ’
[se_SE] ”, ”, ’, ’
[seh] “, ”, ‘, ’
[seh_MZ] “, ”, ‘, ’
[ses] “, ”, ‘, ’
[ses_ML] “, ”, ‘, ’
[sg] «, », “, ”
[sg_CF] «, », “, ”
[shi] «, », „, ”
[shi] «, », „, ”
[shi_MA] «, », „, ”
[shi-Tfng] «, », „, ”
[shi-Tfng_MA] «, », „, ”
[si] “, ”, ‘, ’
[si_LK] “, ”, ‘, ’
[sk] „, “, ‚, ‘
[sk_SK] „, “, ‚, ‘
[sl] „, “, ‚, ‘
[sl_SI] „, “, ‚, ‘
[smn] “, ”, ‘, ’
[smn_FI] “, ”, ‘, ’
[sn] ”, ”, ’, ’
[sn_ZW] ”, ”, ’, ’
[so] “, ”, ‘, ’
[so_DJ] “, ”, ‘, ’
[so_ET] “, ”, ‘, ’
[so_KE] “, ”, ‘, ’
[so_SO] “, ”, ‘, ’
[sq] «, », “, ”
[sq_AL] «, », “, ”
[sq_MK] «, », “, ”
[sq_XK] «, », “, ”
[sr] „, “, ‘, ‘
[sr] „, “, ‘, ‘
[sr_BA] „, “, ‘, ‘
[sr_ME] „, “, ‘, ‘
[sr_RS] „, “, ‘, ‘
[sr_XK] „, “, ‘, ‘
[sr-Latn] „, “, ‘, ‘
[sr-Latn_BA] „, “, ‘, ‘
[sr-Latn_ME] „, “, ‘, ‘
[sr-Latn_RS] „, “, ‘, ‘
[sr-Latn_XK] „, “, ‘, ‘
[sv] ”, ”, ’, ’
[sv_AX] ”, ”, ’, ’
[sv_FI] ”, ”, ’, ’
[sv_SE] ”, ”, ’, ’
[sw] “, ”, ‘, ’
[sw_CD] “, ”, ‘, ’
[sw_KE] “, ”, ‘, ’
[sw_TZ] “, ”, ‘, ’
[sw_UG] “, ”, ‘, ’
[ta] “, ”, ‘, ’
[ta_IN] “, ”, ‘, ’
[ta_LK] “, ”, ‘, ’
[ta_MY] “, ”, ‘, ’
[ta_SG] “, ”, ‘, ’
[te] “, ”, ‘, ’
[te_IN] “, ”, ‘, ’
[teo] “, ”, ‘, ’
[teo_KE] “, ”, ‘, ’
[teo_UG] “, ”, ‘, ’
[tg] «, », «, „
[tg_TJ] «, », «, „
[th] “, ”, ‘, ’
[th_TH] “, ”, ‘, ’
[ti] “, ”, ‘, ’
[ti_ER] ‘, ’, “, ”
[ti_ET] “, ”, ‘, ’
[tk] “, ”, “, ”
[tk_TM] “, ”, “, ”
[to] “, ”, ‘, ’
[to_TO] “, ”, ‘, ’
[tr] “, ”, ‘, ’
[tr_CY] “, ”, ‘, ’
[tr_TR] “, ”, ‘, ’
[twq] “, ”, ‘, ’
[twq_NE] “, ”, ‘, ’
[tzm] “, ”, ‘, ’
[tzm_MA] “, ”, ‘, ’
[ug] », «, ›, ‹
[ug_CN] », «, ›, ‹
[uk] «, », „, “
[uk_UA] «, », „, “
[ur] ”, “, ’, ‘
[ur_IN] ”, “, ’, ‘
[ur_PK] ”, “, ’, ‘
[uz] “, ”, ’, ‘
[uz-Arab] “, ”, ‘, ’
[uz-Arab_AF] “, ”, ‘, ’
[uz] “, ”, ’, ‘
[uz_UZ] “, ”, ’, ‘
[uz-Latn] “, ”, ’, ‘
[uz-Latn_UZ] “, ”, ’, ‘
[vai] “, ”, ‘, ’
[vai-Latn] “, ”, ‘, ’
[vai-Latn_LR] “, ”, ‘, ’
[vai] “, ”, ‘, ’
[vai_LR] “, ”, ‘, ’
[vi] “, ”, ‘, ’
[vi_VN] “, ”, ‘, ’
[vun] “, ”, ‘, ’
[vun_TZ] “, ”, ‘, ’
[wae] «, », ‹, ›
[wae_CH] «, », ‹, ›
[xog] “, ”, ‘, ’
[xog_UG] “, ”, ‘, ’
[yav] «, », «, »
[yav_CM] «, », «, »
[yi] ”, ”, ’, ’
[yi_001] ”, ”, ’, ’
[yo] “, ”, ‘, ’
[yo_BJ] “, ”, ‘, ’
[yo_NG] “, ”, ‘, ’
[yue] 「, 」, 『, 』
[yue_HK] 「, 」, 『, 』
[zgh] «, », „, ”
[zgh_MA] «, », „, ”
[zh] “, ”, ‘, ’
[zh-Hans] “, ”, ‘, ’
[zh_CN] “, ”, ‘, ’
[zh-Hans_HK] “, ”, ‘, ’
[zh-Hans_MO] “, ”, ‘, ’
[zh_SG] “, ”, ‘, ’
[zh-Hant] 「, 」, 『, 』
[zh_HK] 「, 」, 『, 』
[zh_MO] 「, 」, 『, 』
[zh_TW] 「, 」, 『, 』
[zu] “, ”, ‘, ’
[zu_ZA] “, ”, ‘, ’

If you want to generate the list on your own just drop the line of codes in a playground

for localeIdentifier in NSLocale.availableLocaleIdentifiers.sorted() {
    let locale = NSLocale(localeIdentifier: localeIdentifier)
    print("[\(locale.localeIdentifier)] \(locale.quotationBeginDelimiter), \(locale.quotationEndDelimiter), \(locale.alternateQuotationBeginDelimiter), \(locale.alternateQuotationEndDelimiter)")
}

@regexident
Copy link
Copy Markdown
Contributor

regexident commented May 20, 2017

Hahaha, you gotta be kidding me. 😂

My first approach was to eliminate the string best guessing stuff in the API Design to move over to a struct. Then I found out that we can do better and maybe use Apples API to get the locales.

Me, yesterday. 🙈

I had just started a PR for this yesterday evening, too, but then got distracted.

@frankrausch
Copy link
Copy Markdown
Owner

Hey Marius,

wow, great work! Thank you. This is indeed way more elegant and makes the whole thing more concise and readable.

A few thoughts:

(1) Is it correct that this change will require iOS 10? I saw that this info also exists in Core Foundation’s CFLocaleKey as alternateQuotationEndDelimiterKey etc. and has been around since iOS 4.
I’m all for dropping legacy support rather sooner than later, but I want to keep supporting iOS 9.3 for a little while in V for Wikipedia, at least until iOS 11 comes out. 😛

(2) For Swiss German (de_CH), the quotations marks are not correct in NSLocale. I haven’t checked the rest yet, but it’s of course possible that there more cases where an override will be necessary (until Apple decides to maybe change it someday).
Wouldn’t it make sense to use NSLocale and then add some customizations on top if required? Not only to fix the Apple-supplied quote info, but I’d love to support per-language stylistic alternatives in the long run. For example German typography allows two variations („Anführungszeichen“/‚Anführungszeichen‘ OR »Anführungszeichen«/›Anführungszeichen‹). Or even three, because the Swiss German style is also correct in Germany.

(3) French needs non-breaking spaces to separate the quotation marks from the words. Actually they should be non-breaking thin spaces (U+202F), but since browser (aka WebView) support and font support to render them correctly is patchy, I decided to use normal no-break spaces instead. I’m not sure how many French texts there are in the real world that need conversion from dumb quotes to smart quotes, as normally the French seem more conscious about using correct punctuation. So I’m not sure how critical it would be to drop support for adding the extra spaces.

(4) On the unit tests: I think the current solution is rather repetitive and—especially as soon as we use NSLocale—we don’t need to test every language specifically if the test string remains the same.
I propose just testing with one language like Swiss German that has quotes that are all distinct from each other and from the apostrophe («, », , , ). Because what we really want to test is whether the algorithm detects correctly where to put which of these five things. Right?

Language-specific testing would make much more sense for long texts that are actually written in the language at hand. Plus, I think it would be great feed the test with a long, tricky text with all the edge cases that Typographizer can already handle correctly, instead of testing the current—rather simple—string that only triggers the easiest replacement situations.

🤔

@regexident
Copy link
Copy Markdown
Contributor

regexident commented May 22, 2017

(1) Is it correct that this change will require iOS 10?

This is indeed the case. While NSLocale has been available for years, the particular properties have only been added with iOS 10.0. Bummer.

I’m all for dropping legacy support rather sooner than later, but I want to keep supporting iOS 9.3 for a little while in V for Wikipedia, at least until iOS 11 comes out. 😛

Fair point. One might want to at least open a tracking issue for it then, for future reference. Preferably with a note explaining why the change is to be considered blocked for now.

(2) For Swiss German (de_CH), the quotations marks are not correct in NSLocale. I haven’t checked the rest yet, but it’s of course possible that there more cases where an override will be necessary (until Apple decides to maybe change it someday).
Wouldn’t it make sense to use NSLocale and then add some customizations on top if required? Not only to fix the Apple-supplied quote info, but I’d love to support per-language stylistic alternatives in the long run. For example German typography allows two variations („Anführungszeichen“/‚Anführungszeichen‘ OR »Anführungszeichen«/›Anführungszeichen‹). Or even three, because the Swiss German style is also correct in Germany.

Absolutely.

(3) French needs non-breaking spaces to separate the quotation marks from the words. Actually they should be non-breaking thin spaces (U+202F), but since browser (aka WebView) support and font support to render them correctly is patchy, I decided to use normal no-break spaces instead. I’m not sure how many French texts there are in the real world that need conversion from dumb quotes to smart quotes, as normally the French seem more conscious about using correct punctuation. So I’m not sure how critical it would be to drop support for adding the extra spaces.

Interesting, so in theory one might want to also check valid french smart quotes for the existence of those additional spaces.

(4) On the unit tests: I think the current solution is rather repetitive and—especially as soon as we use NSLocale—we don’t need to test every language specifically if the test string remains the same.
I propose just testing with one language like Swiss German that has quotes that are all distinct from each other and from the apostrophe («, », ‹, ›, ’). Because what we really want to test is whether the algorithm detects correctly where to put which of these five things. Right?

Yes. I added the tests in preparation for my PR which would have been equivalent to this one.

We would probably want to have a single test for the general case and then at least one for each custom override (see discussion above).

Language-specific testing would make much more sense for long texts that are actually written in the language at hand. Plus, I think it would be great feed the test with a long, tricky text with all the edge cases that Typographizer can already handle correctly, instead of testing the current—rather simple—string that only triggers the easiest replacement situations.

Absolutely. Tests would shine for edge-casy stuff like Rock ʼnʼ Roll and ʼ80s.


Btw, @mRs- you can wrap long snippets in <details>…</details> for easier scrolling. 😉

@mRs-
Copy link
Copy Markdown
Author

mRs- commented May 22, 2017

Maybe we should file a radar with the right quotation delimiters to apple to be fixed in iOS 11 or later.

@frankrausch
Copy link
Copy Markdown
Owner

Yes, filing a radar about the quote style makes sense. I’ll try to find out what the preferred variants in de_BE, de_LI, and de_LU are; I’m not sure if they prefer the Swiss or the German/Austrian quotes.

Maybe I should drop your NSLocale-generated list at the next Typostammtisch event in Berlin and typenerd-crowdsource the process.

@mRs-
Copy link
Copy Markdown
Author

mRs- commented May 23, 2017

That sounds great!

And would be the right approach to do this. If we are already using NSLocale and Apple is defining a way to support this everyone can profit about this. Maybe this can be Implemented right away in the Apple System for using the right qutoation styles :)

@signalwerk
Copy link
Copy Markdown
Contributor

signalwerk commented Jul 19, 2018

@frankrausch for de_LI I got tought to use « ‹ › » in school (Schule für Gestaltung Zürich – Switzerland). Also check Liechtensteiner Volksblatt» (of course the online version is wrong...)

Base automatically changed from master to main March 3, 2021 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants