@ -50,9 +50,26 @@ define(req, function(Default, Language) {
var langs = arguments ;
var langs = arguments ;
Object . keys ( externalMap ) . forEach ( function ( code , i ) {
Object . keys ( externalMap ) . forEach ( function ( code , i ) {
var translation = langs [ i ] ;
var translation = langs [ i ] ;
var updated = { } ;
Object . keys ( Default ) . forEach ( function ( k ) {
if ( /^updated_[0-9]+_/ . test ( k ) && ! translation [ k ] ) {
var key = k . split ( '_' ) . slice ( 2 ) . join ( '_' ) ;
// Make sure we don't already have an update for that key. It should not happen
// but if it does, keep the latest version
if ( updated [ key ] ) {
var ek = updated [ key ] ;
if ( parseInt ( ek . split ( '_' ) [ 1 ] ) > parseInt ( k . split ( '_' ) [ 1 ] ) ) { return ; }
}
updated [ key ] = k ;
}
} ) ;
Object . keys ( Default ) . forEach ( function ( k ) {
Object . keys ( Default ) . forEach ( function ( k ) {
if ( /^_/ . test ( k ) ) { return ; }
if ( /^_/ . test ( k ) ) { return ; }
if ( ! translation [ k ] ) {
if ( ! translation [ k ] || updated [ k ] ) {
if ( updated [ k ] ) {
missing . push ( [ code , k , 2 , 'out.' + updated [ k ] ] ) ;
return ;
}
missing . push ( [ code , k , 1 ] ) ;
missing . push ( [ code , k , 1 ] ) ;
}
}
} ) ;
} ) ;
@ -62,10 +79,6 @@ define(req, function(Default, Language) {
missing . push ( [ code , k , 0 ] ) ;
missing . push ( [ code , k , 0 ] ) ;
}
}
} ) ;
} ) ;
/ * i f ( t y p e o f ( t r a n s l a t i o n . _ l a n g u a g e N a m e ) ! = = ' s t r i n g ' ) {
var warning = 'key [_languageName] is missing from translation [' + code + ']' ;
missing . push ( warning ) ;
} * /
} ) ;
} ) ;
cb ( missing ) ;
cb ( missing ) ;
} ) ;
} ) ;