2014-07-17 20:16:32 -04:00
ContributeClassView = require ' ./ContributeClassView '
2014-01-06 00:56:32 -05:00
template = require ' templates/contribute/diplomat '
2014-11-28 20:49:41 -05:00
{ me } = require ' core/auth '
2014-01-06 00:56:32 -05:00
2014-11-30 13:57:17 -05:00
require ( " locale/en " )
require ( " locale/en-US " )
require ( " locale/en-GB " )
require ( " locale/en-AU " )
require ( " locale/ru " )
require ( " locale/de-DE " )
require ( " locale/de-AT " )
require ( " locale/de-CH " )
require ( " locale/es-419 " )
require ( " locale/es-ES " )
require ( " locale/zh-HANS " )
require ( " locale/zh-HANT " )
require ( " locale/zh-WUU-HANS " )
require ( " locale/zh-WUU-HANT " )
require ( " locale/fr " )
require ( " locale/ja " )
require ( " locale/ar " )
require ( " locale/pt-BR " )
require ( " locale/pt-PT " )
require ( " locale/pl " )
require ( " locale/it " )
require ( " locale/tr " )
require ( " locale/nl-BE " )
require ( " locale/nl-NL " )
require ( " locale/fa " )
require ( " locale/cs " )
require ( " locale/sv " )
require ( " locale/id " )
require ( " locale/el " )
require ( " locale/ro " )
require ( " locale/vi " )
require ( " locale/hu " )
require ( " locale/th " )
require ( " locale/da " )
require ( " locale/ko " )
require ( " locale/sk " )
require ( " locale/sl " )
require ( " locale/fi " )
require ( " locale/bg " )
require ( " locale/nb " )
2015-02-10 17:13:15 -05:00
require ( " locale/nn " )
2014-11-30 13:57:17 -05:00
require ( " locale/he " )
require ( " locale/lt " )
require ( " locale/sr " )
require ( " locale/uk " )
require ( " locale/hi " )
require ( " locale/ur " )
require ( " locale/ms " )
require ( " locale/ca " )
require ( " locale/gl " )
2014-12-28 19:03:09 -05:00
require ( " locale/mk-MK " )
2014-11-30 13:57:17 -05:00
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 '
2014-01-06 00:56:32 -05:00
template: template
2014-04-12 17:53:09 -04:00
contributorClassName: ' diplomat '
2014-08-14 14:43:35 -04:00
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
2014-11-30 13:57:17 -05:00
continue if languageCode is ' update '
2014-08-14 14:43:35 -04:00
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-12-10 05:20:54 -05:00
ru: [ ' fess89 ' , ' ser-storchak ' , ' Mr A ' , ' a1ip ' , ' iulianR ' , ' EagleTA ' , ' kisik21 ' , ' Shpionus ' , ' kerradus ' , ' ImmortalJoker ' , ' nixel ' ] # русский язык, Russian
2014-09-09 20:57:47 -04:00
' de-DE ' : [ ' Dirk ' , ' faabsen ' , ' HiroP0 ' , ' Anon ' , ' bkimminich ' , ' bahuma20 ' , ' domenukk ' , ' dkundel ' , ' djsmith85 ' ] # Deutsch (Deutschland), German (Germany)
2014-08-30 22:30:33 -04:00
' de-AT ' : [ ' djsmith85 ' ] # Deutsch (Österreich), German (Austria)
' de-CH ' : [ ' greyhusky ' ] # Deutsch (Schweiz), German (Switzerland)
2015-01-08 23:49:18 -05:00
' es-419 ' : [ ' Jesús Ruppel ' , ' Matthew Burt ' , ' Mariano Luzza ' , ' 2xG ' , ' Federico Tomas ' ] # español (América Latina), Spanish (Latin America)
2014-08-30 21:51:02 -04:00
' es-ES ' : [ ' Matthew Burt ' , ' DanielRodriguezRivero ' , ' Anon ' , ' Pouyio ' , ' 3rr3s3v3n ' , ' OviiiOne ' , ' Vindurrin ' ] # español (ES), Spanish (Spain)
2014-08-30 22:30:33 -04:00
' zh-HANS ' : [ ' Adam23 ' , ' spacepope ' , ' yangxuan8282 ' , ' Cheng Zheng ' , ' yfdyh000 ' , ' julycoolwind ' , ' Vic020 ' , ' onion7878 ' , ' BonnieBBS ' , ' 1c7 ' , ' ZephyrSails ' ] # 简体中文, Chinese (Simplified)
' zh-HANT ' : [ ' gintau ' , ' Adam23 ' ] # 繁体中文, Chinese (Traditional)
2014-08-14 14:43:35 -04:00
' zh-WUU-HANS ' : [ ] # 吴语, Wuu (Simplified)
2014-08-30 22:30:33 -04:00
' zh-WUU-HANT ' : [ ' benojan ' ] # 吳語, 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
2015-02-01 06:01:18 -05:00
ja: [ ' g1itch ' , ' kengos ' , ' treby ' , ' Coderaulic ' ] # 日本語, Japanese
2014-08-30 21:51:02 -04:00
ar: [ ' ahmed80dz ' , ' 5y ' ] # العربية, Arabic
' 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
2014-08-30 22:30:33 -04:00
' nl-BE ' : [ ' Glen De Cauwsemaecker ' , ' Ruben Vereecken ' ] # Nederlands (België), Dutch (Belgium)
' nl-NL ' : [ ' Jasper D \' haene ' , ' Guido Zuidhof ' ] # Nederlands (Nederland), Dutch (Netherlands)
2014-08-14 14:43:35 -04:00
fa: [ ' Reza Habibi (Rehb) ' ] # فارسی, Persian
2014-12-21 15:53:43 -05:00
cs: [ ' vanous ' , ' Martin005 ' ] # čeština, Czech
2014-08-30 21:51:02 -04:00
sv: [ ' iamhj ' ] # Svenska, Swedish
id: [ ' mlewisno-oberlin ' ] # Bahasa Indonesia, Indonesian
2014-08-14 14:43:35 -04:00
el: [ ' Stergios ' ] # ελληνικά, Greek
ro: [ ] # limba română, Romanian
vi: [ ' An Nguyen Hoang Thien ' ] # Tiếng Việt, Vietnamese
2014-12-08 08:59:29 -05:00
hu: [ ' ferpeter ' , ' csuvsaregal ' , ' atlantisguru ' , ' Anon ' , ' kinez ' , ' bbeasmile ' , ' divaDseidnA ' ] # magyar, Hungarian
2014-08-14 14:43:35 -04:00
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
2014-08-14 14:43:35 -04:00
sk: [ ' Anon ' ] # slovenčina, Slovak
sl: [ ] # slovenščina, Slovene
fi: [ ] # suomi, Finnish
bg: [ ] # български език, Bulgarian
2015-02-10 17:13:15 -05:00
nb: [ ' bardeh ' , ' torehaug ' , ' ebirkenes ' , ' mcclane654 ' , ' matifol ' , ' mogsie ' ] # Norsk Bokmål, Norwegian (Bokmål)
nn: [ ] # Norsk Nynorsk, Norwegian (Nynorsk)
2014-08-30 21:51:02 -04:00
he: [ ' OverProgram ' , ' monetita ' ] # עברית, Hebrew
2014-08-14 14:43:35 -04:00
lt: [ ] # lietuvių kalba, Lithuanian
sr: [ ] # српски, Serbian
2014-12-08 09:37:09 -05:00
uk: [ ' fess89 ' , ' ImmortalJoker ' , ' gorodsb ' , ' endrilian ' , ' OlenaGapak ' , ' probil ' , ' Rarst ' ] # українська мова, Ukrainian
2014-08-14 14:43:35 -04:00
hi: [ ] # मानक हिन्दी, Hindi
ur: [ ] # اُردُو, Urdu
ms: [ ] # Bahasa Melayu, Bahasa Malaysia
2014-08-30 21:51:02 -04:00
ca: [ ' ArniMcFrag ' ] # Català, Catalan
2014-11-07 12:08:30 -05:00
gl: [ ' mcaeiror ' ] # Galego, Galician
2014-12-28 19:03:09 -05:00
' mk-MK ' : [ ' SuperPranx ' ] # Македонски, Macedonian