001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.search; 020 021public class SearchUtil { 022 023 public static String translateLanguage(String language) { 024 if(language==null)return null; 025 language=language.toLowerCase().trim(); 026 027 if(language.equals("en")) return "english"; 028 if(language.equals("de")) return "german"; 029 if(language.equals("ru")) return "russian"; 030 if(language.equals("nl")) return "dutch"; 031 if(language.equals("fr")) return "french"; 032 if(language.equals("it")) return "italian"; 033 if(language.equals("no")) return "norwegian"; 034 if(language.equals("pt")) return "portuguese"; 035 if(language.equals("sp")) return "spanish"; 036 if(language.equals("br")) return "brazilian"; 037 if(language.equals("cn")) return "chinese"; 038 if(language.equals("gr")) return "greek"; 039 if(language.equals("el")) return "greek"; 040 if(language.equals("th")) return "thai"; 041 if(language.equals("dk")) return "danish"; 042 if(language.equals("jp")) return "japanese"; 043 if(language.equals("no")) return "norwegian"; 044 if(language.equals("kr") || language.equals("kp") || language.equals("ko")) 045 return "korean"; 046 047 return language; 048 } 049}