[Web] Add language setting into the parameter in the url (e.g. https://app.gametize.com/lang=es)
Answered/ImplementedThis will enable users to immediately change their language setting, instead of us giving a link and them having to manually change.
-
Official comment
Here's a quick guide on how to change default language setting for your Project using the Project link: Can Admins change the default system language for a Project?
Comment actions -
I tagged this as 'For Consideration' / 'Answered' for now, because it actually involves quite a major change in code structure for what I believe to just be a minor improvement in user experience.
Structural Context
Right now, the routing in app.gametize.com supports parameterized URLs, but only in a strict order it is written. For example, https://app.gametize.com/project/826/category/1008 will lead you to a Project ID 826 and Topic Category 1008, but https://app.gametize.com/category/1008/project/826/ is not going to lead you anywhere.
A lang parameter, in my opinion, should be agnostic to the order it is written. Unfortunately, we cannot support this for the time being without major structural changes to the routing code.
Besides, your language settings on app.gametize.com are currently stored in localStorage. In layman, it means you can log out, close your browser, turn off your computer, and come back and the existing language settings will still be in play (as long as you do not clear your browsing history or cache).
With parameterized URLs, we also need to think about default cases. Imagine that I have previously set my language to Spanish, ie. it is now stored. What happens if I use https://app.gametize.com/project/826 instead of https://app.gametize.com/project/826?lang=es?
Should a URL without the lang parameter allow me to continue using my previously set language, or should it return to the default language (in the case of app.gametize.com, your own browser language)?
Key Question to Ask
My interpretation now is that this will just be a minor improvement in the user experience. I will be curious to know if there are observed problems with clicking on the globe interface to change the language.
Assuming we are either keeping the existing interface or using the URL approach (having both will be trickier to maintain; a lot of entry points and variables to account for and a longer time to re-write), I would prefer the former.
The latter involves the visitor actually knowing the string to be used in the parameter (eg. 'en', 'es', 'zh-Hans', 'zh-Hant' etc), while the former only expects him/her to recognise what the language looks like (in the Language Selection pop-up dialog).
-
This feature has been added to the latest deployment of app.gametize.com. Also, Thai, Swedish and Indonesian support have been included.
How to Use
For instance, if given the url https://app.gametize.com/project/1515, to set the language to Swedish: you change the URL to https://app.gametize.com/project/1515?lang=sv. For Traditional Chinese, you will be using https://app.gametize.com/project/1515?lang=zh-Hant. For the accepted values after "lang=", refer to the Technicalities section below.Technicalities
The value to be used after "lang=" support ISO 639-1 strings with ISO 15924 script codes, in the format of ll-Xxxx. I implemented it so that the values are not case-sensitive. Here are the ones you can use, sorted by language:
English
en
en-ar
en-au
en-bz
en-ca
en-cb
en-cn
en-dk
en-hk
en-in
en-id
en-ie
en-jm
en-ja
en-my
en-nz
en-no
en-ph
en-pr
en-sg
en-za
en-se
en-gb
en-us
en-zw
eng
Simplified Chinese
zh-hans
zh-sg
zh-cn
Traditional Chinese
zh-hant
zh-tw
zh-hk
zh-mo
Malay
ms
ms-my
Spanish
es
es-es
es-es_tradnl
es-mx
es-gt
es-cr
es-pa
es-do
es-ve
es-co
es-pe
es-ar
es-ec
es-cl
es-uy
es-py
es-bo
es-sv
es-hn
es-ni
es-pr
es-us
spaIndonesian
id
id-id
ind
Swedish
sv
sweThai
th
tha -
Thank you Lee Chuan Xin. Regarding your questions below, I thought to quickly answer them, though it is more for informational sake as this is already implemented (btw I did not know about this! cool feature).
- Key Question to Ask
- My interpretation now is that this will just be a minor improvement in the user experience. I will be curious to know if there are observed problems with clicking on the globe interface to change the language.
- Assuming we are either keeping the existing interface or using the URL approach (having both will be trickier to maintain; a lot of entry points and variables to account for and a longer time to re-write), I would prefer the former.
- The latter involves the visitor actually knowing the string to be used in the parameter (eg. 'en', 'es', 'zh-Hans', 'zh-Hant' etc), while the former only expects him/her to recognise what the language looks like (in the Language Selection pop-up dialog).
The consideration here is actually for the perspective of the adminstrator sharing the link of the project to promote the game. Therefore, if the content is already in e.g. Spanish, the UI language should by default be in Spanish if the adminstrator prefers it to be so, when the user loads it.
The next iteration should allow the administrator to set the default language for web, which actually used to be the case. Old times, Damon Widjaja!
Please sign in to leave a comment.
Comments
4 comments