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.

36 lines
742 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. it: 'Italiano',
  12. nl: 'Nederlands',
  13. no: 'Norsk',
  14. oc: 'Occitan',
  15. pl: 'Polszczyzna',
  16. pt: 'Português',
  17. 'pt-BR': 'Português do Brasil',
  18. fi: 'Suomi',
  19. ru: 'Русский',
  20. uk: 'Українська',
  21. ja: '日本語',
  22. 'zh-CN': '简体中文',
  23. 'zh-HK': '繁體中文(香港)',
  24. 'zh-TW': '繁體中文(臺灣)',
  25. bg: 'Български',
  26. }.freeze
  27. def human_locale(locale)
  28. HUMAN_LOCALES[locale]
  29. end
  30. def hash_to_object(hash)
  31. HashObject.new(hash)
  32. end
  33. end