package eoa_Language;

import java.util.Locale;
import java.util.ResourceBundle;

public class TextResource {
	private final static String fileName = "Schunk/Gripper/Language/text";
	private ResourceBundle resource;

	public TextResource(Locale locale) {
		locale = locale.equals(LanguagePack.rootLanguageLocale) ? Locale.ROOT : locale;
		resource = ResourceBundle.getBundle(fileName, locale);
		
	}

	public String get_TWait(){
		return getStringByKey("T_Wait");
	}
	public String get_DO_Close(){
		return getStringByKey("DO_Close");
	}
	public String get_DO_Open(){
		return getStringByKey("DO_Open");
	}

	public String get_OpenClose(){
		return getStringByKey("Open_Close");
	}
	public String get_DirectMovement(){
		return getStringByKey("Warning_DirectMovement");
	}
	public String get_btn_Open(){
		return getStringByKey("btn_Open");
	}
	public String get_btn_Close(){
		return getStringByKey("btn_Close");
	}
	public String get_Title_Grp_Close(){
		return getStringByKey("Title_Grp_Close");
	}
	public String get_Title_Grp_Open(){
		return getStringByKey("Title_Grp_Open");
	}
	public String getTitle() {
		return getStringByKey("Title");
	}
	public String get_Error_IO_Config(){
		return getStringByKey("Error_IO_Config");
	}
	public String get_Path_To_Gripper_Image(){
		return getStringByKey("Path_To_Gripper_Image");
	}
	public String get_Path_To_Logo_Image(){
		return getStringByKey("Path_To_Logo_Image");
	}
	private String getStringByKey(String key) {
		try {
			return resource.getString(key);
		} catch (Exception e) {
			return "!"+key;
		}
	}

}
