Guest User

Untitled

a guest
Feb 15th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. /*
  2. * Creado por: David Pérez S.
  3. * Universidad Politécnica de Chiapas
  4. * Fecha de Creación: 26/09/2018
  5. */
  6.  
  7. /**
  8. * @author David Pérez S.
  9. */
  10. import java.io.IOException;
  11. import java.util.Properties;
  12.  
  13. public class Language extends Properties{
  14.  
  15. private static final long serialVersionUID = 1L;
  16.  
  17. public Language(String languageName){
  18.  
  19. //Modify if you want add more languages
  20. // Change the name of the files or add what you need
  21. switch(languageName){
  22. case "Spanish":
  23. getProperties("SpanishProperties.properties");
  24. break;
  25. case "English":
  26. getProperties("EnglishProperties.properties");
  27. break;
  28. default:
  29. getProperties("SpanishProperties.properties");
  30. }
  31. }
  32.  
  33. private void getProperties(String idioma) {
  34. try {
  35. this.load( getClass().getResourceAsStream(idioma) );
  36. } catch (IOException ex) {
  37.  
  38. }
  39. }
  40. }
Add Comment
Please, Sign In to add comment