// searchDictFile searchs a dictionary file. At first, search locale directory under the dict_path.
// if not find, search "base" directory.
// fieldName should be same as filename.
searchDictFile searchs a dictionary file. At first, search locale directory under the dict_path.
if not find, search "base" directory.
fieldName should be same as filename.
// searchDictFile searchs a dictionary file . At first search locale directory under the dict_path . // if not find search " base " directory . // fieldName should be same as filename .
func searchDictFile(locale string, fieldName string) (string, error){
	filename := filepath.Join(dict_path, locale, fieldName)
	if _, err := os.Stat(filename); err == nil {
		return filename, nil
	}
	filename = filepath.Join(dict_path, "base", fieldName)
	if _, err := os.Stat(filename); err == nil {
		return filename, nil
	}else{
		return "", errors.New("Could not find dictionary:" + filename)
	}
}
func searchDictFile ( locale string , fieldName string ) ( string , error ) { filename := filepath . Join ( dict_path , locale , fieldName ) if _ , err := os . Stat ( filename ) ; err == nil { return filename , nil } filename = filepath . Join ( dict_path , " " , fieldName ) if _ , err := os . Stat ( filename ) ; err == nil { return filename , nil } else { return " " , errors . New ( " " + filename ) } }
searchDictFile searchs a dictionary file.
searchDictFile searchs a dictionary file .
// a dict file is not in that locale. try to read base directory.