Mardak / profile

2 stars 7 forks source link

Map internal english interest tokens to Chinese for survey query params #64

Closed Mardak closed 10 years ago

Mardak commented 10 years ago

@PinZhang, you provided a category mapping that we'll want to pass to the survey so the correct interests are shown. @mzhilyaev, do you have a suggestion on where this translation should happen? I see Controller.js has getInterestsForSurvey:

https://github.com/Mardak/profile/blob/master/lib/Controller.js#L208

---- Categories ----- 手机 mobile
手机应用 app
数码 digital
摄影(图片器材) photography-dc
汽车 auto
房产 realestate
家电 home-applicance
家居装修 home-decoration
潮流女(服装配饰) fashion-women
潮流男(服装配饰) fashion-men
奢侈品 luxury
美容(美妆美发) beauty
美体(减肥瘦身) fitness
健康(养生食品安全) health
医疗看病 medicine
图书文学 book
在线小说 online-novel
烹饪 cooking
食品美食 gourmet
婚嫁 wedding
亲子育婴 parenting
升学教育(考试留学) education
自我学习 mooc
旅游 travel
休闲活动(演出电影) show
科技IT互联网 technology
编程技术 programming
科学科普 science
新闻资讯 news
政治军事法制 military
金融财经 finance
综艺娱乐八卦 entertainment-gossip
搞笑 humor
音乐 music
电影 movie
电视剧 TV-series
游戏 game
动漫 anime-manga
体育 sports
篮球 basketball
足球 soccer

PinZhang commented 10 years ago

Looks good to me, thanks.

Mardak commented 10 years ago

I mean we'll need code in the add-on perhaps in the Controller code I linked that passes in the chinese versions of the interests to the survey url.

PinZhang commented 10 years ago

I can work on this at this Friday or next Monday.

Mardak commented 10 years ago

The survey endpoint should be https://www.surveygizmo.com/s3/1545511/firefox-personalization-cn

Mardak commented 10 years ago

I tested this with a russian Firefox build and it seems to correctly default to en-US rules with this fix https://github.com/Mardak/profile/commit/874624acefefdf892acb8665427929267c325fac. The dispatcher still reports the user's actual locale and not the worker locale though.. Perhaps that's just something we'll just need to keep in mind when analyzing results from unexpected user agent locales.

Mardak commented 10 years ago

@PinZhang can you confirm that the latest master with this fix on a chinese browsing profile in zh-CN firefox correctly shows a localized confirmation page with localized survey and localized interests to choose (on page 2)?

PinZhang commented 10 years ago

@Mardak, my browser is en-US Firefox, i tried to create a profile and set 'general.useragent.local' with 'zh-CN', and reopen with 'cfx run -p cnprofile', I found the about:upstudy-consent page is still English, but the survey page is Chinese.

mzhilyaev commented 10 years ago

Pin, just going to configuration and changing general.useragent.local to zh-CN, will not work. instead:

If you do not have it installed, it would be the simplest to just load a chinese version of the browser from here: http://www.firefox.com.cn/

PinZhang commented 10 years ago

@mzhilyaev, you are right, I tried it on the zh-CN Firefox, it showed me the zh-CN consent page. Then everything looks fine to me, :)