From ca78638a21071284ad915799c7ef3df0dd31ae4c Mon Sep 17 00:00:00 2001 From: dreamist Date: Sat, 12 Jul 2014 03:07:58 +0700 Subject: [PATCH 1/4] Update th.coffee One fix and a few more translations --- app/locale/th.coffee | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/app/locale/th.coffee b/app/locale/th.coffee index fdc53c6d8..f78ae1e8b 100644 --- a/app/locale/th.coffee +++ b/app/locale/th.coffee @@ -1,11 +1,11 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", translation: common: loading: "รอสักครู่..." -# saving: "Saving..." + saving: "กำลังบันทึก..." # sending: "Sending..." # send: "Send" cancel: "ยกเลิก" -# save: "Save" + save: "บันทึก" # publish: "Publish" # create: "Create" delay_1_sec: "1 วินาที" @@ -19,21 +19,21 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra # unwatch: "Unwatch" # submit_patch: "Submit Patch" -# units: -# second: "second" -# seconds: "seconds" -# minute: "minute" -# minutes: "minutes" -# hour: "hour" -# hours: "hours" -# day: "day" -# days: "days" -# week: "week" -# weeks: "weeks" -# month: "month" -# months: "months" -# year: "year" -# years: "years" + units: + second: "วินาที" + seconds: "วินาที" + minute: "นาที" + minutes: "นาที" + hour: "ชั่วโมง" + hours: "ชั่วโมง" + day: "วัน" + days: "วัน" + week: "สัปดาห์" + weeks: "สัปดาห์" + month: "เดือน" + months: "เดือน" + year: "ปี" + years: "ปี" modal: close: "ปิด" @@ -69,8 +69,8 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra login: sign_up: "ลงทะเบียนใหม่" log_in: "ลงชื่อเข้าใช้" -# logging_in: "Logging In" - log_out: "ลงชื่ื่อออก" + logging_in: "กำลังเข้าสู่ระบบ" + log_out: "ลงชื่อออก" recover: "กู้บัญชีการใช้งาน" # recover: @@ -78,12 +78,12 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra # send_password: "Send Recovery Password" signup: -# create_account_title: "Create Account to Save Progress" + create_account_title: "สร้างบัญชีใหม่เพื่อบันทึกความก้าวหน้า" # description: "It's free. Just need a couple things and you'll be good to go:" email_announcements: "รับข่าวสารผ่านทางอีเมลล์" # coppa: "13+ or non-USA " coppa_why: "(ทำไม?)" -# creating: "Creating Account..." + creating: "กำลังสร้างบัญชีใหม่..." sign_up: "สมัคร" log_in: "เข้าสู่ระบบด้วยรหัสผ่าน" # social_signup: "Or, you can sign up through Facebook or G+:" From e3183650c59ada51a03cccac2f8de6a830caa309 Mon Sep 17 00:00:00 2001 From: Pete DiSalvo Date: Fri, 11 Jul 2014 22:10:13 -0400 Subject: [PATCH 2/4] Centered CoordinateDisplay background and label --- app/lib/surface/CoordinateDisplay.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/lib/surface/CoordinateDisplay.coffee b/app/lib/surface/CoordinateDisplay.coffee index 448671ce3..87302f37a 100644 --- a/app/lib/surface/CoordinateDisplay.coffee +++ b/app/lib/surface/CoordinateDisplay.coffee @@ -67,8 +67,10 @@ module.exports = class CoordinateDisplay extends createjs.Container radius = 2.5 width = @label.getMeasuredWidth() + 2 * margin height = @label.getMeasuredHeight() + 2 * margin - @label.regX = @background.regX = width / 2 - margin - @label.regY = @background.regY = height / 2 - margin + @label.regX = @background.regX = width / 2 + @label.regY = @background.regY = height / 2 + @label.regX -= margin + @label.regY -= margin @background.graphics .clear() .beginFill('rgba(0,0,0,0.4)') From 8cb7cd770c3d1104c5c29c3dce2a60f18d19f343 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 12 Jul 2014 09:42:50 -0700 Subject: [PATCH 3/4] Fixed i18n population because mongoose has problems with empty objects. --- app/models/CocoModel.coffee | 2 +- scripts/mongodb/migrations/2014-07-09-name-conflicts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/CocoModel.coffee b/app/models/CocoModel.coffee index 0d2846359..045843306 100644 --- a/app/models/CocoModel.coffee +++ b/app/models/CocoModel.coffee @@ -237,7 +237,7 @@ class CocoModel extends Backbone.Model data ?= $.extend true, {}, @attributes schema ?= @schema() or {} if schema.properties?.i18n and _.isPlainObject(data) and not data.i18n? - data.i18n = {} + data.i18n = {'-':'-'} # mongoose doesn't work with empty objects sum += 1 if _.isPlainObject data diff --git a/scripts/mongodb/migrations/2014-07-09-name-conflicts.js b/scripts/mongodb/migrations/2014-07-09-name-conflicts.js index bf15c1a9e..82c872052 100644 --- a/scripts/mongodb/migrations/2014-07-09-name-conflicts.js +++ b/scripts/mongodb/migrations/2014-07-09-name-conflicts.js @@ -46,7 +46,7 @@ db.users.find({anonymous:false}, params).sort({_id:1}).forEach(function (user) { } update.slug = slug; slugs[slug] = user.name; - if(user.slug) return; + if(user.slug === slug) return; print(_.str.sprintf('Setting user %s (%s) to slug %s with update %s', user.name, user.dateCreated, slug, JSON.stringify({$set:update}))); var res = db.users.update({_id:user._id}, {$set:update}); if(res.hasWriteError()) { From f4b22fedc9a1e1f28e2c2f77afd210175a64a1a0 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 12 Jul 2014 09:55:26 -0700 Subject: [PATCH 4/4] Tweaking the visuals for the i18n treema node to mostly ignore the property required to get around mongoose not handling empty objects. --- app/treema-ext.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/treema-ext.coffee b/app/treema-ext.coffee index 314f30149..c7b6fac65 100644 --- a/app/treema-ext.coffee +++ b/app/treema-ext.coffee @@ -248,7 +248,14 @@ class JavaScriptTreema extends CodeTreema class InternationalizationNode extends TreemaNode.nodeMap.object findLanguageName: (languageCode) -> + # to get around mongoose emtpy object bug, there's a prop in the object which needs to be ignored + return '' if languageCode is '-' locale[languageCode]?.nativeDescription or "#{languageCode} Not Found" + + getChildren: -> + res = super(arguments...) + res = (r for r in res when r[0] isnt '-') + res getChildSchema: (key) -> #construct the child schema here