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.

38 lines
785 B

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