Added a quick visualization of language localization completion to the Diplomat page.
This commit is contained in:
parent
5a700c14df
commit
719e64e85f
3 changed files with 99 additions and 56 deletions
app
|
@ -1,7 +1,7 @@
|
||||||
FacebookHandler = require 'lib/FacebookHandler'
|
FacebookHandler = require 'lib/FacebookHandler'
|
||||||
GPlusHandler = require 'lib/GPlusHandler'
|
GPlusHandler = require 'lib/GPlusHandler'
|
||||||
LinkedInHandler = require 'lib/LinkedInHandler'
|
LinkedInHandler = require 'lib/LinkedInHandler'
|
||||||
locale = require 'locale/locale'
|
locale = require 'locale/locale' # TODO: don't require all of these? Might be slow. (Haven't checked.)
|
||||||
{me} = require 'lib/auth'
|
{me} = require 'lib/auth'
|
||||||
Tracker = require 'lib/Tracker'
|
Tracker = require 'lib/Tracker'
|
||||||
CocoView = require 'views/kinds/CocoView'
|
CocoView = require 'views/kinds/CocoView'
|
||||||
|
|
|
@ -47,66 +47,25 @@ block content
|
||||||
.contributor-signup-anonymous
|
.contributor-signup-anonymous
|
||||||
.contributor-signup(data-contributor-class-id="translator", data-contributor-class-name="diplomat")
|
.contributor-signup(data-contributor-class-id="translator", data-contributor-class-name="diplomat")
|
||||||
|
|
||||||
|
|
||||||
h3(data-i18n="contribute.translating_diplomats")
|
h3(data-i18n="contribute.translating_diplomats")
|
||||||
| Our Translating Diplomats:
|
| Our Translating Diplomats:
|
||||||
|
|
||||||
//#contributor-list
|
//#contributor-list
|
||||||
// TODO: collect CodeCombat userids for these guys so we can include a tiled list
|
// TODO: collect CodeCombat userids for these guys so we can include a tiled list
|
||||||
ul.diplomats
|
ul.diplomats
|
||||||
//li Arabic -
|
each stats, languageCode in languageStats
|
||||||
//li Bahasa Malaysia -
|
if !(languageCode.indexOf('-') != -1 && stats.completion < 0.02 && !stats.diplomats.length)
|
||||||
//li Bulgarian -
|
li
|
||||||
//li Catalan -
|
a(href=stats.githubURL)
|
||||||
li Chinese - Chinese - Adam23, spacepope, yangxuan8282, Cheng Zheng
|
span= stats.englishDescription
|
||||||
//li Chinese (Simplified) -
|
if stats.englishDescription != stats.nativeDescription
|
||||||
//li Chinese (Traditional) -
|
span.spl.spr -
|
||||||
li Czech - vanous
|
span= stats.nativeDescription
|
||||||
li Danish - Einar Rasmussen, sorsjen, Randi Hillerøe, Anon
|
if stats.diplomats.length
|
||||||
li Dutch - Glen De Cauwsemaecker, Guido Zuidhof, Ruben Vereecken, Jasper D'haene
|
span.spl - #{stats.diplomats.join(', ')}
|
||||||
//li Dutch (Belgium) -
|
.progress
|
||||||
//li Dutch (Netherlands) -
|
.progress-bar(style='width: ' + (100 * stats.completion) + '%')
|
||||||
//li English -
|
span(style=stats.completion < 0.06 ? 'color: black; text-shadow: 0px 1px 0px white' : '')= (100 * stats.completion).toFixed(1) + '%'
|
||||||
//li English (AU) -
|
|
||||||
//li English (UK) -
|
|
||||||
//li English (US) -
|
|
||||||
//li Finnish -
|
|
||||||
li French - Xeonarno, Elfisen, Armaldio, MartinDelille, pstweb, veritable, jaybi, xavismeh, Anon, Feugy
|
|
||||||
li German - Dirk, faabsen, HiroP0, Anon, bkimminich
|
|
||||||
//li German (Austria) -
|
|
||||||
//li German (Germany) -
|
|
||||||
//li German (Switzerland) -
|
|
||||||
li Greek - Stergios
|
|
||||||
//li Hebrew -
|
|
||||||
//li Hindi -
|
|
||||||
li Hungarian - ferpeter, csuvsaregal, atlantisguru, Anon
|
|
||||||
//li Indonesian -
|
|
||||||
li Italian - flauta
|
|
||||||
li Japanese - g1itch, kengos, treby
|
|
||||||
//li Korean -
|
|
||||||
//li Lithuanian -
|
|
||||||
li Norwegian - bardeh
|
|
||||||
//li Norwegian (Bokmål) -
|
|
||||||
//li Norwegian Nynorsk -
|
|
||||||
li Persian - Reza Habibi (Rehb)
|
|
||||||
li Polish - Anon, Kacper Ciepielewski
|
|
||||||
//li Portuguese -
|
|
||||||
li Portuguese (Brasil) - Gutenberg Barros, Kieizroe, Matthew Burt, brunoporto, cassiocardoso
|
|
||||||
li Portuguese (Portugal) - Matthew Burt, ReiDuKuduro, Imperadeiro98
|
|
||||||
//li Romanian -
|
|
||||||
li Russian - fess89, ser-storchak, Mr A, a1ip
|
|
||||||
//li Serbian -
|
|
||||||
li Slovak - Anon
|
|
||||||
//li Slovene -
|
|
||||||
//li Spanish -
|
|
||||||
li Spanish (Latin America) - Jesús Ruppel, Matthew Burt, Mariano Luzza
|
|
||||||
li Spanish (Spain) - Matthew Burt, DanielRodriguezRivero, Anon, Pouyio
|
|
||||||
//li Swedish -
|
|
||||||
li Thai - Kamolchanok Jittrepit
|
|
||||||
li Turkish - Nazım Gediz Aydındoğmuş, cobaimelan, wakeup
|
|
||||||
li Ukrainian - fess89
|
|
||||||
//li Urdu -
|
|
||||||
li Vietnamese - Vietnamese - An Nguyen Hoang Thien
|
|
||||||
//li Wuu (Simplified) -
|
|
||||||
//li Wuu (Traditional) -
|
|
||||||
|
|
||||||
div.clearfix
|
div.clearfix
|
||||||
|
|
|
@ -6,3 +6,87 @@ module.exports = class DiplomatView extends ContributeClassView
|
||||||
id: 'diplomat-view'
|
id: 'diplomat-view'
|
||||||
template: template
|
template: template
|
||||||
contributorClassName: 'diplomat'
|
contributorClassName: 'diplomat'
|
||||||
|
|
||||||
|
getRenderData: ->
|
||||||
|
context = super()
|
||||||
|
context.viewName = @viewName
|
||||||
|
context.user = @user unless @user?.isAnonymous()
|
||||||
|
context.languageStats = @calculateSpokenLanguageStats()
|
||||||
|
context
|
||||||
|
|
||||||
|
calculateSpokenLanguageStats: ->
|
||||||
|
@locale ?= require 'locale/locale'
|
||||||
|
totalStrings = @countStrings @locale.en
|
||||||
|
languageStats = {}
|
||||||
|
for languageCode, language of @locale
|
||||||
|
languageStats[languageCode] =
|
||||||
|
githubURL: "https://github.com/codecombat/codecombat/blob/master/app/locale/#{languageCode}.coffee"
|
||||||
|
completion: @countStrings(language) / totalStrings
|
||||||
|
nativeDescription: language.nativeDescription
|
||||||
|
englishDescription: language.englishDescription
|
||||||
|
diplomats: @diplomats[languageCode]
|
||||||
|
languageCode: languageCode
|
||||||
|
languageStats
|
||||||
|
|
||||||
|
countStrings: (language) ->
|
||||||
|
translated = 0
|
||||||
|
for section, strings of language.translation
|
||||||
|
translated += _.size strings
|
||||||
|
translated
|
||||||
|
|
||||||
|
diplomats:
|
||||||
|
en: [] # English - English
|
||||||
|
'en-US': [] # English (US), English (US)
|
||||||
|
'en-GB': [] # English (UK), English (UK)
|
||||||
|
'en-AU': [] # English (AU), English (AU)
|
||||||
|
ru: ['fess89', 'ser-storchak', 'Mr A', 'a1ip'] # русский язык, Russian
|
||||||
|
de: ['Dirk', 'faabsen', 'HiroP0', 'Anon', 'bkimminich'] # Deutsch, German
|
||||||
|
'de-DE': [] # Deutsch (Deutschland), German (Germany)
|
||||||
|
'de-AT': [] # Deutsch (Österreich), German (Austria)
|
||||||
|
'de-CH': [] # Deutsch (Schweiz), German (Switzerland)
|
||||||
|
es: [] # español, Spanish
|
||||||
|
'es-419': ['Jesús Ruppel', 'Matthew Burt', 'Mariano Luzza'] # español (América Latina), Spanish (Latin America)
|
||||||
|
'es-ES': ['Matthew Burt', 'DanielRodriguezRivero', 'Anon', 'Pouyio'] # español (ES), Spanish (Spain)
|
||||||
|
zh: ['Adam23', 'spacepope', 'yangxuan8282', 'Cheng Zheng'] # 中文, Chinese
|
||||||
|
'zh-HANS': [] # 简体中文, Chinese (Simplified)
|
||||||
|
'zh-HANT': [] # 繁体中文, Chinese (Traditional)
|
||||||
|
'zh-WUU-HANS': [] # 吴语, Wuu (Simplified)
|
||||||
|
'zh-WUU-HANT': [] # 吳語, Wuu (Traditional)
|
||||||
|
fr: ['Xeonarno', 'Elfisen', 'Armaldio', 'MartinDelille', 'pstweb', 'veritable', 'jaybi', 'xavismeh', 'Anon', 'Feugy'] # français, French
|
||||||
|
ja: ['g1itch', 'kengos', 'treby'] # 日本語, Japanese
|
||||||
|
ar: [] # العربية, Arabic
|
||||||
|
pt: [] # português, Portuguese
|
||||||
|
'pt-BR': ['Gutenberg Barros', 'Kieizroe', 'Matthew Burt', 'brunoporto', 'cassiocardoso'] # português do Brasil, Portuguese (Brazil)
|
||||||
|
'pt-PT': ['Matthew Burt', 'ReiDuKuduro', 'Imperadeiro98'] # Português (Portugal), Portuguese (Portugal)
|
||||||
|
pl: ['Anon', 'Kacper Ciepielewski'] # język polski, Polish
|
||||||
|
it: ['flauta'] # italiano, Italian
|
||||||
|
tr: ['Nazım Gediz Aydındoğmuş', 'cobaimelan', 'wakeup'] # Türkçe, Turkish
|
||||||
|
nl: ['Glen De Cauwsemaecker', 'Guido Zuidhof', 'Ruben Vereecken', 'Jasper D\'haene'] # Nederlands, Dutch
|
||||||
|
'nl-BE': [] # Nederlands (België), Dutch (Belgium)
|
||||||
|
'nl-NL': [] # Nederlands (Nederland), Dutch (Netherlands)
|
||||||
|
fa: ['Reza Habibi (Rehb)'] # فارسی, Persian
|
||||||
|
cs: ['vanous'] # čeština, Czech
|
||||||
|
sv: [] # Svenska, Swedish
|
||||||
|
id: [] # Bahasa Indonesia, Indonesian
|
||||||
|
el: ['Stergios'] # ελληνικά, Greek
|
||||||
|
ro: [] # limba română, Romanian
|
||||||
|
vi: ['An Nguyen Hoang Thien'] # Tiếng Việt, Vietnamese
|
||||||
|
hu: ['ferpeter', 'csuvsaregal', 'atlantisguru', 'Anon'] # magyar, Hungarian
|
||||||
|
th: ['Kamolchanok Jittrepit'] # ไทย, Thai
|
||||||
|
da: ['Einar Rasmussen', 'sorsjen', 'Randi Hillerøe', 'Anon'] # dansk, Danish
|
||||||
|
ko: [] # 한국어, Korean
|
||||||
|
sk: ['Anon'] # slovenčina, Slovak
|
||||||
|
sl: [] # slovenščina, Slovene
|
||||||
|
fi: [] # suomi, Finnish
|
||||||
|
bg: [] # български език, Bulgarian
|
||||||
|
no: ['bardeh'] # Norsk, Norwegian
|
||||||
|
nn: [] # Norwegian (Nynorsk), Norwegian Nynorsk
|
||||||
|
nb: [] # Norsk Bokmål, Norwegian (Bokmål)
|
||||||
|
he: [] # עברית, Hebrew
|
||||||
|
lt: [] # lietuvių kalba, Lithuanian
|
||||||
|
sr: [] # српски, Serbian
|
||||||
|
uk: ['fess89'] # українська мова, Ukrainian
|
||||||
|
hi: [] # मानक हिन्दी, Hindi
|
||||||
|
ur: [] # اُردُو, Urdu
|
||||||
|
ms: [] # Bahasa Melayu, Bahasa Malaysia
|
||||||
|
ca: [] # Català, Catalan
|
||||||
|
|
Reference in a new issue