id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
224	Translation: Use default catalog if string not found in plugin catalog	Paul Baranowski <paul@…>	gogo	"If a string is not found in the plugin language catalog, then we should check the main (""HTMLArea"") catalog to see if the string exists there.  That way, we arent duplicating strings in the plugin language catalog.  Also, this still gives the plugin strings preference in case the plugin needs to override a string in the main language catalog.

Here is the new code for HTMLArea._lc() :


{{{

/** Return a localised string.
 * @param string    English language string
 * @param context   Case sensitive context name, eg 'HTMLArea' (default), 'TableOperations'...
 */
HTMLArea._lc = function(string, context)
{
  if(_editor_lang == ""en"")
  {
    return string;
  }

  if(typeof HTMLArea._lc_catalog == 'undefined')
  {
    HTMLArea._lc_catalog = [ ];
  }

  if(typeof context == 'undefined')
  {
    context = 'HTMLArea';
  }

  if(typeof HTMLArea._lc_catalog[context] == 'undefined')
  {
    HTMLArea._lc_catalog[context] = HTMLArea._loadlang(context);
  }

  if(typeof HTMLArea._lc_catalog[context][string] == 'undefined')
  {
  	// If we are looking at a plugin language file,
  	// we now check to see if the string is in the
  	// main translation file so as not to duplicate translation strings. 
  	if (context != 'HTMLArea') {
  		// Load the main language file if it isnt loaded already.
		if(typeof HTMLArea._lc_catalog['HTMLArea'] == 'undefined')
		{
		  HTMLArea._lc_catalog['HTMLArea'] = HTMLArea._loadlang('HTMLArea');
		}
  		// Look for the string in the main language file
		if(typeof HTMLArea._lc_catalog['HTMLArea'][string] != 'undefined') 
		{
		  return HTMLArea._lc_catalog['HTMLArea'][string];
		}
  	}
    return string; // Indicate it's untranslated
  }
  else
  {
    return HTMLArea._lc_catalog[context][string];
  }
}

}}}
"	defect	closed	normal		Xinha Core		normal	fixed		
