==Proposed design solution
- Allow all eight Chinese variants to be selected as primary language (via Settings) and to be selected on a per-article basis (from the in-article language picker)
- Variants supported, in order of how they should appear in all lists:
- 简体 Chinese, Simplified (zh-hans)
- 繁體 Chinese, Traditional (zh-hant)
- 大陆简体 Mainland Simplified (zh-cn)
- 香港繁體 Hong Kong Traditional (zh-hk)
- 澳門繁體 Macau Traditional (zh-mo)
- 大马简体 Malaysia Simplified (zh-my)
- 新加坡简体 Singapore Simplified (zh-sg)
- 臺灣正體 Taiwanese Traditional (zh-tw)
----
==Language selection
====//Background//
Readers can have one //Primary// language and as many //secondary// languages as they desire. The 'chrome' (eg. non-content) text will be shown in their iPhone system language, even if that language does not match their primary wiki-language. The primary wiki-language is the default language for search, secondary wiki-languages are shown as tabs on the search screen and are also floated to the top of the language selection list in-article. All wiki-languages by default are shown in the content of the Explore feed (eg. cards from each selected language will show as available in the Explore feed) unless explicitly turned off by the reader.
Readers can select languages in 4 places:
- During onboarding
- From the settings screen
- In the article view
- In the search screen
====//Language selection during onboarding//
During onboarding we will detect the reader's system language (eg what their iPhone is set to) and suggest that language as their //Primary// language, as well as any other languages they may have on their iPhone as //secondary// languages. Readers may only have one Primary language, but they are welcome to add as many secondary languages as they desire. We will support a reader's choice to add as many Chinese variants as they would like (even all 6).
Apple currently supports three Chinese variants so we will need to map these variants to our supported variants. Below is a suggested mapping:
|iPhone language | Default Wiki-language
|--- |---
| Chinese, Simplified | Chinese, Simplified (zh-hans)
| Chinese, Traditional | Chinese, Traditional (zh-hant)
| Chinese, Traditional (Hong Kong) | Hong Kong Traditional (zh-hk)
====//Language selection from Settings//
When a reader taps on the 'gear' icon in the top of their Explore feed they are brought to the Settings page. In the Settings page they can edit their selected languages by tapping on 'My languages'. Here we will give readers the same options that they had in onboarding (eg. to set a primary language and to add/remove secondary languages). Just like during onboarding they can pick as many or as few secondary languages as they desire. In Settings, readers can also turn languages on and off in the Explore feed, or turn specific Explore feed cards on and off.
====//In-article language selection behavior//
In the article view, readers can tap on the language button in the toolbar to change the language of the article. This is not a global setting, but will persist as long as the reader is tapping on blue links from within an article in that language (eg. if my primary language is English but I change the language of an article to French, when I tap on a blue link to the article 'chat' from the current article I am brought to the fr-wiki 'chat' article and not the en-wiki 'cat' article.)
//Details of in-article language selection//
- If a reader's primary language is a ZH variant then all articles should be shown in this variant //unless// they switch their language by using the article toolbar
- Following blue links should persist the ZH variant of the parent article (eg. if the reader loads an article in zh-cn and then taps on a blue link in the article that article should be loaded in zh-cn even if their primary language is zh-hk)
//ZH variant as primary language//
{F32409305 width=1000}
//Non-ZH variant as primary language//
{F32409306 width=1000}
====//Language selection from Search//
On search all of the languages that a reader has selected (primary and secondary) are shown as tabs. Tapping on a tab enables the reader to search in the selected language. If a reader has more than 3 languages (1 primary and 2 secondary) then they will need to tap on the 'more' button to view all of their languages and select their desired language. Tapping on the 'more' button also opens the 'Wikipedia languages panel; from here they can add languages as secondary languages or tap on edit to remove or reorder their languages. Changes made in the 'more' panel in search are //global// changes and are reflected in settings and throughout the app.
----
====Editing impact
No changes need to be made in the iOS app. ZH wiki utilizes [[ https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter | Language converter]], which enables contributors to write in their preferred variant, while updating the article across all variants.
----
==Relevant documents
[[ https://en.wikipedia.org/wiki/Chinese_Wikipedia#Automatic_conversion_between_traditional_and_simplified_Chinese_characters | Wikipedia article about Chinese Wikipedia's use of automatic conversion ]]
[[ https://meta.wikimedia.org/wiki/Wikipedias_in_multiple_writing_systems#Chinese_Wikipedia | Wikipedias in multiple writing systems ]]
[[ https://meta.wikimedia.org/wiki/Automatic_conversion_between_simplified_and_traditional_Chinese | Automatic conversion between simplified and traditional Chinese]]
[[ https://www.mediawiki.org/wiki/Writing_systems#LanguageConverter | Language converter]]
[[ https://www.mediawiki.org/wiki/Writing_systems/Syntax | Language converter: syntax ]]
----
===Questions
- If a reader has a ZH variant selected as their primary language (let's say zh-cn) AND a ZH variant selected as a secondary language (let's say zh-hk) then the Explore feed should we show Explore feed cards in both variants by default (as readers can turn languages off in Explore feed settings)?
- //Answer//: As each variant will be a first class language we will show all languages by default in the Explore feed and allow readers to turn cards off as they desire using Explore feed settings
- If a reader has multiple variants selected as secondary languages, should we support showing //all// of their selected variants in search?
- //Answer//: Same as above, as each variant will be a first class language we will show all selected variants in search.