You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
855 B

  1. # frozen_string_literal: true
  2. module SettingsHelper
  3. HUMAN_LOCALES = {
  4. en: 'English',
  5. ar: 'العربية',
  6. bg: 'Български',
  7. de: 'Deutsch',
  8. eo: 'Esperanto',
  9. es: 'Español',
  10. fa: 'فارسی',
  11. fi: 'Suomi',
  12. fr: 'Français',
  13. he: 'עברית',
  14. hr: 'Hrvatski',
  15. hu: 'Magyar',
  16. id: 'Bahasa Indonesia',
  17. io: 'Ido',
  18. it: 'Italiano',
  19. ja: '日本語',
  20. nl: 'Nederlands',
  21. no: 'Norsk',
  22. oc: 'Occitan',
  23. pl: 'Polszczyzna',
  24. pt: 'Português',
  25. 'pt-BR': 'Português do Brasil',
  26. ru: 'Русский',
  27. uk: 'Українська',
  28. 'zh-CN': '简体中文',
  29. 'zh-HK': '繁體中文(香港)',
  30. 'zh-TW': '繁體中文(臺灣)',
  31. }.freeze
  32. def human_locale(locale)
  33. HUMAN_LOCALES[locale]
  34. end
  35. def hash_to_object(hash)
  36. HashObject.new(hash)
  37. end
  38. end