Validate translations

pull/8/head
Rodrigo Nascimento 11 years ago
parent 3f328462ef
commit 1612f1da05
  1. 1
      .meteor/packages
  2. 1
      .meteor/versions
  3. 33
      server/startup/i18n-validation.coffee

@ -44,3 +44,4 @@ todda00:friendly-slugs
utilities:avatar
simple:highlight.js
percolate:migrations
underscorestring:underscore.string

@ -108,6 +108,7 @@ todda00:friendly-slugs@0.3.0
tracker@1.0.7
ui@1.0.6
underscore@1.0.3
underscorestring:underscore.string@3.0.3_1
url@1.0.4
utilities:avatar@0.7.10
webapp@1.2.0

@ -0,0 +1,33 @@
flat = (obj, newObj = {}, path = '') ->
for key, value of obj
if _.isObject value
flat value, newObj, key + '.'
else
newObj[path + key] = value
return newObj
Meteor.startup ->
l = {}
errors = []
for lang, value of TAPi18next.options.resStore
l[lang] = flat value
for lang, value of l
for subLang, subValue of l when subLang isnt lang
for key, translation of subValue
if not value[key]?
errors.push "#{lang}: no value found for key #{key} from #{subLang}"
if errors.length > 0
len = 0
for error in errors
if error.length > len
len = error.length
console.log s.rpad('', len + 4, '=').red
for error in errors
console.log "| #{error} |".red
console.log s.rpad('', len + 4, '=').red
Loading…
Cancel
Save