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)') 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+:" 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/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 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()) {