codecombat/app/views/contribute/DiplomatView.coffee

93 lines
5.5 KiB
CoffeeScript
Raw Normal View History

ContributeClassView = require './ContributeClassView'
template = require 'templates/contribute/diplomat'
2014-06-30 22:16:26 -04:00
{me} = require 'lib/auth'
2014-01-06 18:18:40 -05:00
module.exports = class DiplomatView extends ContributeClassView
2014-06-30 22:16:26 -04:00
id: 'diplomat-view'
template: template
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)
2014-08-30 21:51:02 -04:00
ru: ['fess89', 'ser-storchak', 'Mr A', 'a1ip', 'iulianR', 'EagleTA', 'kisik21', 'Shpionus', 'kerradus', 'ImmortalJoker'] # русский язык, Russian
de: ['Dirk', 'faabsen', 'HiroP0', 'Anon', 'bkimminich', 'bahuma20', 'djsmith85', 'greyhusky'] # Deutsch, German
'de-DE': [] # Deutsch (Deutschland), German (Germany)
'de-AT': [] # Deutsch (Österreich), German (Austria)
'de-CH': [] # Deutsch (Schweiz), German (Switzerland)
es: [] # español, Spanish
2014-08-30 21:51:02 -04:00
'es-419': ['Jesús Ruppel', 'Matthew Burt', 'Mariano Luzza', '2xG', ] # español (América Latina), Spanish (Latin America)
'es-ES': ['Matthew Burt', 'DanielRodriguezRivero', 'Anon', 'Pouyio', '3rr3s3v3n', 'OviiiOne', 'Vindurrin'] # español (ES), Spanish (Spain)
zh: ['Adam23', 'spacepope', 'yangxuan8282', 'Cheng Zheng', 'yfdyh000', 'julycoolwind', 'Vic020', 'onion7878', 'BonnieBBS', '1c7', 'benojan', 'ZephyrSails'] # 中文, Chinese
'zh-HANS': [] # 简体中文, Chinese (Simplified)
'zh-HANT': [] # 繁体中文, Chinese (Traditional)
'zh-WUU-HANS': [] # 吴语, Wuu (Simplified)
'zh-WUU-HANT': [] # 吳語, Wuu (Traditional)
2014-08-30 21:51:02 -04:00
fr: ['Xeonarno', 'Elfisen', 'Armaldio', 'MartinDelille', 'pstweb', 'veritable', 'jaybi', 'xavismeh', 'Anon', 'Feugy', 'dc55028', 'ChrisLightman', 'Oaugereau'] # français, French
ja: ['g1itch', 'kengos', 'treby'] # 日本語, Japanese
2014-08-30 21:51:02 -04:00
ar: ['ahmed80dz', '5y'] # العربية, Arabic
pt: [] # português, Portuguese
2014-08-30 21:51:02 -04:00
'pt-BR': ['Gutenberg Barros', 'Kieizroe', 'Matthew Burt', 'brunoporto', 'cassiocardoso', 'Bia41'] # português do Brasil, Portuguese (Brazil)
'pt-PT': ['Matthew Burt', 'ReiDuKuduro', 'Imperadeiro98', 'batista', 'ProgramadorLucas', 'gutierri'] # Português (Portugal), Portuguese (Portugal)
pl: ['Anon', 'Kacper Ciepielewski', 'TigroTigro', 'kvasnyk'] # język polski, Polish
it: ['flauta', 'AlessioPaternoster'] # italiano, Italian
tr: ['Nazım Gediz Aydındoğmuş', 'cobaimelan', 'wakeup', 'gediz', 'ilisyus'] # 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
2014-08-30 21:51:02 -04:00
sv: ['iamhj'] # Svenska, Swedish
id: ['mlewisno-oberlin'] # Bahasa Indonesia, Indonesian
el: ['Stergios'] # ελληνικά, Greek
ro: [] # limba română, Romanian
vi: ['An Nguyen Hoang Thien'] # Tiếng Việt, Vietnamese
2014-08-30 21:51:02 -04:00
hu: ['ferpeter', 'csuvsaregal', 'atlantisguru', 'Anon', 'kinez', 'bbeasmile'] # magyar, Hungarian
th: ['Kamolchanok Jittrepit'] # ไทย, Thai
2014-08-30 21:51:02 -04:00
da: ['Einar Rasmussen', 'sorsjen', 'Randi Hillerøe', 'Anon', 'Silwing', 'Rahazan', 'marc-portier'] # dansk, Danish
ko: ['Melondonut'] # 한국어, Korean
sk: ['Anon'] # slovenčina, Slovak
sl: [] # slovenščina, Slovene
fi: [] # suomi, Finnish
bg: [] # български език, Bulgarian
2014-08-30 21:51:02 -04:00
no: ['bardeh', 'torehaug'] # Norsk, Norwegian
nn: [] # Norwegian (Nynorsk), Norwegian Nynorsk
nb: [] # Norsk Bokmål, Norwegian (Bokmål)
2014-08-30 21:51:02 -04:00
he: ['OverProgram', 'monetita'] # עברית, Hebrew
lt: [] # lietuvių kalba, Lithuanian
sr: [] # српски, Serbian
2014-08-30 21:51:02 -04:00
uk: ['fess89', 'ImmortalJoker', 'gorodsb', 'endrilian', 'OlenaGapak'] # українська мова, Ukrainian
hi: [] # मानक हिन्दी, Hindi
ur: [] # اُردُو, Urdu
ms: [] # Bahasa Melayu, Bahasa Malaysia
2014-08-30 21:51:02 -04:00
ca: ['ArniMcFrag'] # Català, Catalan